This project is a responsive Ethereum Block Explorer built using React.js, Vite, and ethers.js. The app allows users to view the latest 18 Ethereum blocks, inspect block details, and drill down into transaction details within a selected block.
- Display the latest 18 Ethereum blocks.
- View block details including timestamp, miner, and transactions.
- View details for any transaction within a block, including gas used and status.
-
Clone the repository:
git clone https://github.com/blockchainDevAmitesh/eth-block-explorer.git
-
Navigate to the project directory:
cd ethereum-block-explorer -
Install dependencies:
npm install
-
Setting Alchemy API key: at
App.jsx Ln: 17replaceyourAlchemyApiKeywith your Alchemy Api Key, get yours -
Start the development server:
npm run dev
- Once the app is running, it will display the latest 18 blocks on the Ethereum mainnet.
- Click on any block to view more details.
- Click on any transaction hash to view detailed transaction information, including gas used and transaction status.
App.jsxis the main component that initializes theethers.jsprovider, fetches block data from the Ethereum mainnet, and manages the selected block and transaction states. It rendersBlockList,BlockDetails, andTransactionDetailsbased on user interactions.
BlockList.jsxdisplays the latest 18 blocks as clickablebuttons. Each button shows the block number, and clicking a block will load its details inBlockDetails.
BlockDetails.jsxdisplays details about the selected block, including itstimestamp,miner, andtransactions. Each transaction hash is displayed as abutton, which when clicked, shows transaction details inTransactionDetails.
TransactionDetails.jsxshows detailed information about the selected transaction, such as theblock number,sender,receiver,gas used, andstatusof the transaction (successorfailure).
- React.js: JavaScript library for building user interfaces.
- Vite: Next-generation frontend tool for fast and optimized builds.
- Ethers.jsx: A library for interacting with the Ethereum blockchain.
- Alchemy API: Used to fetch data from the Ethereum blockchain.
- This project is licensed under the MIT License - see the LICENSE