Skip to content

Commit 3a11d06

Browse files
committed
potential changes
1 parent 6ed5cba commit 3a11d06

File tree

1 file changed

+82
-14
lines changed

1 file changed

+82
-14
lines changed

website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx

Lines changed: 82 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,34 @@
22
title: Deploying a Subgraph to Subgraph Studio
33
---
44

5-
These are the steps to deploy your subgraph to Subgraph Studio:
5+
> Before deploying, you must install The Graph CLI; please review [Creating a Subgraph]()
66
7-
- Install The Graph CLI (with either yarn or npm)
7+
When you deploy a subgraph, you push it to Subgraph Studio, where you'll be able to stage it. It's important to remember that deploying is not the same as publishing. When you publish a subgraph, you are publishing it on-chain.
8+
9+
## What can you do in Subgraph Studio?
10+
11+
[Subgraph Studio]() allows you to do the following:
12+
13+
- Create and manage your API keys for specific subgraphs
814
- Create your Subgraph in Subgraph Studio
915
- Authenticate your account from the CLI
10-
- Deploying a Subgraph to Subgraph Studio
16+
- Deploy a Subgraph to Subgraph Studio
17+
- Stage it in the playground environment
18+
- Integrate it in staging using the query URL
19+
20+
In Subgraph Studio, you can view the following:
1121

12-
## Installing Graph CLI
22+
- Your user account controls
23+
- A list of subgraphs you've created
24+
- A section to manage your API keys
25+
- A section to manage, view details, and visualize the status of a specific subgraph
26+
- A section to manage your billing
1327

14-
There is a CLI to deploy subgraphs to [Subgraph Studio](https://thegraph.com/studio/). Here are the commands to install `graph-cli`. This can be done using npm or yarn.
28+
Step-by-Step
29+
30+
## Install the Graph CLI
31+
32+
You must have [Node.js](https://nodejs.org/) and a package manager of your choice (`npm`, `yarn` or `pnpm`) installed to use the Graph CLI. Check for the [most recent](https://github.com/graphprotocol/graph-tooling/releases?q=%40graphprotocol%2Fgraph-cli&expanded=true) CLI version.
1533

1634
**Install with yarn:**
1735

@@ -27,7 +45,35 @@ npm install -g @graphprotocol/graph-cli
2745

2846
## Create your Subgraph in Subgraph Studio
2947

30-
Before deploying your actual subgraph you need to create a subgraph in [Subgraph Studio](https://thegraph.com/studio/). We recommend you read our [Studio documentation](/deploying/subgraph-studio) to learn more about this.
48+
### Create an account
49+
50+
Before deploying your subgraph you need to create a subgraph in [Subgraph Studio](https://thegraph.com/studio/).
51+
52+
1. Open [Subgraph Studio](https://thegraph.com/studio/).
53+
2. Connect your wallet.
54+
- You can do this via MetaMask, WalletConnect, Coinbase Wallet, or Safe.
55+
3. After you connect your wallet, your unique deploy key will be displayed on your "My Subgraphs" page or your “subgraph details” page in the Studio.
56+
- The deploy key allows you to publish your subgraphs or manage your API keys and billing. It is unique but can be regenerated if you think it has been compromised.
57+
4. You can create one or multiple API keys by clicking the API keys tab at the top of your homepage. See image below:
58+
- You can limit API keys to a specific domain in the security section.
59+
60+
> Important: You need API keys to query subgraphs
61+
62+
#### How to create a subgraph in Subgraph Studio
63+
64+
<VideoEmbed youtube="nGIFuC69bSA" />
65+
66+
> For additional written detail, review the [quick-start]()
67+
68+
#### Subgraph Compatibility with The Graph Network
69+
70+
In order to be supported by Indexers on The Graph Network, subgraphs must:
71+
72+
- Index a [supported network](/developing/supported-networks)
73+
- Must not use any of the following features:
74+
- ipfs.cat & ipfs.map
75+
- Non-fatal errors
76+
- Grafting
3177

3278
## Initialize your Subgraph
3379

@@ -37,32 +83,54 @@ Once your subgraph has been created in Subgraph Studio you can initialize the su
3783
graph init --studio <SUBGRAPH_SLUG>
3884
```
3985

40-
The `<SUBGRAPH_SLUG>` value can be found on your subgraph details page in Subgraph Studio:
86+
You can view the `<SUBGRAPH_SLUG>` value on your subgraph details page in Subgraph Studio, see image below:
4187

4288
![Subgraph Studio - Slug](/img/doc-subgraph-slug.png)
4389

44-
After running `graph init`, you will be asked to input the contract address, network, and ABI that you want to query. Doing this will generate a new folder on your local machine with some basic code to start working on your subgraph. You can then finalize your subgraph to make sure it works as expected.
90+
After running `graph init`, you will be asked to input the contract address, network, and ABI that you want to query.
91+
92+
- This will generate a new folder on your local machine with some basic code to start working on your subgraph. You can then finalize your subgraph to make sure it works as expected.
4593

4694
## Graph Auth
4795

48-
Before being able to deploy your subgraph to Subgraph Studio, you need to login into your account within the CLI. To do this, you will need your deploy key that you can find on your "My Subgraphs" page or your subgraph details page.
96+
Before can deploy your subgraph to Subgraph Studio, you must login into your account using the CLI. To do this, you will need your deploy key (you can find it on your "My Subgraphs" page or under your subgraph details page).
4997

50-
Here is the command that you need to use to authenticate from the CLI:
98+
Then, use the following command to authenticate from the CLI:
5199

52100
```bash
53101
graph auth --studio <DEPLOY KEY>
54102
```
55103

56104
## Deploying a Subgraph to Subgraph Studio
57105

58-
Once you are ready, you can deploy your subgraph to Subgraph Studio. Doing this won't publish your subgraph to the decentralized network, it will only deploy it to your Studio account where you will be able to test it and update the metadata.
106+
Once you are ready, you can deploy your subgraph to Subgraph Studio.
59107

60-
Here is the CLI command that you need to use to deploy your subgraph.
108+
> Deploying a subgraph with the CLI pushes it to the Studio, where you can test it and and update the metadata. This action won't publish your subgraph to the decentralized network.
109+
110+
Use the following CLI command to deploy your subgraph:
61111

62112
```bash
63113
graph deploy --studio <SUBGRAPH_SLUG>
64114
```
65115

66-
After running this command, the CLI will ask for a version label, you can name it however you want, you can use labels such as `0.1` and `0.2` or use letters as well such as `uniswap-v2-0.1`. Those labels will be visible in Graph Explorer and can be used by curators to decide if they want to signal on this version or not, so choose them wisely.
116+
After running this command, the CLI will ask for a version label.
117+
118+
- It's strongly recommended to use [semver](https://semver.org/) for versioning like `0.0.1`. That said, you are free to choose any string as version such as:`v1`, `version1`, `asdf`.
119+
- The labels you create will be visible in Graph Explorer and can be used by curators to decide if they want to signal on a specific version or not, so choose them wisely.
120+
121+
## Testing your Subgraph
122+
123+
After deploying, you can test/stage your subgraph in Subgraph Studio, deploy another version, update the metadata, and publish to Graph Explorer when you are ready.
124+
125+
Use Subgraph Studio’s playground to:
126+
127+
- Check your subgraph logs
128+
- The subgraph logs will indicate if and where a subgraph fails.
129+
130+
## Publish your Subgraph in Subgraph Studio
131+
132+
You are now ready to publish your subgraph!
133+
134+
In order to publish your subgraph successfully, review [publishing a subgraph] (/publishing/publishing-a-subgraph/).
67135

68-
Once deployed, you can test your subgraph in Subgraph Studio using the playground, deploy another version if needed, update the metadata, and when you are ready, publish your subgraph to Graph Explorer.
136+
<VideoEmbed youtube="satdwdbvzAQ" />

0 commit comments

Comments
 (0)