A squid is an indexing project built with Squid SDK to retrieve and process blockchain data from the Subsquid Network (either permissioned or decentralized instance). The Squid SDK is a set of open source Typescript libraries that retrieve, decode, transform and persist the data. It can also make the transformed data available via an API. All stages of the indexing pipeline, from the data extraction to transformation to persistence are performed on batches of blocks to maximize the indexing speed. Modular architecture of the SDK makes it possible to extend indexing projects (squids) with custom plugins and data targets.
Required squid components
Processor is the word used for
- The main NodeJS process of the squid.
- The main object (
processor) of this process: its method call
processor.run()is the entry point.
processor objects handle data retrieval and transformation; data persistence is handled by a separate object called Store. Squid SDK offers two processor classes:
@subsquid/evm-processorNPM package - for Ethereum-compatible networks
@subsquid/substrate-processor- for networks based on Substrate such as Polkadot
A store is an object that processors use to persist their data. Subsquid offers three store classes:
TypeormStorefor saving data to PostgreSQL, via
@subsquid/typeorm-codegen(a code generator, install with
Install all three packages to use this store.
You can mix and match any store class with any processor class.
Optional squid components
A typegen is a tool for generating utility code for technology-specific operations such as decoding. Here are the typegens available:
- On EVM
- On Substrate
Install these with
Squids that store their data in PostgreSQL can subsequently make it available as a GraphQL API. To use this functionality, install
- On EVM
- On Substrate
- Squid CLI is a utility for retrieving squid templates, managing chains of commands commonly used in development and running all squid processes at once. It can also be used for deploying to Subsquid Cloud.
@subsquid/archive-registrysimplifies keeping track of available Subsquid Network datasets.
@subsquid/ss58handles encoding and decoding of SS58 addresses
@subsquid/frontierdecodes events and calls of the Frontier EVM pallet to make them decodable with