Blockchain Explorer Setup
Public explorers like Etherscan or Solscan are convenient while your network is public and their API is sufficient. Custom explorer is needed in three cases: private/consortium blockchain (no public explorer), custom display logic (branded UI, specific protocol metrics), or privacy requirements (don't want to expose request patterns to third parties).
Platform Selection
Blockscout (Most Common)
Open source, supports all EVM-compatible networks. Written in Elixir/Phoenix. Actively developed, used as official explorer for Gnosis Chain, Optimism, Base and other L2s.
Pros: rich functionality (contract verification, tokens, NFT, DeFi metrics), REST API + GraphQL, active community, good documentation.
Cons: heavy stack (Elixir + PostgreSQL + Redis + node), requires 32+ GB RAM for production, complex initial setup.
Otterscan
Lightweight explorer on React, works directly with Erigon node via extended ots_ namespace API. No separate database — all history stored in node itself.
Pros: minimal footprint, no separate indexing, instant start.
Cons: requires exactly Erigon (not geth/nethermind), no contract verification, basic functionality.
The Graph (for Specific Data)
Not a full explorer, but if you need custom protocol data — subgraph + custom frontend faster and cheaper than full explorer.
Blockscout Deployment
Infrastructure
# docker-compose.yml (simplified)
version: '3.8'
services:
db:
image: postgres:15
environment:
POSTGRES_DB: blockscout
POSTGRES_USER: blockscout
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
shm_size: '512mb' # important for PG performance
redis:
image: redis:7-alpine
command: redis-server --maxmemory 4gb --maxmemory-policy allkeys-lru
backend:
image: blockscout/blockscout:latest
depends_on: [db, redis]
environment:
DATABASE_URL: postgresql://blockscout:${DB_PASSWORD}@db:5432/blockscout
ETHEREUM_JSONRPC_VARIANT: geth # or parity, besu, erigon
ETHEREUM_JSONRPC_HTTP_URL: http://node:8545
ETHEREUM_JSONRPC_WS_URL: ws://node:8546
ETHEREUM_JSONRPC_TRACE_URL: http://node:8545 # for trace_ methods
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
CHAIN_ID: "1"
COIN: ETH
NETWORK: Mainnet
SUBNETWORK: Ethereum Mainnet
# Performance
POOL_SIZE: 80
ECTO_USE_SSL: 'false'
# Contract verification
SOURCIFY_INTEGRATION_ENABLED: 'true'
SOURCIFY_SERVER_URL: https://sourcify.dev/server
ports:
- "4000:4000"
frontend:
image: ghcr.io/blockscout/frontend:latest
environment:
NEXT_PUBLIC_API_HOST: http://backend:4000
NEXT_PUBLIC_NETWORK_NAME: My Network
NEXT_PUBLIC_NETWORK_SHORT_NAME: MyNet
NEXT_PUBLIC_NETWORK_ID: "1"
ports:
- "3000:3000"
Node Requirements
Blockscout uses non-standard RPC methods:
-
debug_traceTransaction— for internal transactions -
trace_block,trace_transaction— for Parity-compatible traces -
eth_getBalancein archive mode — for historical balances
Regular full node is not enough. Need archive node with debug/trace methods enabled:
# Geth archive node
geth --mainnet \
--syncmode full \
--gcmode archive \
--http \
--http.api eth,net,web3,debug,txpool \
--ws \
--ws.api eth,net,web3,debug \
--cache 32768
Archive node for Ethereum mainnet — ~17 TB (2025). This is the main infrastructure cost.
Indexing
On first run Blockscout starts indexing from latest block backwards. For full mainnet history — process takes weeks. Acceleration:
# Variables for parallel indexing
BLOCK_TRANSFORMER: base
INDEXER_BLOCK_REWARD_BATCH_SIZE: 10
INDEXER_COIN_BALANCES_BATCH_SIZE: 500
INDEXER_RECEIPTS_BATCH_SIZE: 250
INDEXER_INTERNAL_TRANSACTIONS_BATCH_SIZE: 20
For private networks with small history — full indexing takes hours.
Contract Verification
Blockscout supports several verification methods:
Via Sourcify (recommended): decentralized repository of verified contracts. If contract is already verified in Sourcify — Blockscout automatically retrieves data.
Direct verification via API:
curl -X POST https://your-blockscout.com/api \
-H "Content-Type: application/json" \
-d '{
"module": "contract",
"action": "verifysourcecode",
"contractaddress": "0x...",
"sourceCode": "pragma solidity...",
"codeformat": "solidity-single-file",
"contractname": "MyContract",
"compilerversion": "v0.8.20+commit.a1b79de6",
"optimizationUsed": 1,
"runs": 200
}'
Custom Metrics and Branded UI
If you need branded explorer with project logo and custom metrics:
- Blockscout supports custom tokens and native coin via env variables
- Frontend (Next.js) can be forked and customized
- Additional pages (e.g., protocol metrics) — added as separate React components
What's Included
- Platform selection based on specific requirements
- Archive node deployment with necessary debug methods
- Blockscout deployment via Docker Compose or Kubernetes
- Initial indexing configuration
- Contract verification setup
- Nginx reverse proxy with SSL, domain name
- Indexer monitoring and lag alerts







