Required squid components
Processor
Processor is the word used for- The main NodeJS process of the squid.
- The main object (
processor) of this process: its method callprocessor.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:
EvmBatchProcessorvia the@subsquid/evm-processorNPM package - for Ethereum-compatible networksSubstrateBatchProcessorvia@subsquid/substrate-processor- for networks based on Substrate such as Polkadot
Store
A store is an object that processors use to persist their data. SQD offers three store classes:-
TypeormStorefor saving data to PostgreSQL, via@subsquid/typeorm-store@subsquid/typeorm-codegen(a code generator, install with--save-dev)@subsquid/typeorm-migration
-
file-storevia@subsquid/file-store- for saving data to filesystems. It is a modular system with a variety of extensions for various formats and destinations. -
bigquery-storevia@subsquid/bigquery-store- for saving data to Google BigQuery.
Optional squid components
Typegen
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
squid-evm-typegenvia@subsquid/evm-typegen:- decodes smart contract data
- handles direct calls to contract methods
- exposes useful constants such as event topics and function signature hashes
The generated code depends on
@subsquid/evm-abi, SQD’s own high performance, open source EVM codec.
--save-dev.
GraphQL server
Squids that store their data in PostgreSQL can subsequently make it available as a GraphQL API via a variety of supported servers. See Serving GraphQL. Among other alternatives, SQD provides its own server called OpenReader via the@subsquid/graphql-server package. The server runs as a separate process. Core API is automatically derived from the schema file; it is possible to extend it with custom queries and basic access control.
Misc utilities
- 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 SQD Cloud.