Expand description
chainindex-core — foundation for the reorg-safe, embeddable indexing engine.
§Architecture
IndexerBuilder → IndexLoop
├── BlockTracker (head tracking, parent hash chain)
├── ReorgDetector (4 reorg scenarios)
├── CheckpointManager (crash recovery)
├── HandlerRegistry (user event/block handlers)
└── Storage backend (memory / SQLite / Postgres)Re-exports§
pub use checkpoint::CheckpointManager;pub use cursor::Cursor;pub use error::IndexerError;pub use handler::EventHandler;pub use handler::HandlerRegistry;pub use indexer::IndexerConfig;pub use indexer::IndexerState;pub use reorg::ReorgDetector;pub use reorg::ReorgEvent;pub use tracker::BlockInfo;pub use tracker::BlockTracker;pub use types::BlockSummary;pub use types::EventFilter;pub use types::IndexContext;
Modules§
- backfill
- Parallel backfill engine for the chainindex pipeline.
- block_
handler - Enhanced block handler system — interval handlers, setup handlers, and execution ordering for block-level operations.
- checkpoint
- Checkpoint manager — persists the indexer’s position for crash recovery.
- cursor
- Indexer cursor — tracks the current position in the chain.
- dlq
- Dead letter queue — captures and retries failed handler events.
- entity
- Entity system — structured storage for indexed blockchain data.
- error
- Error types for the chainindex pipeline.
- export
- Data export — write indexed events to JSONL or CSV files for analytics.
- factory
- Factory contract support — dynamic address tracking for protocols that deploy child contracts (e.g., Uniswap V3 Factory -> Pool).
- finality
- Chain-specific finality models.
- graphql
- Lightweight GraphQL-like query layer for the chainindex entity store.
- handler
- Event and block handler traits + registry.
- hotreload
- Hot-reload configuration system for the chainindex engine.
- idempotency
- Idempotency framework — ensures handlers produce correct state even when replayed after chain reorganizations.
- indexer
- Indexer configuration and state types.
- metrics
- Indexer metrics and observability.
- multichain
- Multi-chain indexer coordinator.
- reorg
- Reorg detection and recovery logic.
- streaming
- Cursor-based event streaming — enables downstream consumers to subscribe to indexed events with resumable, at-least-once delivery.
- trace
- Call trace indexing — index internal transactions (CALL, DELEGATECALL, CREATE)
from
debug_traceBlockByNumberortrace_blockresponses. - tracker
- Block tracker — maintains a sliding window of recent block headers for parent-hash chain verification and reorg detection.
- types
- Shared types for the indexing pipeline.