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/cookbook/upgrading-a-subgraph.mdx
+19-88
Original file line number
Diff line number
Diff line change
@@ -10,98 +10,39 @@ The process of upgrading is quick and your subgraphs will forever benefit from t
10
10
11
11
### Prerequisites
12
12
13
-
- You have already deployed a subgraph on the hosted service.
14
-
- The subgraph is indexing a chain available on The Graph Network.
15
-
- You have a wallet with ETH to publish your subgraph on-chain.
16
-
- You have ~3,000 GRT to curate your subgraph so Indexers can begin indexing it.
13
+
- You have a subgraph deployed on the hosted service.
17
14
18
15
## Upgrading an Existing Subgraph to The Graph Network
19
16
20
-
> You can find specific commands for your subgraph in the [Subgraph Studio](https://thegraph.com/studio/).
17
+
<VideoEmbedyoutube="MLqJdVCom5k" />
21
18
22
-
1. Get the latest version of the graph-cli installed:
19
+
If you are logged in to the hosted service, you can access a simple flow to upgrade your subgraphs from [your dashboard](https://thegraph.com/hosted-service/dashboard), or from an individual subgraph page.
23
20
24
-
```sh
25
-
npm install -g @graphprotocol/graph-cli
26
-
```
27
-
28
-
```sh
29
-
yarn global add @graphprotocol/graph-cli
30
-
```
31
-
32
-
Make sure your `apiVersion` in subgraph.yaml is `0.0.5` or greater.
33
-
34
-
2. Inside the subgraph's main project repository, authenticate the subgraph to deploy and build on the studio:
35
-
36
-
```sh
37
-
graph auth --studio <DEPLOY_KEY>
38
-
```
21
+
> This process typically takes less than five minutes.
39
22
40
-
3. Generate files and build the subgraph:
23
+
1. Select the subgraph(s) you want to upgrade.
24
+
2. Connect or enter the receiving wallet (the wallet that will become the owner of the subgraph).
25
+
3. Click the "Upgrade" button.
41
26
42
-
```sh
43
-
graph codegen && graph build
44
-
```
27
+
That's it! Your subgraphs will be deployed to Subgraph Studio, and published on The Graph Network. You can access the [Subgraph Studio](thegraph.com/studio) to manage your subgraphs, logging in with the wallet specified during the upgrade process.
45
28
46
-
If your subgraph has build errors, refer to the [AssemblyScript Migration Guide](/release-notes/assemblyscript-migration-guide/).
29
+
You'll be able to view your subgraphs live on the decentralized network via [Graph Explorer](https://thegraph.com/explorer).
47
30
48
-
4. Sign into [Subgraph Studio](https://thegraph.com/studio/) with your wallet and deploy the subgraph. You can find your `<SUBGRAPH_SLUG>` in the Studio UI, which is based on the name of your subgraph.
31
+
### What next?
49
32
50
-
```sh
51
-
graph deploy --studio <SUBGRAPH_SLUG>
52
-
```
33
+
When your subgraph is upgraded, it will automatically be indexed by the upgrade indexer. If the indexed chain is [fully supported by The Graph Network](/developing/supported-networks), you can add some GRT as "signal", to attract more indexers. It is recommended to curate your subgraph with at least 3,000 GRT to attract 2-3 Indexers for higher quality of service.
53
34
54
-
5. Test queries on the Studio's playground. Here are some examples for the [Sushi - Mainnet Exchange Subgraph](https://thegraph.com/explorer/subgraph?id=0x4bb4c1b0745ef7b4642feeccd0740dec417ca0a0-0&view=Playground):
55
-
56
-
```sh
57
-
{
58
-
users(first: 5) {
59
-
id
60
-
liquidityPositions {
61
-
id
62
-
}
63
-
}
64
-
bundles(first: 5) {
65
-
id
66
-
ethPrice
67
-
}
68
-
}
69
-
```
70
-
71
-
6. At this point, your subgraph is now deployed on Subgraph Studio, but not yet published to the decentralized network. You can now test the subgraph to make sure it is working as intended using the temporary query URL as seen on top of the right column above. As this name already suggests, this is a temporary URL and should not be used in production.
72
-
73
-
- Updating is just publishing another version of your existing subgraph on-chain.
74
-
- Because this incurs a cost, it is highly recommended to deploy and test your subgraph in the Subgraph Studio, using the "Development Query URL" before publishing. See an example transaction [here](https://etherscan.io/tx/0xd0c3fa0bc035703c9ba1ce40c1862559b9c5b6ea1198b3320871d535aa0de87b). Prices are roughly around 0.0425 ETH at 100 gwei.
75
-
- Any time you need to update your subgraph, you will be charged an update fee. Because this incurs a cost, it is highly recommended to deploy and test your subgraph on Goerli before deploying to mainnet. It can, in some cases, also require some GRT if there is no signal on that subgraph. In the case there is signal/curation on that subgraph version (using auto-migrate), the taxes will be split.
76
-
77
-
7. Publish the subgraph on The Graph's decentralized network by hitting the "Publish" button.
78
-
79
-
You should curate your subgraph with GRT to ensure that it is indexed by Indexers. To save on gas costs, you can curate your subgraph in the same transaction that you publish it to the network. It is recommended to curate your subgraph with at least 3,000 GRT to attract 2-3 Indexers for higher quality of service.
80
-
81
-
And that's it! After you are done publishing, you'll be able to view your subgraphs live on the decentralized network via [The Graph Explorer](https://thegraph.com/explorer).
82
-
83
-
Feel free to leverage the [#Curators channel](https://discord.gg/s5HfGMXmbW) on Discord to let Curators know that your subgraph is ready to be signaled. It would also be helpful if you share your expected query volume with them. Therefore, they can estimate how much GRT they should signal on your subgraph.
35
+
You can start to query your subgraph right away on The Graph Network, once you have generated an API key.
84
36
85
37
### Create an API key
86
38
87
39
You can generate an API key in Subgraph Studio [here](https://thegraph.com/studio/apikeys/).
88
40
89
41

90
42
91
-
At the end of each week, an invoice will be generated based on the query fees that have been incurred during this period. This invoice will be paid automatically using the GRT available in your balance. Your balance will be updated after the cost of your query fees are withdrawn. Query fees are paid in GRT via the Arbitrum network. You will need to add GRT to the Arbitrum billing contract to enable your API key via the following steps:
43
+
You can use this API key to query subgraphs on The Graph Network. All users start on the Free Plan, which includes 100,000 free queries per month. Developers can sign up for the Growth Plan by connecting a credit or debit card, or by depositing GRT to Subgraph Studio billing system.
92
44
93
-
- Purchase GRT on an exchange of your choice.
94
-
- Send the GRT to your wallet.
95
-
- On the Billing page in Studio, click on Add GRT.
96
-
97
-

98
-
99
-
- Follow the steps to add your GRT to your billing balance.
100
-
- Your GRT will be automatically bridged to the Arbitrum network and added to your billing balance.
101
-
102
-

103
-
104
-
> Note: see the [official billing page](../billing.mdx) for full instructions on adding GRT to your billing balance.
45
+
> Note: see the [billing documentation](../billing) for more information on plans, and on managing your billing on Subgraph Studio.
105
46
106
47
### Securing your API key
107
48
@@ -144,16 +85,16 @@ More information about the nature of the network and how to handle re-orgs are d
144
85
145
86
## Updating a Subgraph on the Network
146
87
147
-
If you would like to update an existing subgraph on the network, you can do this by deploying a new version of your subgraph to the Subgraph Studio using the Graph CLI.
88
+
If you would like to update an existing subgraph on the network, you can do this by deploying a new version of your subgraph to Subgraph Studio using the Graph CLI.
148
89
149
-
1. Make changes to your current subgraph. A good idea is to test small fixes on the Subgraph Studio by publishing to Goerli.
90
+
1. Make changes to your current subgraph. A good idea is to test small fixes on Subgraph Studio by publishing to Goerli.
150
91
2. Deploy the following and specify the new version in the command (eg. v0.0.1, v0.0.2, etc):
151
92
152
93
```sh
153
94
graph deploy --studio <SUBGRAPH_SLUG>
154
95
```
155
96
156
-
3. Test the new version in the Subgraph Studio by querying in the playground
97
+
3. Test the new version in Subgraph Studio by querying in the playground
157
98
4. Publish the new version on The Graph Network. Remember that this requires gas (as described in the section above).
158
99
159
100
### Owner Update Fee: Deep Dive
@@ -180,7 +121,7 @@ Subgraphs are open APIs that external developers are leveraging. Open APIs need
180
121
181
122
### Updating the Metadata of a Subgraph
182
123
183
-
You can update the metadata of your subgraphs without having to publish a new version. The metadata includes the subgraph name, image, description, website URL, source code URL, and categories. Developers can do this by updating their subgraph details in the Subgraph Studio where you can edit all applicable fields.
124
+
You can update the metadata of your subgraphs without having to publish a new version. The metadata includes the subgraph name, image, description, website URL, source code URL, and categories. Developers can do this by updating their subgraph details in Subgraph Studio where you can edit all applicable fields.
184
125
185
126
Make sure **Update Subgraph Details in Explorer** is checked and click on **Save**. If this is checked, an on-chain transaction will be generated that updates subgraph details in the Explorer without having to publish a new version with a new deployment.
186
127
@@ -201,17 +142,7 @@ Follow the steps [here](/managing/deprecating-a-subgraph) to deprecate your subg
201
142
202
143
The hosted service was set up to allow developers to deploy their subgraphs without any restrictions.
203
144
204
-
In order for The Graph Network to truly be decentralized, query fees have to be paid as a core part of the protocol's incentives. For more information on subscribing to APIs and paying the query fees, check out billing documentation [here](/billing/).
205
-
206
-
### Estimate Query Fees on the Network
207
-
208
-
While this is not a live feature in the product UI, you can set your maximum budget per query by taking the amount you're willing to pay per month and dividing it by your expected query volume.
209
-
210
-
While you get to decide on your query budget, there is no guarantee that an Indexer will be willing to serve queries at that price. If a Gateway can match you to an Indexer willing to serve a query at, or lower than, the price you are willing to pay, you will pay the delta/difference of your budget **and** their price. As a consequence, a lower query price reduces the pool of Indexers available to you, which may affect the quality of service you receive. It's beneficial to have high query fees, as that may attract curation and big-name Indexers to your subgraph.
211
-
212
-
Remember that it's a dynamic and growing market, but how you interact with it is in your control. There is no maximum or minimum price specified in the protocol or the Gateways. For example, you can look at the price paid by a few of the dapps on the network (on a per-week basis), below. See the last column, which shows query fees in GRT.
213
-
214
-

145
+
On The Graph Network, query fees have to be paid as a core part of the protocol's incentives. For more information on subscribing to APIs and paying the query fees, check out billing documentation [here](/billing/).
Copy file name to clipboardExpand all lines: website/pages/en/sunrise.mdx
+1-1
Original file line number
Diff line number
Diff line change
@@ -12,7 +12,7 @@ This plan draws on many previous developments from The Graph ecosystem, includin
12
12
13
13
### What are the phases of the Sunrise of Decentralized Data?
14
14
15
-
**Sunray**: Enable support for hosted service chains, offer a seamless upgrade flow, offer a free plan on The Graph Network.
15
+
**Sunray**: Enable support for hosted service chains, introduce a seamless upgrade flow, offer a free plan on The Graph Network as well as simple payment options.
16
16
**Sunbeam**: The upgrade window that subgraph developers will have to upgrade their subgraphs to The Graph Network. The start and length of this will be announced soon.
17
17
**Sunrise**: Hosted service endpoints will expire as traffic moves to The Graph Network.
0 commit comments