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: 17
replaceyourAlchemyApiKey
with 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.jsx
is the main component that initializes theethers.js
provider, fetches block data from the Ethereum mainnet, and manages the selected block and transaction states. It rendersBlockList
,BlockDetails
, andTransactionDetails
based on user interactions.
BlockList.jsx
displays the latest 18 blocks as clickablebuttons
. Each button shows the block number, and clicking a block will load its details inBlockDetails
.
BlockDetails.jsx
displays details about the selected block, including itstimestamp
,miner
, andtransactions
. Each transaction hash is displayed as abutton
, which when clicked, shows transaction details inTransactionDetails
.
TransactionDetails.jsx
shows detailed information about the selected transaction, such as theblock number
,sender
,receiver
,gas used
, andstatus
of the transaction (success
orfailure
).
- 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