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 i
then populate the .env
file and execute
sqd process
Make 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:base
TODO: 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
abi
folder - Run
sqd typegen:base
to 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:base
to start the squid