git clone https://github.com/blockscout/blockscout
cd blockscout
vim ~/.bashrc
export DATABASE_URL=postgresql://user:password@localhost:5432/explorer
export COIN=MHXW
export ETHEREUM_JSONRPC_VARIANT=geth
export ETHEREUM_JSONRPC_HTTP_URL="http://localhost:8545"
export ETHEREUM_JSONRPC_WS_URL="ws://localhost:8545"
export ETHEREUM_JSONRPC_TRACE_URL="http://localhost:8545"
export BLOCK_TRANSFORMER=clique
export NETWORK="testnet"
export MIX_ENV=prod
make start
Blckscout 网页默认运行在 http://127.0.0.1
另外,Blockscout 默认了一些常见RPC客户端配置文件,例如本地 HardHat 网络可以直接使用:
cd blockscout/docker-compose
docker-compose -f hardhat-network.yml up -d