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
A Beginner's Guide to Creating a Subgraph：BAYC Subgraph
- 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!
- 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.
- 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.
- 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.
- 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.
- 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.
- To retrieve and integrate subgraph data into your application, feel free to utilize the accompanying GraphQL API for testing purposes.
- 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.
- If you encounter unexpected errors with your subgraphs, you may want to retrieve the debug, info, and error logs to troubleshoot the issue.
Updated about 1 month ago