Skip to main content
Version: Firesquid

EVM Processor

This section applies to squids indexing EVM chains:

  • Ethereum Mainnet. Archive endpoint:
  • Polygon (Coming soon)

Overview and the data model

A squid processor is a separate node.js process that fetches historical on-chain data from an Archive, performs arbitrary transformations and saves the result into the target database schema. By convention, the processor entry point is src/processor.ts. EvmBatchProcessor is the central class that handles the EVM data extraction, transformation and persistence. The single handler is responsible for transforming data from multiple events and transactions in a single in-memory batch.

The batch consists of canonically ordered execution log items of the following kinds:

  • evmLog kind item. The processor subscribes to EVM logs with the EvmBatchProcessor.addLog() method. It supports filters and data selection options.
  • transaction kind item. The processor subscribes to EVM transaction with EvmBatchProcessor.addTransaction().

Further, the processor can extract additional data by querying the historical chain state and indeed any external API.

What's next?

  • Explore the migration guide and create a squid from a subgraph within minutes
  • Follow the tutorial to how to build an Ethereum-indexing squid step by step
  • Check the examples