High-performance SQL indexer for EVM-compatible blockchains
A production-ready indexer that fetches and stores blockchain data for later analysis. Optimized for performance with support for parallel block processing, dynamic RPC capability detection, and efficient memory usage.
eth_getBlockReceipts supportgit clone https://github.com/eabz/evm-indexer && cd evm-indexer
docker-compose up -d
This will start: - ClickHouse database on ports 8123 (HTTP) and 9000 (native) - Indexer configured for Ethereum mainnet
docker-compose logs -f indexer
git clone https://github.com/eabz/evm-indexer && cd evm-indexer
cargo build --release
./target/release/indexer \
--chain 1 \
--database clickhouse://user:password@localhost:8123/indexer \
--rpcs https://eth.llamarpc.com \
--start-block 0 \
--batch-size 100
| Flag | Default | Description |
|---|---|---|
--chain |
1 |
Chain ID to index (1=Ethereum, 56=BSC, 137=Polygon, etc.) |
--database |
required | ClickHouse connection string: clickhouse://user:pass@host:port/db |
--rpcs |
required | Comma-separated list of RPC endpoints |
--start-block |
0 |
Block number to start syncing from |
--end-block |
0 |
Last block to sync (0 = continuous sync) |
--batch-size |
200 |
Number of blocks to fetch in parallel |
--ws |
"" |
WebSocket endpoint for real-time block updates |
--traces |
true |
Fetch transaction traces (requires archive node) |
--fetch-uncles |
false |
Fetch uncle blocks (adds 5-10% RPC calls) |
--new-blocks-only |
false |
Only index new blocks (skip historical sync) |
--debug |
false |
Enable debug logging |
Create a .env file (see .env.example):
# ClickHouse Configuration
CLICKHOUSE_DB=indexer
CLICKHOUSE_USER=indexer
CLICKHOUSE_PASSWORD=indexer
# Indexer Configuration
CHAIN_ID=1
START_BLOCK=0
BATCH_SIZE=10
RPC_URL=https://eth.llamarpc.com
DEBUG=true
FETCH_UNCLES=false
TRACES=true
The indexer creates the following tables in ClickHouse:
blocks - Block headers and metadatatransactions - Transaction data with gas infologs - Event logs emitted by contractstraces - Internal transaction tracescontracts - Deployed contract addresseswithdrawals - Validator withdrawals (post-merge)erc20_transfers - ERC20 token transferserc721_transfers - NFT transferserc1155_transfers - Multi-token transfersdex_trades - DEX swap transactionsdex_pairs - DEX pair/pool creation eventsdex_liquidity_updates - Liquidity additions, removals, and sync eventsSee migrations/create_tables.sql for full schema.
eth_getBlockReceipts support = 2x fastermax_insert_block_size for large batchesContributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details
$ claude mcp add evm-indexer \
-- python -m otcore.mcp_server <graph>