hardhat icon indicating copy to clipboard operation
hardhat copied to clipboard

Built-in Web-based Block Explorer for Hardhat Network

Open FireBushtree opened this issue 3 months ago • 6 comments

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:

  1. Automatically launches alongside hardhat node on a separate port (e.g., http://localhost:8546)
  2. Provides real-time visualization of blockchain activity
  3. 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 node performance
  • Optional: Include a --no-explorer flag 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

  1. Improved Developer Experience: Visual feedback makes development more intuitive
  2. Easier Debugging: Quick access to transaction details and blockchain state
  3. Better Onboarding: Lower barrier to entry for new developers
  4. Competitive Advantage: Matches feature parity with Ganache while maintaining Hardhat's flexibility
  5. 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

FireBushtree avatar Sep 10 '25 08:09 FireBushtree

Is anyone working on this at the moment? If not, I have time to develop it.

FireBushtree avatar Sep 10 '25 08:09 FireBushtree

@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 avatar Sep 11 '25 07:09 michalbrabec

@michalbrabec i wii try my best

FireBushtree avatar Sep 12 '25 02:09 FireBushtree

Has anyone started working on this please? Let me know if you are so I can follow up. I'm interested.

ndubuisi-ugwuja avatar Sep 23 '25 18:09 ndubuisi-ugwuja

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

FireBushtree avatar Oct 10 '25 08:10 FireBushtree

Perfect i'll fork and contribute

ndubuisi-ugwuja avatar Oct 10 '25 22:10 ndubuisi-ugwuja