Indexer Integration
A safe EVM indexer combines block polling, bounded log queries, and reorg handling.
export RPC_URL=http://127.0.0.1:8545
pnpm tsx chains/ethereum/samples/indexer/block-poll.ts
pnpm tsx chains/ethereum/samples/indexer/reorg-handling.ts
Strategy:
- Poll
eth_blockNumberand process blocks in order. - Query logs in bounded ranges.
- Keep recent blocks provisional until enough confirmations or Beacon finality.
- If a parent hash does not match the stored canonical chain, roll back affected blocks and replay.
Use Beacon API finality checkpoints from beacon-APIs when your deployment has protected access to a consensus client.