Built-in Web-based Block Explorer for Hardhat Network
Describe the feature
Feature Request: Built-in Web-based Block Explorer for Hardhat Network
Summary
Add a built-in web-based block explorer that automatically starts when running hardhat node, providing developers with a visual interface to monitor blockchain state, accounts, transactions, and deployed contracts.
Motivation
Currently, when developing with Hardhat Network, developers lack an easy way to visually inspect the blockchain state. While tools like Ganache provide excellent GUI interfaces, developers using hardhat node must rely on:
- Console commands to query blockchain state
- External tools that require additional setup
- Manual transaction hash tracking
- Third-party block explorers that need configuration
This creates friction in the development workflow and makes debugging more challenging, especially for developers transitioning from Ganache or those new to Hardhat.
Proposed Solution
Implement a lightweight web-based block explorer that:
- Automatically launches alongside
hardhat nodeon a separate port (e.g.,http://localhost:8546) - Provides real-time visualization of blockchain activity
- Requires zero additional configuration
Core Features
- Accounts Dashboard: Display all accounts with balances, transaction counts, and ETH amounts
- Transaction Explorer: Real-time transaction feed with details (from, to, value, gas, status)
- Block Explorer: Block-by-block navigation with transaction lists and block details
- Contract Registry: Automatic detection and display of deployed contracts with addresses
- Live Updates: WebSocket-based real-time updates as new transactions/blocks are mined
Optional Advanced Features
- Contract interaction interface (read/write functions)
- Transaction search and filtering
- Account activity history
- Gas usage analytics
- Network statistics (block time, gas price, etc.)
Implementation Considerations
- Lightweight: Should not significantly impact
hardhat nodeperformance - Optional: Include a
--no-explorerflag to disable the web interface - Configurable: Allow port customization via
hardhat.config.js - Framework Agnostic: Use vanilla JS/HTML or a minimal framework to reduce dependencies
Benefits
- Improved Developer Experience: Visual feedback makes development more intuitive
- Easier Debugging: Quick access to transaction details and blockchain state
- Better Onboarding: Lower barrier to entry for new developers
- Competitive Advantage: Matches feature parity with Ganache while maintaining Hardhat's flexibility
- Educational Value: Visual representation helps developers understand blockchain concepts
Example Configuration
// hardhat.config.js
module.exports = {
networks: {
hardhat: {
explorer: {
enabled: true,
port: 8546,
host: 'localhost'
}
}
}
};
Alternative Considered
While external tools like Otterscan or custom Etherscan instances exist, they require additional setup and configuration. A built-in solution would provide immediate value out-of-the-box, similar to how hardhat node already includes JSON-RPC server functionality.
Community Impact
This feature would particularly benefit:
- Developers migrating from Ganache
- Educational institutions teaching blockchain development
- Teams doing rapid prototyping and testing
- Solo developers who want quick visual feedback
I believe this feature would significantly enhance the Hardhat development experience and would be happy to contribute to its implementation if the maintainers are interested in this direction.
Search terms
No response
Is anyone working on this at the moment? If not, I have time to develop it.
@FireBushtree we like the idea, this would make a great Hardhat 3 plugin. It would be great if you can work on it, but we would prefer to build it as a plugin at this moment. We would welcome any feedback you might have during implementation and we'll work with you addressing missing APIs.
There have been similar project before, but they had only a limited success so far - for example hardhat-ethernal.
@michalbrabec i wii try my best
Has anyone started working on this please? Let me know if you are so I can follow up. I'm interested.
Has anyone started working on this please? Let me know if you are so I can follow up. I'm interested.
I'm currently trying to build the project. The repository can be found here: https://github.com/FireBushtree/hardhat-forge
Perfect i'll fork and contribute