Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.22 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.22 KB

ERC20 indexing template

A squid template indexing ERC20 transfers. The squid fetches the historical Transfer event, decodes and persists to a Transfer table. A new entry is created in the Account table for each address that has interacted with the contract so that one can query the transfer history for each EVM address.

Dependencies: NodeJS v16 or newer, Git, Docker.

Setup

  • Install Squid CLI:
npm i -g @subsquid/cli
  • Update the CONTRACT_ADDRESS and CONTRACT_DEPLOYED_AT in .env. By default, the USDC contract is indexed
  • Inspect the list of the available archives with sqd archives:ls and choose the network if necessary Set the RPC_ENDPOINT env variable to a chain node RPC URL. Use secrets when deploying the squid to Subsquid Cloud.

Run

npm ci
# start a local Postgres
sqd up
# build the squid
sqd build
# start both the squid processor and the GraphQL server
sqd run .

A GraphiQL playground will be available at localhost:4350/graphql.

You can also start squid services one by one:

sqd process
sqd serve