Skip to content

Commit 030ed60

Browse files
idalithbbenfaceazf20
authored
made some updates to this page after feedback (#678)
* made some updates to this page after feedback * Update website/pages/en/quick-start.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/quick-start.mdx It doesn't, great catch! Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/quick-start.mdx * lint * lint --------- Co-authored-by: Benoît Rouleau <[email protected]> Co-authored-by: azf20 <[email protected]>
1 parent 66053e4 commit 030ed60

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

website/pages/en/quick-start.mdx

+19-20
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,25 @@ Ensure that your subgraph will be indexing data from a [supported network](/deve
88

99
This guide is written assuming that you have:
1010

11-
- A smart contract address on the network of your choice
12-
- GRT to curate your subgraph
1311
- A crypto wallet
12+
- A smart contract address on the network of your choice
1413

1514
## 1. Create a subgraph on Subgraph Studio
1615

1716
Go to the [Subgraph Studio](https://thegraph.com/studio/) and connect your wallet.
1817

19-
Once connected, you can begin by clicking “Create a Subgraph”.
18+
Once your wallet is connected, you can begin by clicking “Create a Subgraph." It is recommended to name the subgraph in Title Case: "Subgraph Name Chain Name."
2019

2120
## 2. Install the Graph CLI
2221

23-
The Graph CLI is written in JavaScript and you will need to have either `npm` or `yarn` installed to use it.
22+
The Graph CLI is written in TypeScript and you will need to have `node` and either `npm` or `yarn` installed to use it. Check that you have the most recent CLI version installed.
2423

2524
On your local machine, run one of the following commands:
2625

2726
Using [npm](https://www.npmjs.com/):
2827

2928
```sh
30-
npm install -g @graphprotocol/graph-cli
29+
npm install -g @graphprotocol/graph-cli@latest
3130
```
3231

3332
Using [yarn](https://yarnpkg.com/):
@@ -36,7 +35,13 @@ Using [yarn](https://yarnpkg.com/):
3635
yarn global add @graphprotocol/graph-cli
3736
```
3837

39-
## 3. Initialize your Subgraph
38+
## 3. Initialize your subgraph from existing contract
39+
40+
Initialize your subgraph from an existing contract by running the initialize command:
41+
42+
```sh
43+
graph init --studio <SUBGRAPH_SLUG>
44+
```
4045

4146
> You can find commands for your specific subgraph on the subgraph page in [Subgraph Studio](https://thegraph.com/studio/).
4247
@@ -53,17 +58,11 @@ When you initialize your subgraph, the CLI tool will ask you for the following i
5358
- Index contract events as entities: it is suggested that you set this to true as it will automatically add mappings to your subgraph for every emitted event
5459
- Add another contract(optional): you can add another contract
5560

56-
Initialize your subgraph from an existing contract by running the following command:
57-
58-
```sh
59-
graph init --studio <SUBGRAPH_SLUG>
60-
```
61-
6261
See the following screenshot for an example for what to expect when initializing your subgraph:
6362

6463
![Subgraph command](/img/subgraph-init-example.png)
6564

66-
## 4. Write your Subgraph
65+
## 4. Write your subgraph
6766

6867
The previous commands create a scaffold subgraph that you can use as a starting point for building your subgraph. When making changes to the subgraph, you will mainly work with three files:
6968

@@ -93,7 +92,7 @@ You will be asked for a version label. It's strongly recommended to use [semver]
9392

9493
## 6. Test your subgraph
9594

96-
You can test your subgraph by making a sample query in the playground section.
95+
In Subgraph Studio's playground environment, you can test your subgraph by making a sample query.
9796

9897
The logs will tell you if there are any errors with your subgraph. The logs of an operational subgraph will look like this:
9998

@@ -143,26 +142,26 @@ If your subgraph is failing, you can query the subgraph health by using the Grap
143142
}
144143
```
145144

146-
## 7. Publish Your Subgraph to The Graph’s Decentralized Network
145+
## 7. Publish your subgraph to The Graph’s Decentralized Network
147146

148-
Once your subgraph has been deployed to Subgraph Studio, you have tested it out, and are ready to put it into production, you can then publish it to the decentralized network.
147+
Once your subgraph has been deployed to Subgraph Studio, you have tested it out, and you are ready to put it into production, you can then publish it to the decentralized network.
149148

150-
In Subgraph Studio, click on your subgraph. On the subgraph’s page, you will be able to click the publish button on the top right.
149+
In Subgraph Studio, you will be able to click the publish button on the top right of your subgraph's page.
151150

152151
Select the network you would like to publish your subgraph to. It is recommended to publish subgraphs to Arbitrum One to take advantage of the [faster transaction speeds and lower gas costs](/arbitrum/arbitrum-faq).
153152

154-
The (upgrade Indexer)[/sunrise/#about-the-upgrade-indexer] will begin serving queries on your subgraph regardless of subgraph curation, and will provide you with 100,000 free queries per month.
153+
The (upgrade Indexer)[/sunrise/#about-the-upgrade-indexer] will begin serving queries on your subgraph regardless of subgraph curation, and it will provide you with 100,000 free queries per month.
155154

156155
For a higher quality of service and stronger redundancy, you can curate your subgraph to attract more Indexers. At the time of writing, it is recommended that you curate your own subgraph with at least 3,000 GRT to ensure 3-5 additional Indexers begin serving queries on your subgraph.
157156

158157
To save on gas costs, you can curate your subgraph in the same transaction that you published it by selecting this button when you publish your subgraph to The Graph’s decentralized network:
159158

160159
![Subgraph publish](/img/publish-and-signal-tx.png)
161160

162-
## 8. Query your Subgraph
161+
## 8. Query your subgraph
163162

164163
Now, you can query your subgraph by sending GraphQL queries to your subgraph’s Query URL, which you can find by clicking on the query button.
165164

166-
You can query from your dapp if you don't have your API key via the free, rate-limited temporary query URL that can be used for development and staging.
165+
If you don't have your API key, you can query via the free, rate-limited development query URL, which can be used for development and staging.
167166

168167
For more information about querying data from your subgraph, read more [here](/querying/querying-the-graph/).

0 commit comments

Comments
 (0)