SubQuery enables better dApps by making decentralised data more accessible
SubQuery allows every Substrate/Polkadot team 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 Polkadot/Substrate projects build better dApps by allowing anyone to reliably find and consume data faster. Today, anyone can query and extract Polkadot network data in only minutes and at no cost.
SubQuery aims to support all Substrate-compatible networks.
The first, you need to create sample project with command: subql init sample
Then go to sample project directory and run yarn install
to install all dependencies
After installation, change your project.yaml file, here is an example:
specVersion: 0.2.0
name: sample
version: 0.0.4
description: Cuong
repository: https://github.com/subquery/subql-starter
schema:
file: /Users/trancuong/Sotatek/SubQuery/sample/schema.graphql
network:
endpoint: wss://polkadot.api.onfinality.io/public-ws
genesisHash: '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'
dataSources:
- kind: solana/Runtime
startBlock: 97497290
mapping:
file: ./dist/index.js
handlers:
- handler: handleBlock
kind: solana/BlockHandler
After that, you can run yarn codegen && yarn build
to build the sample project
Then go to subql
project, in root path of the project, run the following command:
yarn install
cd packages/types-solana && yarn build
cd ../common-solana && yarn build
cd ../node-solana && yarn build
# Yarn
yarn global add @subql/cli @subql/node @subql/query
# NPM
npm install -g @subql/cli @subql/node @subql/query
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.
You'll need Typescript and Node.
Don't want to worry about running your own SubQuery nodes? SubQuery provides a managed hosted service to the community for free. Follow our publishing guide to see how you can upload your project to SubQuery Projects.
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.
@subql/cli
@subql/node
@subql/query
@subql/contract-processors
@subql/common
@subql/types
@subql/validator
For more documentation, visit doc.subquery.network
SubQuery is a project built with love from the team at OnFinality Copyright © 2021 OnFinality Limited authors & contributors