This tiny blockchain indexer scrapes Transfer events emitted by the USDC contract and saves the data to a dataset on Google BigQuery.
Dependencies: NodeJS, Git, Squid CLI.
To try it out, first download it and install local dependencies:
git clone https://github.com/subsquid-labs/squid-bigquery-example
cd squid-bigquery-example
npm ithen populate the .env file and execute
sqd processMake sure to use an ID of an existing dataset for GOOGLE_DATASET_ID!
If you visit the console now you should see that the two new tables status and transfers have been created and are being populated within your dataset.
Visit the documentation page for more details on using squids with BigQuery.
To generate the types:
npx squid-evm-typegen ./src/base/abi ./src/base/abi/*.json --multicall
or
sqd typegen:baseTODO: add this to commands.json
To run the squid for base:
sqd process:base- Get the contract ABI
- Copy and paste the ABI into the
abifolder - Run
sqd typegen:baseto generate the types - Add the relevant filters to the processor.ts file
- Create a new table in main.ts for the event
- Run
sqd process:baseto start the squid