Run a full OpenScan.AI explorer on your laptop in a few minutes — perfect for development and demos.
A local instance gives you a private explorer UI and API for a devnet (Anvil, Hardhat) or any testnet, so you can inspect transactions, test contract verification, and prototype integrations without touching public infrastructure.
Prerequisites
- Docker 24+ with Docker Compose
- 8 GB RAM available to Docker
- A chain to index: a local devnet or any reachable RPC endpoint
Step 1: Start a local devnet (optional)
If you don’t have a chain handy, start Anvil (from Foundry):
anvil --chain-id 31337Anvil exposes JSON-RPC on http://127.0.0.1:8545 with trace support — everything the indexer needs.
Step 2: Start the explorer stack
git clone https://github.com/OpenScanAI/blockscout.gitcd blockscout/docker-composecp envs/common-blockscout.env.example envs/common-blockscout.envPoint the stack at your chain in envs/common-blockscout.env:
ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:8545ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545CHAIN_ID=31337COIN=ETHNETWORK="Local Devnet"SUBNETWORK="Anvil"
host.docker.internallets containers reach services on your host machine (it works on Docker Desktop for macOS and Windows; on Linux, addextra_hosts: ["host.docker.internal:host-gateway"]or use the host’s LAN IP).
Launch:
docker compose up -ddocker compose logs -f backendStep 3: Watch it index
Within seconds, the backend starts importing blocks. Verify:
curl http://localhost:4000/api/v2/main-page/indexing-statuscurl http://localhost:4000/api/v2/statsOpen the UI at http://localhost — blocks, transactions, and addresses appear as they’re indexed.
Step 4: Exercise it
Deploy a contract to your devnet and watch it show up:
# With Foundry, against the local devnetforge create src/MyToken.sol:MyToken \ --rpc-url http://127.0.0.1:8545 \ --private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80Then try the full local workflow:
- Find the contract address on
http://localhost. - Verify it via the Verify & publish form (or
forge verify-contract --verifier blockscout --verifier-url http://localhost:4000/api ...). - Read and write the contract from the Contract tab.
- Query it via the local API:
curl http://localhost:4000/api/v2/smart-contracts/<address>.
This is the fastest loop for testing verification settings before verifying on a public network.
Step 5: Reset when the chain resets
Devnets restart from empty state. Reset the explorer’s database to match:
docker compose down -vdocker compose up -dPointing at a testnet instead
Swap the env values for a public testnet RPC (e.g. XDC Apothem: https://rpc.apothem.network, CHAIN_ID=51, COIN=TXDC) and recreate the stack. Historical sync takes longer; bound the range with FIRST_BLOCK if you only need recent activity.
Troubleshooting
- No blocks indexing — the container can’t reach your RPC. Confirm
curl http://host.docker.internal:8545works from inside a container, or use the host LAN IP. - UI loads but shows nothing — indexing still in progress; check the indexing-status endpoint.
- Reset didn’t clear data — you skipped
-v; the named volume persists without it.
Next steps
- Full self-hosting docs — production-grade deployments
- Configuration reference
- Contract Verification