This sample squid indexes Exosama NFT transfers on the Ethereum Mainnet by subscribing to the Transfer
logs. For each new batch, the processor detects the NFTs that have not yet been indexed and populates the metadata calling the contract state (see initTokens()
). The contract state queries are batched using the Multicall
contract and the Multicall
facade class generated with sqd codegen
. Note the --multicall
flag in the codegen
command defined in commands.json
.
One can use this example as a template for scaffolding a new squid project with sqd init
:
sqd init my-new-squid --template https://github.com/subsquid-labs/multicall-example
- Node v16.x
- Docker
- Squid CLI
Clone the repo and navigate to the root folder.
npm ci
sqd build
# start the database
sqd up
# starts a long-running ETL and blocks the terminal
sqd process
# starts the GraphQL API server at localhost:4350/graphql
sqd serve