Terra Quick Start

SubQuery Team約6分

Terra Quick Start

In this Quick start guide, we're going to start with a simple Terra starter project and then finish by indexing some actual real data. This is an excellent basis to start with when developing your own SubQuery Project.

If your are looking for guides for Substrate/Polkadot, you can read the Substrate/Polkadot specific quick start guide.

このガイドの最後には、SubQuery ノード上で動作する SubQuery プロジェクトを作成し、GraphQL エンドポイントからデータを照会できるようになります。

まだの方は、SubQuery で使われている用語に慣れることをお勧めします。

The goal of this quick start guide is to adapt the standard starter project to begin indexing all transfers from Terra, it should only take 10-15 minutes



SubQuery CLI をインストールする

Install SubQuery CLI globally on your terminal by using NPM:

npm install -g @subql/cli

Please note that we DO NOT encourage the use of yarn global for installing @subql/cli due to its poor dependency management which may lead to an errors down the line.

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

subql help

Initialise the SubQuery Starter Project

Inside the directory in which you want to create a SubQuery project, simply run the following command to get started.

subql init

You'll be asked certain questions as the SubQuery project is initalised:

  • Project Name: A name for your SubQuery project
  • Network Family: The layer-1 blockchain network family that this SubQuery project will be developed to index, use the arrow keys on your keyboard to select from the options, for this guide we will use "Terra"
  • Network: The specific network that this SubQuery project will be developed to index, use the arrow keys on your keyboard to select from the options, for this guide we will use "Terra"
  • Template: Select a SubQuery project template that will provide a starting point to begin development, we suggest selecting the "Starter project"
  • Git repository (Optional): Provide a Git URL to a repo that this SubQuery project will be hosted in (when hosted in SubQuery Explorer)
  • RPC endpoint (Required): Provide a HTTPS URL to a running RPC endpoint that will be used by default for this project. This RPC node must be an archive node (have the full chain state). For this guide we will use the default value "https://terra-columbus-5.beta.api.onfinality.io"
  • Authors (Required): Enter the owner of this SubQuery project here (e.g. your name!)
  • Description (Optional): You can provide a short paragraph about your project that describe what data it contains and what users can do with it
  • Version (Required): Enter a custom version number or use the default (1.0.0)
  • License (Required): Provide the software license for this project or accept the default (Apache-2.0)

After the initialisation process is complete, you should see a folder with your project name has been created inside the directory. The contents of this directoy should be identical to what's listed in the Directory Structure.

Last, under the project directory, run following command to install the new project's dependencies.

::: code-tabs @tab:active yarn shell cd PROJECT_NAME yarn install