Introduction
This tutorial will guide you through the components of a subgraph and step-by-step analysis.
After carefully studying all the stages of this tutorial, you will be able to analyze the subgraph in a simple language, accessible even to people who first encountered subgraphs and the question of how to evaluate them. This will reduce the time it takes to search for information and eliminate many of the problems that arise with understanding how subgraphs work.
Project site: https://thegraph.com/explorer
What is Graph Network and Subgraph?
The Graph is a decentralized protocol for indexing and querying data from blockchains starting with Ethereum. This allows you to query data that is difficult to query directly. Graph demonstrates the indexing of information data from Ethereum, POA and IPFS.
Subgraph is an API that allows you to make access to data from blockchains easily accessible to various dAPPs decentralized applications.
In total, there are more than 2000 subgraphs for dApp's such as Synthetix, Uniswap, Aragon, Livepeer, Gnosis, DAOstack, Decentraland.
Main parameters:
The subgraph determines what data the Graph will index from Ethereum and how it will store it. Once deployed, it will become part of the global blockchain data graph.
A subgraph definition consists of several files:
- subgraph.yaml: YAML file containing the subgraph manifest
- schema.graphql: A GraphQL schema that defines what data is stored for your subgraph and how to query it through GraphQL
- AssemblyScript Mappings: AssemblyScript code that converts Ethereum event data to objects defined in your schema
Step 1:
In order to start the analysis, you need to find your subgraph on the website https://thegraph.com/explorer in the search bar.
<graphitetools>
<GITHUB_USERNAME> / <SUBGRAPH_NAME>, where:
<GITHUB_USERNAME> is the GitHub username of the subgraph creator
<SUBGRAPH_NAME> is the project name of the subgraph
Step 2:
Next, we get to a page where you can examine in detail the subgraph and its components.
graphitetools - the name of the subgraph creator
dydx - subgraph name
Mainnet - the network in which the subgraph is used
GitHub - link to the GitHub repository
ID or identifier of the subgraph (you can say its name in the blockchain)
Queries (HTTP) - endpoint (request address for dApp's) programmers need this information more to create a backend
Below you can see the Graph Explorer and the GraphQL platform with the Playground, this is such a "sandbox" for demonstrating and researching the work of already deployed subgraphs.
Step 3:
If you find that the subgraph has a link to GitHub, go to the repository and see the following:
schema.graphql The schema for your subgraph is in this file.
subgraph.yaml Subgraph manifest.
The author of the project, if you wish, you can contact him and ask him to answer some questions related to the subgraph, if it is difficult for you to understand from a technical point of view. For example, what kind of data we get using this subgraph.
Step 4:
As practice shows, some subgraphs are not fully formatted and do not have a link to GitHub, in which case you can use the service https://ipfs.io and insert the subgraph ID into the address bar: https://ipfs.io/ipfs/<ID of the subgraph>, where: <subgraph ID> is the ID, we take it from the subgraph page.
Step 5:
For more information, go to the project website.
Let's see how the platform works and look a little deeper into the structure of requests, and analyze which subgraphs it uses.
For further analysis, we need to enter your browser's developer panel.
Step 6:
Assessment of the main criteria
At the final stage, after analyzing all the components of the subgraph you have chosen, you can already with full confidence be able to draw a conclusion according to the main criteria:
evaluate the main functions
assess the degree of completeness
assess the degree of difficulty
assess the degree of accuracy of the implementation
And also, all the way done will help you develop your own vision on such issues as:
can this subgraph be improved
if so, how exactly can this subgraph be improved?
what changes would you make to it
how well it displays data
All of these questions are key to understanding the components of the podgaf and that is why The Graph team included them in the report on the phase 2 of the curated program. Thus, at the final stage, each of you, if he is a curator, will be able to analyze your subgraphs.
Video guide: https://youtu.be/R3-WogeUPKo
RU guide: Развертывание и запуск SUBGRAPH на VPS Ubuntu 20.04 x64
EN guide: Deploying and running SUBGRAPH on a VPS Ubuntu 20.04 x64
Why do we believe in The Graph? What inspires us? Why is Graph so important to Web3?
Everything about the new direction of Web3 using the blockchain stack. Why is Graph so important to Web3?
Почему мы верим в The Graph? Что нас вдохновляет? Почему вам следует познакомиться с Graph Protocol!Почему мы верим в The Graph? Что нас вдохновляет? Почему вам следует познакомиться с Graph Protocol!
Official site: https://thegraph.com/
RU community THE GRAPH:
https://vk.com/thegraphru
https://ok.ru/thegraphru
My Discord: SHLIF9570