Skip to content

sereenaa/squid-bigquery-example

Repository files navigation

A squid that saves USDC Transfers to a BigQuery dataset

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.

Sez's notes

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

Development flow

  1. Get the contract ABI
  2. Copy and paste the ABI into the abi folder
  3. Run sqd typegen:base to generate the types
  4. Add the relevant filters to the processor.ts file
  5. Create a new table in main.ts for the event
  6. Run sqd process:base to start the squid

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published