subql Documentation

SubQuery is an Open, Flexible, Fast and Universal data indexing framework for web3. Our mission is to help developers create the decentralised products of...

18,804 stars TypeScript TypeScript 1 file ยท ~12,694 tokens
RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy subql on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name subql -p 26257:26257 --restart always cockroachdb/cockroach:latest-v22.1
Configured Services & Ports
โš™๏ธ crdb
image: cockroachdb/cockroach:latest-v22.1
๐Ÿ”Œ Ports: 26257:26257, 8080:8080
docker-compose.yml
yaml (docker-compose.yml)
version: '3.5'

services:
  crdb:
    image: cockroachdb/cockroach:latest-v22.1
    ports:
      - '26257:26257'
      - '8080:8080'
    command: start-single-node --insecure
    volumes:
      - '${PWD}/cockroach-data/crdb:/cockroach/cockroach-data'

1. Project Overview & Quickstart (subquery/subql)

File: README.md

Welcome to SubQuery!

Flexible, reliable, and decentralised APIs for your web3 project

SubQuery is an Open, Flexible, Fast and Universal data indexing framework for web3. Our mission is to help developers create the decentralised products of the future.

SubQuery allows teams across multiple blockchain architectures to process and query their data. The project is inspired by the growth of data protocols serving the application layer and its aim is to help web3 projects build better dApps by allowing anyone to reliably find and consume data faster. Today, anyone can query and extract blockchain data from various supported networks in only minutes and at no cost.

The future is multi-chain - SubQuery is no different. SubQuery is well on our way to support all leading blockchain networks with support for the following:

You can also use SubQuery to index data from multiple networks in any combination of the above SDKs. See our Multi-Chain Indexing Quickstart for more details.

Get Started

Create a SubQuery project

You can follow our Quick Start Guide to learn how to create, initialize, build, and publish a new SubQuery Project using the @subql/cli tool.

Learn and improve with our comprehensive documentation

Dig into every term, usecases, and best-practices that help you build a dApp which your users love. Take a look at our detailed technical documentation.

Publish your SubQuery Project to the SubQuery Network

Take advantage of the decentralized SubQuery Network to host your project without managing any infrastructure. By publishing to the SubQuery Network, you'll benefit from a reliable, scalable, cost-optimised, and censorship-resistant indexing service. Follow our comprehensive publishing guide to learn how to upload your project to the network and start leveraging its distributed infrastructure today.

Publish to managed hosting providers

If you prefer a managed hosting option for your indexer deployment, contact our managed hosting partners.
Learn more.

Run your own Indexer and Query Service

Follow our guide to run your own SubQuery local node that you can use to debug, test, and run you own GraphQL server.
You're going to need to a Postgres database, a node to extract chain data, and a moderately powerful computer to run the indexer in the background.
You'll also use our custom-built GraphQL query service @subql/query to interact with your SubQuery project.

MCP (Beta)

You can also create, build and deploy SubQuery projects using MCP (Model Context Protocol). Our MCP integration provides all the same functionality as the CLI but works well with LLMs and AI IDEs such as Cursor.

Manual configuration

For adding SubQuery MCP into other tools, the following command needs be run by the client.

bash
npx -y @subql/cli mcp

An example manual configuration:

json
"subquery": {
  "command": "npx",
  "args": ["-y", "@subql/cli", "mcp"]
}

Components

This repository contains all the core components of the SubQuery SDK as well as the Substrate implementation. It includes the following packages:

  • @subql/cli - The command line interface for SubQuery, used to create, build, and publish SubQuery projects
  • @subql/node - The Substrate SubQuery SDK, which provides the indexing functionality for Substrate-based chains
  • @subql/node-core - Core indexing functionality that is chain agnostic
  • @subql/query - The GraphQL query service for SubQuery projects, allowing you to interact with your indexed data.
  • @subql/common - Common utilities and types used across SubQuery packages
  • @subql/common-substrate - Common utilities and types specifically for Substrate-based chains
  • @subql/types - Type definitions for Substrate-based chains and SubQuery projects, including the project manifest and data models

For more detail on the specific network implementations please see their respective repositories:

Other Components:

Support

We have a vibrant community of developers and users who are always ready to help. If you have any questions, issues, or need assistance, please reach out to us through the following channels:

Contribute

We love contributions and feedback from the community. To contribute the code, we suggest starting by creating an issue in our main repository so we can give you support.

SubQuery is a project built with love from the team at SubQuery all the way from New Zealand

Copyright ยฉ 2025 SubQuery Pte Ltd authors & contributors


File: deploy/k8s/README.md

K8s Deploy

This deploy.yaml demonstrates how to run SubQuery in k8s.

You will need to run

1. a subql-node to index data

yaml
apiVersion: apps/v1
kind: Deployment

metadata:
  name: subql-node-1
  labels:
    app: subql-node
    release: subql-node-1

spec:
  selector:
    matchLabels:
      release: subql-node-1
  replicas: 1
  template:
    metadata:
      labels:
        release: subql-node-1
    spec:
      volumes:
        - name: project-dir
          emptyDir:
            medium: Memory
      initContainers:
        - name: prepare
          imagePullPolicy: IfNotPresent
          image: node:lts-alpine
          command:
            - sh
            - -c
            - apk add git && git clone https://github.com/OnFinality-io/subql-examples /subquery && cd /subquery/block-timestamp && npm i @subql/cli && yarn && subql codegen && yarn build
          volumeMounts:
            - name: project-dir
              mountPath: '/subquery'
      containers:
        - name: indexer
          imagePullPolicy: IfNotPresent
          image: onfinality/subql-node:v0.4.0
          args:
            - -f
            - /subquery/block-timestamp
            - --local
          env:
            - name: DB_HOST
              value: subquery-db-svc
            - name: DB_PORT
              value: "5432"
            - name: DB_USER
              value: postgres
            - name: DB_PASS
              value: postgres
            - name: DB_DATABASE
              value: postgres
          volumeMounts:
            - name: project-dir
              mountPath: '/subquery'
          securityContext:
            runAsUser: 1000

      securityContext:
        fsGroup: 1000
      imagePullSecrets:
        - name: regcred

Note: --local will create subquery tables in public schema, if you want to store multiple subquery in the same db, remove that flag.

2. a Postgres Database

yaml
apiVersion: apps/v1
kind: StatefulSet

metadata:
  name: subquery-db
  labels:
    app: postgres
    release: subquery-db

spec:
  serviceName: subquery-db-svc

  selector:
    matchLabels:
      release: subquery-db

  volumeClaimTemplates:
    - metadata:
        name: subquery-db-pvc
        annotations:
          volume.beta.kubernetes.io/storage-class: standard
      spec:
        accessModes:
          - ReadWriteOnce
        resources:
          requests:
            storage: 20G
  template:
    metadata:
      labels:
        release: subquery-db
    spec:
      containers:
        - name: db
          imagePullPolicy: IfNotPresent
          image: postgres:12-alpine
          env:
            - name: POSTGRES_PASSWORD
              value: postgres
          ports:
            - containerPort: 5432
          volumeMounts:
            - mountPath: /var/lib/postgresql
              name: subquery-db-pvc

      securityContext:
        fsGroup: 1000
      imagePullSecrets:
        - name: regcred
---
apiVersion: v1
kind: Service

metadata:
  name: subquery-db-svc

spec:
  clusterIP: None
  ports:
    - port: 5432
  selector:
    release: subquery-db

Note that if used in production, a dedicated database should be used to get better performance.

3. Hasura for graphql querying

yaml
apiVersion: apps/v1
kind: Deployment

metadata:
  name: hasura-deploy
  labels:
    release: hasura

spec:
  selector:
    matchLabels:
      release: hasura
  replicas: 1

  template:
    metadata:
      labels:
        release: hasura
    spec:
      containers:
        - name: hasura
          image: hasura/graphql-engine:v1.3.3
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 8080
          env:
            # HASURA_GRAPHQL_DATABASE_URL: postgres://postgres:postgres@postgres:5432/postgres
            #      ## enable the console served by server
            #      HASURA_GRAPHQL_ENABLE_CONSOLE: "true" # set to "false" to disable console
            #      ## enable debugging mode. It is recommended to disable this in production
            #      HASURA_GRAPHQL_DEV_MODE: "true"
            #      HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
            - name: HASURA_GRAPHQL_DATABASE_URL
              value: postgres://postgres:postgres@subquery-db-svc:5432/postgres
            - name: HASURA_GRAPHQL_ENABLE_CONSOLE
              value: 'true'
      terminationGracePeriodSeconds: 300

To gain further security, an archive node should be used in the same k8s cluster, and a NetworkPolicy be added to limit all network communication within the internal network.

yaml
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: subquery-node-egress
spec:
  podSelector:
    matchLabels:
      release: subql-node-1
  egress:
    - to:
        - ipBlock:
            cidr: 10.0.0.0/8
  policyTypes:
    - Egress

File: packages/query/README.md

@subql/query

Run this package

To quickly setup the project, add a .env file in the subql/packages/query folder with the following content:

env
DB_HOST=localhost
DB_PORT=5432
DB_USER=postgres
DB_PASS=postgres
DB_DATABASE=postgres

then run the following command

sh
NODE_OPTIONS="-r dotenv/config" yarn start:dev -- --name <subquery_name> --playground

File: packages/node/README.md

@subql-node

Description

Indexer service in our @subql toolkit, can load user's subquery then fetch, process and persist to db accordingly.

Installation

bash
$ npm i @subql/node

Running the app

text
/* Detailed source-code truncated for AI context efficiency. */

License

Apache-2.0


File: packages/cli/README.md

@subql/cli

CLI for SubQuery




Usage

sh-session
$ npm install @subql/cli
$ subql COMMAND
running command...
$ subql (--version)
@subql/cli/6.6.3-0 linux-x64 node-v24.11.1
$ subql --help [COMMAND]
USAGE
  $ subql COMMAND
...

Commands

`subql build [LOCATION]`

Build this SubQuery project code into a bundle

text
USAGE
  $ subql build [LOCATION] [--output <value>]

ARGUMENTS
  LOCATION  The path to the project, this can be a directory or a project manifest file.

FLAGS
  --output=<value>  [default: dist] The output location relative to the location

DESCRIPTION
  Build this SubQuery project code into a bundle

See code: src/commands/build.ts

`subql build-manifest [LOCATION]`

Build TypeScript manifest file to YAML (generates project.yaml from project.ts)

text
USAGE
  $ subql build-manifest [LOCATION]

ARGUMENTS
  LOCATION  The path to the project, this can be a directory or a project manifest file.

DESCRIPTION
  Build TypeScript manifest file to YAML (generates project.yaml from project.ts)

See code: src/commands/build-manifest.ts

`subql codegen [LOCATION]`

Generate entity types from the GraphQL schema and contract interfaces

text
USAGE
  $ subql codegen [LOCATION]

ARGUMENTS
  LOCATION  The project directory or path to project manifest.

DESCRIPTION
  Generate entity types from the GraphQL schema and contract interfaces

See code: src/commands/codegen/index.ts

`subql codegen:import-abi LOCATION`

Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it will attempt to fetch the ABI and start block from the Etherscan.

text
USAGE
  $ subql codegen:import-abi LOCATION [--address <value>] [--abiName <value>] [--startBlock <value>] [--abiPath <value>]
    [--events <value>] [--functions <value>]

ARGUMENTS
  LOCATION  The path to the project, this can be a directory or a project manifest file.

FLAGS
  --abiName=<value>     The contracts name, if not provided, the contract address will be used if the ABI is fetched
                        from Etherscan
  --abiPath=<value>     The path to the ABI file
  --address=<value>     The contracts address
  --events=<value>      ABI events to generate handlers for. Use '*' for all. e.g. --events="approval, transfer"
  --functions=<value>   ABI functions to generate handlers for. Use '*' for all. e.g. --functions="approval, transfer"
  --startBlock=<value>  The start block of the handler, generally the block the contract is deployed.

DESCRIPTION
  Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it
  will attempt to fetch the ABI and start block from the Etherscan.

ALIASES
  $ subql import-abi

See code: src/commands/codegen/import-abi.ts

`subql import-abi LOCATION`

Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it will attempt to fetch the ABI and start block from the Etherscan.

text
USAGE
  $ subql import-abi LOCATION [--address <value>] [--abiName <value>] [--startBlock <value>] [--abiPath <value>]
    [--events <value>] [--functions <value>]

ARGUMENTS
  LOCATION  The path to the project, this can be a directory or a project manifest file.

FLAGS
  --abiName=<value>     The contracts name, if not provided, the contract address will be used if the ABI is fetched
                        from Etherscan
  --abiPath=<value>     The path to the ABI file
  --address=<value>     The contracts address
  --events=<value>      ABI events to generate handlers for. Use '*' for all. e.g. --events="approval, transfer"
  --functions=<value>   ABI functions to generate handlers for. Use '*' for all. e.g. --functions="approval, transfer"
  --startBlock=<value>  The start block of the handler, generally the block the contract is deployed.

DESCRIPTION
  Import and ABI to generate project handlers and mapping functions based on an Ethereum ABI. If address is provided, it
  will attempt to fetch the ABI and start block from the Etherscan.

ALIASES
  $ subql import-abi

`subql init NAME`

Initialize a SubQuery project from a template

text
USAGE
  $ subql init NAME [--location <value>] [--network <value>] [--networkFamily <value>] [--endpoint
    <value>] [--installDependencies] [--packageManager npm|yarn|pnpm] [--author <value>]

ARGUMENTS
  NAME  The name of the project to create

FLAGS
  --author=<value>           The project author that will be set in package.json. Defaults to the current system user
  --endpoint=<value>         The RPC endpoint that the project will use
  --installDependencies      Install the dependencies of the project
  --location=<value>         The path to the project, this can be a directory or a project manifest file.
  --network=<value>          The name of the network the project will index data for
  --networkFamily=<value>    The network family the project will index data for, e.g. EVM, Substrate
  --packageManager=<option>  [default: npm]
                             <options: npm|yarn|pnpm>

DESCRIPTION
  Initialize a SubQuery project from a template

See code: src/commands/init.ts

`subql mcp`

Runs an MCP (Model Context Protocol) server over stdio

text
USAGE
  $ subql mcp

DESCRIPTION
  Runs an MCP (Model Context Protocol) server over stdio

See code: src/commands/mcp.ts

`subql migrate`

Migrate a Subgraph project to a SubQuery project, including the manifest and schema.

text
USAGE
  $ subql migrate --input <value> --output <value> [--gitSubDirectory <value>]

FLAGS
  --gitSubDirectory=<value>  A subdirectory in the git repo if the input is a git repo
  --input=<value>            (required) A directory or git repo to a subgraph project
  --output=<value>           (required) The location of the SubQuery project

DESCRIPTION
  Migrate a Subgraph project to a SubQuery project, including the manifest and schema.

See code: src/commands/migrate.ts

`subql multi-chain:add [LOCATION]`

Add new chain manifest to multi-chain project

text
USAGE
  $ subql multi-chain:add [LOCATION] --chainManifestFile <value>

ARGUMENTS
  LOCATION  The path to the multichain project, this can be a directory or a multichain manifest file.

FLAGS
  --chainManifestFile=<value>  (required) The path to the new chain manifest

DESCRIPTION
  Add new chain manifest to multi-chain project

See code: src/commands/multi-chain/add.ts

`subql network:add-deployment-boost`

Increase the boost for a deployment

text
USAGE
  $ subql network:add-deployment-boost --network mainnet|testnet-mumbai|testnet|local --deploymentId <value> --amount
  <value>

FLAGS
  --amount=<value>        (required) The amount to boost the deployment with, in SQT
  --deploymentId=<value>  (required) The deployment id for the project
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Increase the boost for a deployment

See code: src/commands/network/add-deployment-boost.ts

`subql network:connect-wallet`

Connect a wallet via Wallet Connect for interacting with the network

text
USAGE
  $ subql network:connect-wallet

DESCRIPTION
  Connect a wallet via Wallet Connect for interacting with the network

See code: src/commands/network/connect-wallet.ts

`subql network:create-api-key NAME`

Create an API key for making queries via the SubQuery Network

text
USAGE
  $ subql network:create-api-key NAME --network mainnet|testnet-mumbai|testnet|local

ARGUMENTS
  NAME  The name of the api key, used to identify it

FLAGS
  --network=<option>  (required) [default: mainnet] The network to check.
                      <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Create an API key for making queries via the SubQuery Network

See code: src/commands/network/create-api-key.ts

`subql network:create-deployment`

Create a new deployment for a SubQuery project

text
USAGE
  $ subql network:create-deployment --network mainnet|testnet-mumbai|testnet|local --projectId <value> --deploymentId <value>
    --deploymentVersion <value> [--deploymentDescription <value>]

FLAGS
  --deploymentDescription=<value>  A description of the deployment, release notes
  --deploymentId=<value>           (required) The IPFS CID of the published project
  --deploymentVersion=<value>      (required) The version of the deployment
  --network=<option>               (required) [default: mainnet] The network to check.
                                   <options: mainnet|testnet-mumbai|testnet|local>
  --projectId=<value>              (required) The project id, this should be a 0x prefixed hex number

DESCRIPTION
  Create a new deployment for a SubQuery project

See code: src/commands/network/create-deployment.ts

`subql network:create-flex-plan`

Create a new Flex Plan for querying a SubQuery deployment on the SubQuery Network

text
USAGE
  $ subql network:create-flex-plan --network mainnet|testnet-mumbai|testnet|local --deploymentId <value> --amount
  <value>

FLAGS
  --amount=<value>        (required) The amount to deposit into the plan, in SQT
  --deploymentId=<value>  (required) The deploymentId to create a flex plan for
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Create a new Flex Plan for querying a SubQuery deployment on the SubQuery Network

See code: src/commands/network/create-flex-plan.ts

`subql network:create-project`

Create a new SubQuery project on the SubQuery network

text
USAGE
  $ subql network:create-project --network mainnet|testnet-mumbai|testnet|local --deploymentId <value> --projectType
    0|1|2|3|SUBQUERY|RPC|SQ_DICT|SUBGRAPH --name <value> [--description <value>] [--image <value>] [--tags <value>...]
    [--website <value>] [--codeRepository <value>] [--deploymentVersion <value>] [--deploymentDescription <value>]

FLAGS
  --codeRepository=<value>         A URL to the project code repository
  --deploymentDescription=<value>  A description of the deployment, release notes
  --deploymentId=<value>           (required) The IPFS CID of the published project
  --deploymentVersion=<value>      [default: 1.0.0] The version of the deployment
  --description=<value>            A short description of the project
  --image=<value>                  A URL to an image for the project
  --name=<value>                   (required) The name of the project
  --network=<option>               (required) [default: mainnet] The network to check.
                                   <options: mainnet|testnet-mumbai|testnet|local>
  --projectType=<option>           (required)
                                   <options: 0|1|2|3|SUBQUERY|RPC|SQ_DICT|SUBGRAPH>
  --tags=<value>...                A list of tags for the project
  --website=<value>                A URL to the project website

DESCRIPTION
  Create a new SubQuery project on the SubQuery network

See code: src/commands/network/create-project.ts

`subql network:disconnect-wallet`

Disconnect a wallet connected via WalletConnect

text
USAGE
  $ subql network:disconnect-wallet

DESCRIPTION
  Disconnect a wallet connected via WalletConnect

See code: src/commands/network/disconnect-wallet.ts

`subql network:list-account-boosts`

Get a list of the deployments an account boosts

text
USAGE
  $ subql network:list-account-boosts --network mainnet|testnet-mumbai|testnet|local [--address <value>]

FLAGS
  --address=<value>   The account address to list boosts for
  --network=<option>  (required) [default: mainnet] The network to check.
                      <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Get a list of the deployments an account boosts

See code: src/commands/network/list-account-boosts.ts

`subql network:list-api-keys`

List API keys for making queries via the SubQuery Network

text
USAGE
  $ subql network:list-api-keys --network mainnet|testnet-mumbai|testnet|local

FLAGS
  --network=<option>  (required) [default: mainnet] The network to check.
                      <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  List API keys for making queries via the SubQuery Network

See code: src/commands/network/list-api-keys.ts

`subql network:list-deployment-boosts`

Get a list of boosts made to a project deployment

text
USAGE
  $ subql network:list-deployment-boosts --network mainnet|testnet-mumbai|testnet|local --deploymentId <value>

FLAGS
  --deploymentId=<value>  (required) The deployment id for the project
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Get a list of boosts made to a project deployment

See code: src/commands/network/list-deployment-boosts.ts

`subql network:list-deployment-indexers`

List the indexers for a deployment on the SubQuery Network

text
USAGE
  $ subql network:list-deployment-indexers --network mainnet|testnet-mumbai|testnet|local --deploymentId <value>

FLAGS
  --deploymentId=<value>  (required) The DeploymentID of the project to list deployments for
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  List the indexers for a deployment on the SubQuery Network

See code: src/commands/network/list-deployment-indexers.ts

`subql network:list-deployments`

List deployments for a SubQuery project

text
USAGE
  $ subql network:list-deployments --network mainnet|testnet-mumbai|testnet|local --projectId <value>

FLAGS
  --network=<option>   (required) [default: mainnet] The network to check.
                       <options: mainnet|testnet-mumbai|testnet|local>
  --projectId=<value>  (required) The ID of the project to list deployments for

DESCRIPTION
  List deployments for a SubQuery project

See code: src/commands/network/list-deployments.ts

`subql network:list-flex-plans`

List your Flex Plans for querying projects on the SubQuery Network

text
USAGE
  $ subql network:list-flex-plans --network mainnet|testnet-mumbai|testnet|local [--address <value>]

FLAGS
  --address=<value>   The account address to list boosts for
  --network=<option>  (required) [default: mainnet] The network to check.
                      <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  List your Flex Plans for querying projects on the SubQuery Network

See code: src/commands/network/list-flex-plans.ts

`subql network:list-projects`

List projects for a given account on then SubQuery network

text
USAGE
  $ subql network:list-projects --network mainnet|testnet-mumbai|testnet|local [--address <value>] [--networkRpc
  <value>]

FLAGS
  --address=<value>     The address of the account that owns the projects
  --network=<option>    (required) [default: mainnet] The network to check.
                        <options: mainnet|testnet-mumbai|testnet|local>
  --networkRpc=<value>  Override the network rpc url

DESCRIPTION
  List projects for a given account on then SubQuery network

See code: src/commands/network/list-projects.ts

`subql network:remove-api-key NAME`

Remove an API key used for making queries via the SubQuery Network

text
USAGE
  $ subql network:remove-api-key NAME --network mainnet|testnet-mumbai|testnet|local

ARGUMENTS
  NAME  The name of the api key, used to identify it

FLAGS
  --network=<option>  (required) [default: mainnet] The network to check.
                      <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Remove an API key used for making queries via the SubQuery Network

See code: src/commands/network/remove-api-key.ts

`subql network:remove-deployment-boost`

Decrease the boost amount for a project deployment on the SubQuery network

text
USAGE
  $ subql network:remove-deployment-boost --network mainnet|testnet-mumbai|testnet|local --deploymentId <value> --amount
  <value>

FLAGS
  --amount=<value>        (required) The amount of boost to remove from the deployment, in SQT
  --deploymentId=<value>  (required) The deployment id for the project
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Decrease the boost amount for a project deployment on the SubQuery network

See code: src/commands/network/remove-deployment-boost.ts

`subql network:stop-flex-plan`

Stop a Flex Plan for a deployment on the SubQuery Network

text
USAGE
  $ subql network:stop-flex-plan --network mainnet|testnet-mumbai|testnet|local --deploymentId <value>

FLAGS
  --deploymentId=<value>  (required) The deploymentId to create a flex plan for
  --network=<option>      (required) [default: mainnet] The network to check.
                          <options: mainnet|testnet-mumbai|testnet|local>

DESCRIPTION
  Stop a Flex Plan for a deployment on the SubQuery Network

See code: src/commands/network/stop-flex-plan.ts

`subql network:swap-deployment-boost`

Swap the boost from one deployment to another deployment on the SubQuery Network

text
USAGE
  $ subql network:swap-deployment-boost --network mainnet|testnet-mumbai|testnet|local --fromDeploymentId <value> --toDeploymentId
    <value> --amount <value>

FLAGS
  --amount=<value>            (required) The amount to boost the deployment with, in SQT
  --fromDeploymentId=<value>  (required) The deployment id for the project that is already boosted
  --network=<option>          (required) [default: mainnet] The network to check.
                              <options: mainnet|testnet-mumbai|testnet|local>
  --toDeploymentId=<value>    (required) The deployment id for the project to move the boost to

DESCRIPTION
  Swap the boost from one deployment to another deployment on the SubQuery Network

See code: src/commands/network/swap-deployment-boost.ts

`subql onfinality:create-deployment`

Create a project deployment on the OnFinality managed services

text
/* Detailed source-code truncated for AI context efficiency. */

See code: src/commands/onfinality/create-deployment.ts

`subql onfinality:create-multichain-deployment [LOCATION]`

Create a multi-chain project deployment no the OnFinality managed services

text
/* Detailed source-code truncated for AI context efficiency. */

See code: src/commands/onfinality/create-multichain-deployment.ts

`subql onfinality:create-project`

Create a project on the OnFinality managed services

text
USAGE
  $ subql onfinality:create-project --org <value> --projectName <value> [--logoURL <value>] [--subtitle <value>] [--description
    <value>] [--dedicatedDB <value>] [--projectType subquery|subgraph]

FLAGS
  --dedicatedDB=<value>   Dedicated DataBase
  --description=<value>   Description
  --logoURL=<value>       Logo URL
  --org=<value>           (required) Github organization name
  --projectName=<value>   (required) Project name
  --projectType=<option>  [default: subquery] Project type [subquery|subgraph]
                          <options: subquery|subgraph>
  --subtitle=<value>      Subtitle

DESCRIPTION
  Create a project on the OnFinality managed services

See code: src/commands/onfinality/create-project.ts

`subql onfinality:delete-deployment`

Delete a deployment from the OnFinality managed services

text
USAGE
  $ subql onfinality:delete-deployment --org <value> --projectName <value> --deploymentID <value>

FLAGS
  --deploymentID=<value>  (required) Deployment ID
  --org=<value>           (required) Github organization name
  --projectName=<value>   (required) Project name

DESCRIPTION
  Delete a deployment from the OnFinality managed services

See code: src/commands/onfinality/delete-deployment.ts

`subql onfinality:delete-project`

Delete a project on the OnFinality managed services

text
USAGE
  $ subql onfinality:delete-project --org <value> --projectName <value>

FLAGS
  --org=<value>          (required) The Github organization name
  --projectName=<value>  (required) The project name

DESCRIPTION
  Delete a project on the OnFinality managed services

See code: src/commands/onfinality/delete-project.ts

`subql onfinality:promote-deployment`

Promote a deployment on the OnFinality managed services from a Stage environment to Production

text
USAGE
  $ subql onfinality:promote-deployment --org <value> --projectName <value> --deploymentID <value>

FLAGS
  --deploymentID=<value>  (required) Deployment ID
  --org=<value>           (required) Github organization name
  --projectName=<value>   (required) Project name

DESCRIPTION
  Promote a deployment on the OnFinality managed services from a Stage environment to Production

See code: src/commands/onfinality/promote-deployment.ts

`subql publish [LOCATION]`

Upload this SubQuery project to IPFS for distribution

text
USAGE
  $ subql publish [LOCATION] [--ipfs <value>] [--silent]

ARGUMENTS
  LOCATION  The path to the project, this can be a directory or a project manifest file.

FLAGS
  --ipfs=<value>  An additional IPFS endpoint to upload to
  --silent        Run the command without logging, only outputs the CIDs

DESCRIPTION
  Upload this SubQuery project to IPFS for distribution

See code: src/commands/publish.ts

2. Official Technical Reference & Guides (subquery/subql-docs)

File: README.md

SubQuery Documentation

SubQuery enables better dApps by making decentralised data more accessible - learn more.

This is the home of SubQuery documentation. All updates to docs should be added here.

We welcome any contributions or improvements from our community, if you're looking for support we suggest starting by going to the technical support channel in SubQuery's official Discord server.

Note you should really use pnpm package manager when editing docs.

Contributing To SubQuery

Welcome and a big thank you for considering contributing to this SubQuery project! Together we can pave the way to a more decentralised future.

This documentation is actively maintained by the SubQuery team. We welcome your contributions, you can do so by forking our GitHub project and making changes to all the documentation markdown files under the docs directory.

You can read more about contribution guidelines here.

About SubQuery

SubQuery is a decentralized data aggregation, indexing & querying layer between Layer-1 blockchains and decentralized applications. This service unlocks blockchain data and transforms it to a queryable state so that it can be used in intuitive applications. It allows DApp developers to focus on their core use case and front-end, without needing to waste time on building a custom backend for data processing. The upcoming SubQuery Network will decentralize and tokenize the ecosystem to allow everyone to participate in the web3 data revolution.

Linktreeย |ย Websiteย | Warpcast | Discordย |ย Telegramย |ย X (formerly Twitter)ย |ย Matrixย |ย LinkedInย |ย YouTube


File: docs/README.md


text
<Typography tag="h1" center maxWidth="787">
    Learn how to build with SubQuery
  </Typography>
  <Typography tag="h4" center maxWidth="687" family="body">
    SubQuery is a fast, flexible, and reliable open-source data
    decentralised infrastructure network, providing both RPC and indexed
    data to consumers around the world.
  </Typography>
  <Typography tag="h4" center maxWidth="687" family="body">
    The SubQuery Data Indexer is a open-source data indexer that provides
    you with custom APIs for your web3 project across all of our supported
    chains.
  </Typography>
  <Typography tag="h4" center maxWidth="687" family="body">
    SubQuery AI Apps framework makes building decentralised AI Applications 
    fast and easy.
  </Typography>




  <router-link
    class="flexCol gp24"
    :to="{ path: '/indexer/welcome.html' }"
  >
    
      
      <Typography tag="h4" family="body">Indexer SDK</Typography>
    
    <Typography tag="h3">Build with SubQuery's Indexer SDK</Typography>
    <Typography tag="h5" type="secondary"
      >SubQuery is a fast, flexible, and reliable open-source data indexer
      that provides you with custom APIs for your web3 project across all
      of our supported chains.
    </Typography>
    
      Learn more
    
  </router-link>


  <router-link
    class="flexCol gp24"
    :to="{ path: '/ai/welcome.html' }"
  >
    
      
      <Typography tag="h4" family="body">AI Apps Framework</Typography>
    
    <Typography tag="h3">Agentic AI with SubQuery's AI Apps</Typography>
    <Typography tag="h5" type="secondary"
      >The AI App Framework allows you to build, deploy, and run agentic production AI apps on the SubQuery Network in a trusted and decentralised environment.</Typography>
    
      Learn more
    
  </router-link>


  <router-link
    class="flexCol gp24"
    :to="{ path: '/subquery_network/welcome.html' }"
  >
    
      
      <Typography tag="h4" family="body">SubQuery Network</Typography>
    
    <Typography tag="h3"
      >Decentralised Infra on the SubQuery Network</Typography
    >
    <Typography tag="h5" type="secondary">
      Our decentralised infrastructure network revolutionises the web3
      landscape, providing both RPC and indexed data to consumers around
      the world.</Typography
    >
    
      Learn more
    
  </router-link>




<Typography tag="h3"> Our Most Popular Guides </Typography>

  
    <component
      class="flexCol gp24"
      :is="guide.path.startsWith('https') ? 'a' : 'router-link'"
      :href="guide.path.startsWith('https') ? guide.path : ''"
      :target="guide.path.startsWith('https') ? '_blank' : ''"
      :to="{ path: guide.path }"
    >
      <Typography tag="p">{{ guide.title }}</Typography>
      <Typography size="medium">{{ guide.description }}</Typography>
    </component>
  



<Typography tag="h3"> Start building on different chains </Typography>

  
    <router-link
      class="flexColCenter gp16"
      :to="{ path: startWith.path }"
    >
      
      <Typography size="large" weight="600" center>{{
        startWith.name
      }}</Typography>
    </router-link>