You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: website/pages/en/network/developing.mdx
+34-52Lines changed: 34 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,39 +2,38 @@
2
2
title: Developing
3
3
---
4
4
5
-
Learn developer fundamentals and review the basics of a subgraph’s lifecycle. To start coding right away and engage The Graph, go to the following:[Developer Quick Start](/quick-start/)
5
+
Learn developer fundamentals and review the basics of a subgraph’s lifecycle. To start coding right away and build on The Graph, go to [Developer Quick Start](/quick-start/)
6
6
7
7
## Overview
8
8
9
9
As a developer, you need important data to build and power your dapps. Querying and indexing that blockchain data can be challenging, but The Graph provides a solution to this issue.
10
10
11
11
On The Graph, you can:
12
12
13
-
1. Create, deploy and publish subgraphs to The Graph using **Graph CLI** and [Subgraph Studio](/https://thegraph.com/studio/).
14
-
2. Use Graph node via **GraphQL** to query live subgraphs and power dapps.
13
+
1. Create, deploy and publish subgraphs to The Graph using **Graph CLI** and [Subgraph Studio](https://thegraph.com/studio/).
14
+
2. Use GraphQL to query live subgraphs and power dapps.
15
15
16
-
### What is GraphQL and Graph CLI?
16
+
### What is GraphQL?
17
17
18
-
-**GraphCLI** is a command line interface tool for building and deploying to The Graph.
19
-
-**GraphQL** is the query language use for APIs and a runtime for executing those queries with your existing data. The Graph uses GraphQL to query subgraphs.
18
+
-[GraphQL](/querying/graphql-api/)is the query language for APIs and a runtime for executing those queries with your existing data. The Graph uses GraphQL to query subgraphs.
20
19
21
20
### Developer Capabilities
22
21
23
-
-Engage with the entire subgraph lifecycle on the network, including publishing, querying and iterating on your custom subgraphs.
24
-
-Specialize in subgraph development, building open APIs for others to utilize and build on.
25
-
-Focus on application development by querying subgraphs deployed by other developers.
22
+
-Query subgraphs built by other developers in [The Graph Network](https://thegraph.com/explorer)and integrate them into your own dapps.
23
+
-Create custom subgraphs to fulfill specific data needs, allowing improved scalability and flexibility for other developers.
24
+
-Deploy, publish, and signal your subgraphs within The Graph Network.
26
25
27
26
## Subgraph Specifics
28
27
29
28
### What are subgraphs?
30
29
31
-
A subgraph is a custom API built on blockchain data. It extracts data from a blockchain, process it, and stores it so that it can be easily queried via GraphQL.
30
+
A subgraph is a custom API built on blockchain data. It extracts data from a blockchain, processes it, and stores it so that it can be easily queried via GraphQL.
32
31
33
32
A subgraph primarily consists of the following files:
34
33
35
-
-`subgraph.yaml`: this YAML file contains the subgraph manifest
36
-
-`subgraph.graphql`: this GraphQL schema defines what data is stored for your subgraph, and how to query it via GraphQL
37
-
-`AssemblyScript Mappings`: [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)code that translates from the event data to the entities defined in your schema
34
+
-`subgraph.yaml`: this YAML file contains the [subgraph manifest](/developing/creating-a-subgraph/#the-subgraph-manifest)
35
+
-`subgraph.graphql`: this GraphQL schema defines what data is stored for your subgraph, and how to query it via [GraphQL](/developing/creating-a-subgraph/#the-graphql-schema)
36
+
-`AssemblyScript Mappings`: [AssemblyScript](https://github.com/AssemblyScript/assemblyscript)mappings translates data from the event data to the entities defined in your schema
38
37
39
38
Learn the detailed specifics to [create a subgraph](/developing/creating-a-subgraph/).
40
39
@@ -44,80 +43,63 @@ Here is a general view of a subgraph’s cycle:
Subgraph development starts with local development and staging.
48
+
Great subgraphs start with a local development environment and unit tests. Developers can use `graph-cli,``graph-ts,` and [Matchstick](/developing/unit-testing-framework/) to build robust subgraphs that deploy to The Graph Network.
50
49
51
-
- You can use the same local setup whether you're building for The Graph Network or a local Graph Node.
52
-
- You can leverage `graph-cli` and `graph-ts` to build your subgraph.
53
-
- You are encouraged to use tools such as [Matchstick](https://github.com/LimeChain/matchstick) for unit testing to improve the robustness of your subgraphs.
54
-
55
-
> Only subgraphs on [supported networks](/developing/supported-networks/) will earn indexing rewards. Subgraphs that fetch data from IPFS are also **not** eligible.
50
+
> Developers use [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli), a command line interface tool for building and deploying subgraphs in The Graph.
56
51
57
52
## Deploy to Subgraph Studio
58
53
59
-
Once defined, a subgraph can be built and deployed to [Subgraph Studio](/deploying-a-subgraph-to-studio/). In Subgraph Studio, you can do the following:
54
+
Once defined, a subgraph can be deployed to [Subgraph Studio](/deploying/deploying-a-subgraph-to-studio/). In Subgraph Studio, you can do the following:
60
55
61
-
- Verify that your subgraph doesn't have any indexing errors and works as expected.
62
56
- Use its staging environment to index the deployed subgraph and make it available for review.
63
-
64
-
Learn how to [deploy subgraphs](/deploying-a-subgraph-to-studio/).
57
+
- Verify that your subgraph doesn't have any indexing errors and works as expected.
65
58
66
59
## Publish to the Network
67
60
68
-
When you are happy with your subgraph, you can publish it to The Graph Network.
61
+
When you are happy with your subgraph, you can [publish it](/publishing/publishing-a-subgraph/) to The Graph Network.
69
62
70
-
- This is an on-chain action, which registers the subgraph and makes it discoverable by Indexers.
63
+
- To put your subgraph into production and ensure indexers can index it, you must publish it to The Graph Network.
64
+
- This is an on-chain action, which registers the subgraph and makes it discoverable by Indexers.
71
65
- Published subgraphs have a corresponding NFT, which is then easily transferable.
72
66
- Published subgraphs have associated metadata, which provides other network participants with useful context and information.
73
67
74
-
Learn how to [publish a subgraph](/publishing/publishing-a-subgraph/).
75
-
76
68
## Add Signal for Indexing
77
69
78
-
Published subgraphs are unlikely to be picked up by Indexers without signal. To encourage indexing you should add signal to your subgraph.
70
+
Published subgraphs are unlikely to be picked up by Indexers without signal. To encourage indexing you should add signal to your subgraph. Learn more about signaling and [curating](/network/curating/) on The Graph.
79
71
80
-
**What is signal?**
72
+
### What is signal?
81
73
82
74
- Signal is locked GRT associated with a given subgraph. It indicates to indexers that a given subgraph will receive query volume and it contributes to the indexing rewards available for processing it.
83
75
- Third party Curators may also signal on a given subgraph, if they deem the subgraph likely to drive query volume.
84
76
85
-
Learn more about signaling and [curating](/network/curating/) on The Graph.
86
-
87
77
## Querying & Application Development
88
78
89
-
Once a subgraph has been processed by Indexers and is available for querying, you can start using your subgraph in your applications.
90
-
91
-
- You query subgraphs via a gateway, which forwards your queries to an Indexer who has processed the subgraph (paying query fees in GRT).
92
-
- In order to make queries, you must generate an API key, which can be done in [Subgraph Studio](/https://thegraph.com/studio/).
93
-
- This API key must be funded with GRT to pay query fees.
94
-
- You can set a maximum query fee to control their costs and limit your API key to a given subgraph or origin domain.
95
-
- Subgraph Studio provides you with data on your API key usage over time.
96
-
- You can express an Indexer preference to the gateway, such as preferring Indexers with fast query response or have up-to-date data. These controls are set in Subgraph Studio.
79
+
Once a subgraph has been processed by Indexers and is ready to [query](/querying/querying-the-graph/), developers can start using their subgraph in their dapps.
97
80
98
-
Learn more about [querying](/querying/querying-the-graph/).
81
+
- When a query is made, The Graph Network selects an Indexer who has processed the subgraph to serve that query. Query fees are paid in GRT.
82
+
- Developers must generate an API key and fund it with GRT to make queries, which can be done in [Subgraph Studio](https://thegraph.com/studio/).
83
+
- Developers can set a maximum query fee, in order to control their costs, and limit their API key to a given subgraph or origin domain.
84
+
- Subgraph Studio provides API key usage data.
85
+
- Developers can express an Indexer preference to the gateway, for example preferring Indexers whose query response is faster, or whose data is most up to date. These controls are set in Subgraph Studio.
99
86
100
87
## Updating Subgraphs
101
88
102
-
To update your subgraph with bug fixes or new functionalities, initiate a transaction to point it to the new version. You can deploy new versions of your subgraphs to [Subgraph Studio](/https://thegraph.com/studio/) for development and testing.
89
+
To update your subgraph with bug fixes or new functionalities, initiate a transaction to point it to the new version. You can deploy new versions of your subgraphs to [Subgraph Studio](https://thegraph.com/studio/) for development and testing.
103
90
104
91
- If you selected "auto-migrate" when you applied the signal, updating the subgraph will migrate any signal to the new version and incur a migration tax.
105
92
- This signal migration should prompt Indexers to start indexing the new version of the subgraph, so it should soon become available for querying.
106
93
107
-
## Deprecating Subgraphs
108
-
109
-
If you no longer need a published subgraph, then you will need to deprecate the subgraph.
110
-
111
-
- Deprecating a subgraph returns any signaled GRT to Curators.
112
-
- To deprecate a subgraph, see the [deprecating a subgraph guide](/network/developing/deprecating-a-subgraph/).
94
+
## Deprecating & Transferring Subgraphs
113
95
114
-
## Transferring Subgraph
96
+
If you no longer need a published subgraph, you can deprecate or transfer a subgraph. Deprecating a subgraph returns any signaled GRT to [Curators](/network/curating/).
115
97
116
-
You can transfer the ownership of a subgraph. To transfer subgraph ownership, see the [transfer subgraph guide](/transferring-subgraph-ownership/).
98
+
- To deprecate or transfer a subgraph, check out [this guide](/managing/transfer-and-deprecate-a-subgraph/#deprecating-a-subgraph).
117
99
118
-
###Network Economics
100
+
## Network Economics
119
101
120
102
As a developer, you can do any of the following:
121
103
122
-
- Lock up GRT to encourage indexing and the query subgraphs.
104
+
- Lock up GRT to encourage indexing and querying subgraphs.
0 commit comments