/file-store-csv-example

Minimalistic squid storing data to CSV files

Primary LanguageTypeScriptMIT LicenseMIT

A squid that saves USDC Transfers to TSV files

This tiny blockchain indexer scrapes Transfer events emitted by the USDC contract and saves the data in a file-based dataset in a local folder ./data. It is built with the Subsquid framework, hence the term "squid".

The squid uses @subsquid/file-store and @subsquid/file-store-csv packages to store the dataset. A less common tab separated values (TSV) format was chosen to highlight the flexibility of the CSV writing subsystem.

Dependencies: NodeJS, Squid CLI.

To see it in action, spin up a processor, a process that ingests the data from the Ethereum Archive:

$ git clone https://github.com/subsquid-labs/file-store-csv-example
$ cd file-store-csv-example/
$ npm i
$ sqd process

You should see a ./data folder populated with indexer data appear in a bit:

$ tree ./data/
./data/
├── 0000000000-0007242369
│   └── transfers.tsv
├── 0007242370-0007638609
│   └── transfers.tsv
...
└── status.txt