Hosted Subgraph

What is hosted Subgraph

The Graph is a decentralized protocol that simplifies the process of extracting and querying data from blockchain archive nodes. This allows web3 developers to quickly and easily index and store contract data. Additionally, it makes it a breeze to integrate GraphQL APIs into their applications.

๐Ÿ‘

Migrate from hosted services

We have recently added support for directly copying subgraphs from hosted services.Migrate docs

๐Ÿ“˜

subgraph-example

A Beginner's Guide to Creating a Subgraph๏ผšBAYC Subgraph

Requirements

DependencyVersion
node^16.0.0
graph-cli^0.30.2

Supported Networks

NetwroksStatus
Ethereumโœ…
Polygonโœ…
BNB Chainโœ…
Avalancheโœ…
Fantomโœ…
Arbitrumโœ…
Optimismโœ…
Baseโœ…
ZkSyncโœ…

How to use Hosted Subgraph

Creating Subgraphs

  1. To get started, simply log in to the Chainbase dashboard backend and select "indexer" in the navigation bar. From there, click the "Deploy indexer" button and you're good to go!

  1. To create your subgraph, simply switch to the "Hosted subgraph dataset" option, enter the name of your subgraph, select the appropriate blockchain chain, and create the subgraph.

  1. To access the Submap Details panel, you'll need to wait for roughly one minute after creating the subgraph for it to appear in the display list. Note that the graphql playground on the right will also need to wait until the subgraph has been deployed.

  1. Once you have accessed the subgraph dashboard panel, you will be able to view the subgraph deployment command. Simply copy this command to your local area and prepare to execute the subgraph deployment.

  1. To get started, navigate to the code directory in your local environment. Once there, you can execute subgraph compilation after deploying the subgraphs. Please note that each deployment will be recorded with a version number, which is typically maintained in the code itself. If no version number is specified, you will be prompted to enter one.

  1. After deployment, you can check the status of the subgraph deployment in the dashboard panel. Please keep in mind that it may take a few minutes for the display to update after the initial deployment due to background processing.

  1. To retrieve and integrate subgraph data into your application, feel free to utilize the accompanying GraphQL API for testing purposes.

  1. The subgraph playground offers a user-friendly interface that displays all the indexed fields within your subgraph. From this interface, you can select the specific fields that need to be stored in the backend by using the visual request panel.

  1. If you encounter unexpected errors with your subgraphs, you may want to retrieve the debug, info, and error logs to troubleshoot the issue.