Multichain balance tracking squid
This complex squid illustrates the usage of SubstrateBatchProcessor
, storage calls and custom resolvers.
danger
The squid uses Makefile for local commands, a solution that is currently deprecated in favor of sqd
commands. Please keep that in mind.
Quickstart
Clone the repo and enter its directory:
git clone https://github.com/subsquid-labs/balances-squid
cd balances-squid
There, create a .env
file with the following contents:
DB_NAME=postgres
DB_PORT=23798
GQL_PORT=4350
Prepare the squid and start a processor by running
npm ci
make build
make up
make migrate
CHAIN=<chain_name> node -r dotenv/config ./lib/processor.js
Supported values for <chain_name>
: hydradx
, kusama
, polkadot
, acala
, karura
, moonriver
, moonbeam
, bifrost
, phala
.
Processor will block the terminal. Open another one in the same folder and run
make serve
there to get a GraphQL server running at localhost:4350/graphql
.
Public endpoints
Browse GraphiQL playgrounds of this squid's public endpoints at the following URLs:
Polkadot:
- https://squid.subsquid.io/polkadot-balances/graphql
- https://squid.subsquid.io/acala-balances/graphql
- https://squid.subsquid.io/moonbeam-balances/graphql
- https://squid.subsquid.io/phala-balances/graphql