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.
- Install Squid CLI:
npm i -g @subsquid/cli- Update the
CONTRACT_ADDRESSandCONTRACT_DEPLOYED_ATin.env. By default, the USDC contract is indexed - Inspect the list of the available archives with
sqd archives:lsand choose the network if necessary Set theRPC_ENDPOINTenv variable to a chain node RPC URL. Use secrets when deploying the squid to Subsquid Cloud.
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