💢
Tabi | Documentation
TabiGithubSocial
  • 🛠️Introduction
    • Overview
    • 💢About Tabichain
    • Whitepaper
    • Tabi's Core
    • Captain Nodes
  • 💡User Guide
    • Tutorials: Add Tabichain to wallet
    • About Testnet v2
      • Infrastructure on Testnet V2
  • 🔍Basic
    • Public Endpoints
    • Block Explorer
    • Faucet
    • Smart Contract
  • 🛠️Developer Guide
    • Getting Started
    • API Documentation
    • Run Tabichain Nodes
      • Deploy Testnet-V2 full node
      • Full node command line manual
      • Differences and Similarities Between Full Node
    • Tools
      • Tools and Plugins
      • Tabi Graph
      • Tabi Link Oracle
    • Polymorphic Virtual Machine
    • TLink Introduction
  • $seedTABI
Powered by GitBook
On this page
  • Introduction
  • Instructions
  • Example
  • Reference
  1. Developer Guide
  2. Tools

Tabi Graph

PreviousTools and PluginsNextTabi Link Oracle

Last updated 6 months ago

Introduction

Tabi Graph is built using Graph Node, an open-source Rust implementation whose event sources come from the Ethereum blockchain to deterministically update data stores that can be queried through GraphQL endpoints.

Instructions

  1. Installing the Graph CLI

On your local computer, run one of the following commands: Use npm:

npm install -g @graphprotocol/graph-cli

Use yarn:

yarn global add @graphprotocol/graph-cli
  1. Initialization

graph init --studio <SUBGRAPH_SLUG>
  1. Subgraph preparation

When making changes to Subgraph, three main files will be used:

  • List (subgraph.yaml) - The list defines which data sources will be indexed by the subgraph.

  • Schema (schema.graphql) - GraphQL schema defines the data retrieved from the subgraph.

  • AssemblyScript mapping (mapping.ts) - code that converts data in a data source into entities defined in a schema.

Refer to

  1. Deployment

Once your Subgraph is written, run the following command:

graph codegen
graph build
graph deploy <SUBGRAPH_SLUG> --ipfs https://graph.testnet.tabichain.com/ipfs --node https://graph.testnet.tabichain.com/deploy
  1. Query

Query address: https://graph.testnet.tabichain.com/subgraphs/name/ < NAME >

Example

Reference

See

🛠️
The Graph
GraphQL API for details
https://github.com/graphprotocol/example-subgraph
https://github.com/graphprotocol/graph-node?tab=readme-ov-file
https://thegraph.com/docs/zh/developing/creating-a-subgraph
https://thegraph.com/docs/zh/quick-start