How subquery/subql works
Project type and purpose
• This is a multi-package monorepo for SubQuery, a decentralized, blockchain-agnostic data indexing framework.
• It provides three primary deliverables:
• A CLI tool to scaffold, build, deploy and manage SubQuery projects (@subql/cli)
• An indexer node service that ingests blockchain data and writes to a Postgres/CockroachDB database (@subql/node & @subql/node-core)
• A GraphQL query API service to expose indexed data (@subql/query)
• Shared libraries support manifest loading, type definitions, multi-chain support, utilities, testing, and common substrate specifics.
File structure
• Top-level “packages” folder holds each deliverable and shared libs: cli, node, query, common, common-substrate, types, utils, testing, etc.
• “deploy/k8s” holds Kubernetes manifests; Dockerfiles live alongside services and in “.github/workflows” for CI/CD.
• Each service uses NestJS modules (see node/src/meta, node/src/indexer; query/src/graphql).
• The CLI is a TypeScript binary exposing JSON-RPC clients, project scaffolding, codegen, build, deploy subcommands.
README insights
• Purpose: enable developers to index and query data from Polkadot/Substrate, Ethereum, Cosmos, and other chains.
• Components listed: @subql/cli, @subql/node, @subql/query, @subql/common, etc.
• Deployment guidance: Docker, Postgres database, blockchain node RPC.