Skip to main content

Installation

SubQuery TeamAbout 1 min

Installation

There are various components required when creating a SubQuery project. The @subql/cliopen in new window tool is used to create SubQuery projects. The @subql/nodeopen in new window component is required to run an indexer. The @subql/queryopen in new window library is required to generate queries.

Install @subql/cli

The @subql/cliopen in new window tool helps to create a project framework or scaffold, meaning you don't have to start from scratch.

Install SubQuery CLI globally on your terminal by using Yarn or NPM:

yarn
yarn global add @subql/cli

You can then run help to see available commands and usage provide by CLI:

subql help

Install @subql/node

A SubQuery node is an implementation that extracts substrate-based blockchain data per the SubQuery project and saves it into a Postgres database.

Install SubQuery node globally on your terminal by using Yarn or NPM:

yarn
yarn global add @subql/node

Once installed, you can can start a node with:

subql-node <command>

Note

If you are using Docker or hosting your project in SubQuery's Managed Service, you can skip this step. This is because the SubQuery node is already provided in the Docker container and the hosting infrastructure.

Install @subql/query

The SubQuery query library provides a service that allows you to query your project in a "playground" environment via your browser.

Install SubQuery query globally on your terminal by using Yarn or NPM:

yarn
yarn global add @subql/query

Note

If you are using Docker or hosting your project in SubQuery's Managed Service, you can skip this step also. This is because the SubQuery node is already provided in the Docker container and the hosting infrastructure.