checkpoint
  • Introduction
  • Guides
    • Quickstart
    • Step-by-step setup
    • Indexing Ethereum contracts
    • Templates
    • One-to-one relations
    • BigInt and BigDecimal
    • ApolloServer usage
    • Time-travel queries
    • Advanced options
    • Media
  • Core Concepts
    • Models
    • Checkpoint configuration
    • Entity schema
    • Data writers (Starknet)
    • Data writers (EVM)
    • Internal data query
  • Use Cases
    • Snapshot X API
  • Community
    • Discord
    • Telegram
    • GitHub
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Guides

Indexing Ethereum contracts

PreviousStep-by-step setupNextTemplates

Last updated 3 months ago

Was this helpful?

Checkpoint initially supported indexing Starknet contracts only, but it can also index Ethereum contracts now.

Checkpoint can work with any network and chain as long as there is implemented for it. Currently there is official support for Starknet and Ethereum (or any other EVM network), but external providers are supported as well.

Usage with Ethereum is very similar to usage with Starknet, differences are:

  • Use full signature for event name in config (ProposalUpdated(uint256,(address,bytes),string) instead of ProposalUpdated)

  • Your writers should be using evm.Writer instead of starknet.Writer.

  • You should create indexer using new evm.EvmIndexer instead of new starknet.StarknetIndexer.

import Checkpoint, { evm } from '@snapshot-labs/checkpoint';

const handleProxyDeployed: evm.Writer = async ({ blockNumber, event }) => {};
const writers = { handleProxyDeployed };

const ethIndexer = new evm.EvmIndexer(writers);

const checkpoint = new Checkpoint(...);
checkpoint.addIndexer('eth', config, ethIndexer);
checkpoint.start();
a provider