Skip to content

Commit 02c3f9c

Browse files
committed
updating suggested changes
1 parent b8470ca commit 02c3f9c

File tree

1 file changed

+66
-53
lines changed

1 file changed

+66
-53
lines changed

website/pages/en/quick-start.mdx

Lines changed: 66 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,18 @@
22
title: Quick Start
33
---
44

5-
This guide walks you through the basics of publishing and querying a subgraph on The Graph easily.
5+
Learn how to easily publish and query a subgraph on The Graph.
66

7-
**Prerequisites for this guide:**
7+
## Prerequisites for this guide
88

99
- A crypto wallet
10-
- A smart contract address on the [supported network](/developing/supported-networks/) of your choice
11-
- An API key
10+
- A smart contract address on one of the [supported networks](/developing/supported-networks/)
1211

1312
## Step-by-Step
1413

1514
### 1. Install the Graph CLI
1615

17-
You must have [Node.js](https://nodejs.org/en) and 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.
16+
You must have [Node.js](https://nodejs.org/) and 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.
1817

1918
On your local machine, run one of the following commands:
2019

@@ -30,26 +29,30 @@ Using [yarn](https://yarnpkg.com/):
3029
yarn global add @graphprotocol/graph-cli
3130
```
3231

33-
### 2. Create your subgraph
32+
### 2. Create Your Subgraph
3433

3534
If your contract has events, the `init` command will automatically create a scaffold of a subgraph.
3635

37-
#### Create via CLI
36+
#### Create via Graph CLI
3837

39-
Use the following command to create a subgraph in Subgraph Studio using CLI: `init --product subgraph-studio`
38+
Use the following command to create a subgraph in Subgraph Studio using CLI:
4039

41-
#### **Create via Subgraph Studio**
40+
```sh
41+
init --product subgraph-studio
42+
```
43+
44+
#### Create via Subgraph Studio
4245

43-
Subgraph Studio is a staging environment where you can create, manage, deploy, and publish subgraphs and API Keys.
46+
Subgraph Studio has a staging environment where you can create, manage, deploy, and publish subgraphs and API Keys.
4447

45-
1. Go to the [Subgraph Studio](https://thegraph.com/studio/) and connect your wallet.
46-
2. Click “Create a Subgraph." It is recommended to name the subgraph in Title Case: "Subgraph Name Chain Name."
48+
1. Go to [Subgraph Studio](https://thegraph.com/studio/) and connect your wallet.
49+
2. Click “Create a Subgraph". It is recommended to name the subgraph in Title Case: "Subgraph Name Chain Name".
4750

48-
For additional information on subgraph creation and CLI, see [Creating a Subgraph](developing/creating-a-subgraph).
51+
For additional information on subgraph creation and CLI, see [Creating a Subgraph](/developing/creating-a-subgraph).
4952

5053
### 3. Initialize Your Subgraph
5154

52-
#### **From an existing contract**
55+
#### From an existing contract
5356

5457
The following command initializes your subgraph from an existing contract:
5558

@@ -63,58 +66,58 @@ You can find commands for your specific subgraph on the subgraph page in [Subgra
6366

6467
When you initialize your subgraph, the CLI tool will ask you for the following information:
6568

66-
- Protocol: Choose the protocol your subgraph will be indexing data from
69+
- Protocol: Choose the protocol your subgraph will be indexing data from.
6770
- Subgraph slug: Create a name for your subgraph. Your subgraph slug is an identifier for your subgraph.
68-
- Directory to create the subgraph in: Choose your local directory
69-
- Ethereum network(optional): You may need to specify which EVM-compatible network your subgraph will be indexing data from
70-
- Contract address: Locate the smart contract address you’d like to query data from
71-
- ABI: If the ABI is not auto-populated, you will need to input it manually as a JSON file
71+
- Directory to create the subgraph in: Choose your local directory.
72+
- Ethereum network (optional): You may need to specify which EVM-compatible network your subgraph will be indexing data from.
73+
- Contract address: Locate the smart contract address you’d like to query data from.
74+
- ABI: If the ABI is not auto-populated, you will need to input it manually as a JSON file.
7275
- Start Block: You should input the start block to optimize subgraph indexing of blockchain data. Locate the start block by finding the block where your contract was deployed.
73-
- Contract Name: Input the name of your contract
74-
- 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
75-
- Add another contract(optional): You can add another contract.
76+
- Contract Name: Input the name of your contract.
77+
- 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.
78+
- Add another contract (optional): You can add another contract.
7679

7780
See the following screenshot for an example for what to expect when initializing your subgraph:
7881

7982
![Subgraph command](/img/subgraph-init-example.png)
8083

81-
### 4. Write your subgraph
84+
### 4. Write Your Subgraph
8285

8386
The `init` command in the previous step creates a scaffold subgraph that you can use as a starting point to build your subgraph.
8487

8588
When making changes to the subgraph, you will mainly work with three files:
8689

87-
- Manifest (`subgraph.yaml`)- defines what datasources your subgraphs will index.
90+
- Manifest (`subgraph.yaml`) - defines what datasources your subgraphs will index.
8891
- Schema (`schema. graphql`) - defines what data you wish to retrieve from the subgraph.
8992
- AssemblyScript Mappings (`mapping.ts`) - translates data from your datasources to the entities defined in the schema.
9093

9194
For a detailed breakdown on how to write your subgraph, check out [Creating a Subgraph](/developing/creating-a-subgraph/).
9295

93-
### 5. Deploy to your subgraph
96+
### 5. Deploy Your Subgraph
9497

9598
Remember, deploying is not the same as publishing.
9699

97100
- When you deploy a subgraph, you push it to [Subgraph Studio](https://thegraph.com/studio/), where you can test, stage and review it.
98101
- When you publish a subgraph, you are publishing it onchain to the decentralized network.
99102

100-
1. Once your subgraph is written, run the following commands:
103+
1. Once your subgraph is written, run the following commands:
101104

102-
```sh
103-
$ graph codegen
104-
$ graph build
105-
```
105+
```sh
106+
graph codegen
107+
graph build
108+
```
106109

107-
2. Authenticate and deploy your subgraph. The deploy key can be found on the Subgraph page in Subgraph Studio.
110+
2. Authenticate and deploy your subgraph. The deploy key can be found on the Subgraph page in Subgraph Studio.
108111

109-
```sh
110-
$ graph auth --studio <DEPLOY_KEY>
111-
$ graph deploy --studio <SUBGRAPH_SLUG>
112-
```
112+
```sh
113+
graph auth --studio <DEPLOY_KEY>
114+
graph deploy --studio <SUBGRAPH_SLUG>
115+
```
113116

114117
- The CLI will ask for a version label.
115-
- It's strongly recommended to use [semver](https://semver.org/) for versioning like `0.0.1.` That said, you can choose any string as version such as: `v1, version1, asdf`.
118+
- It's strongly recommended to use [semantic versioning](https://semver.org/), e.g. `0.0.1`. That said, you can choose any string for the version such as: `v1, version1, asdf`, ect.
116119

117-
### 6. Review your subgraph
120+
### 6. Review Your Subgraph
118121

119122
If you’d like to examine your subgraph before publishing it to the network, you can use [Subgraph Studio](https://thegraph.com/studio/) to do the following:
120123

@@ -125,46 +128,56 @@ If you’d like to examine your subgraph before publishing it to the network, yo
125128

126129
![Subgraph logs](/img/subgraph-logs-image.png)
127130

128-
### 7. Publish Your Subgraph to The Graph
131+
### 7. Publish Your Subgraph to The Graph Network
129132

130-
Publishing a subgraph to the decentralized network makes it available for [Curators](/network/curating/) to begin curating it and [Indexers](/network/indexing/) to index it.
133+
Publishing a subgraph to the decentralized network makes it available for [Curators](/network/curating/) to begin curating it and [Indexers](/network/indexing/) to begin indexing it.
131134

132135
#### Publishing with Subgraph Studio
133136

134-
1. To publish your subgraph, click the publish button in the dashboard.
135-
2. Select the network to which you would like to publish your subgraph.
136-
- Subgraphs are published to Arbitrum One to take advantage of the [faster transaction speeds and lower gas costs](https://thegraph.com/docs/en/arbitrum/arbitrum-faq/).
137+
1. To publish your subgraph, click the Publish button in the dashboard.
138+
2. Select the network to which you would like to publish your subgraph.
137139

138140
#### Publishing from the CLI
139141

140-
As of version 0.73.0, you can also publish your subgraph with the [`graph-cli`](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli).
142+
As of version 0.73.0, you can also publish your subgraph with the Graph CLI.
143+
144+
1. Open the `graph-cli`.
145+
2. Use the following commands:
146+
147+
```sh
148+
graph codegen && graph build
149+
```
150+
151+
Then,
152+
153+
```sh
154+
graph publish
155+
```
141156

142-
1. Open the `graph-cli`.
143-
2. Use the following commands: `graph codegen && graph build` then `graph publish`.
144-
3. A window will open, allowing you to connect your wallet, add metadata, and deploy your finalized subgraph to a network of your choice.
157+
3. A window will open, allowing you to connect your wallet, add metadata, and deploy your finalized subgraph to a network of your choice.
145158

146159
![cli-ui](/img/cli-ui.png)
147160

148-
To customize your deployment see [publishing a subgraph](/publishing/publishing-a-subgraph/)
161+
To customize your deployment, see [Publishing a Subgraph](/publishing/publishing-a-subgraph/).
149162

150163
#### Adding signal to your subgraph
151164

152-
1. To attract indexers to query your subgraph, you should add GRT curation signal to it.
165+
1. To attract indexers to query your subgraph, you should add GRT curation signal to it.
153166

154-
- This action improves quality of service, reduces latency, and enhances network redundancy and availability for your subgraphs.
167+
- This action improves quality of service, reduces latency, and enhances network redundancy and availability for your subgraphs.
155168

156-
2. If eligible for indexing rewards, Indexers receive GRT rewards based on the signaled amount.
169+
2. If eligible for indexing rewards, Indexers receive GRT rewards based on the signaled amount.
157170

158-
- It’s recommended to curate at least 3,000 GRT to attract 3 Indexers. Check reward eligibility based on subgraph feature usage and supported networks.
171+
- It’s recommended to curate at least 3,000 GRT to attract 3 Indexers. Check reward eligibility based on subgraph feature usage and supported networks.
159172

160173
To learn more about curation, read [Curating](/network/curating/).
161174

162-
To save on gas costs, you can curate your subgraph in the same transaction you publish it by selecting this button:
175+
To save on gas costs, you can curate your subgraph in the same transaction you publish it by selecting this option:
163176

164177
![Subgraph publish](/img/publish-and-signal-tx.png)
165178

166179
### 8. Query Your Subgraph
167180

168-
Now, you can query your subgraph by sending GraphQL queries to your subgraph’s Query URL, which you can find by clicking the query button.
181+
Now, you can query your subgraph by sending GraphQL queries to your subgraph’s Query URL, which you can find by clicking the Query button.
169182

170183
For more information about querying data from your subgraph, read [Querying The Graph](/querying/querying-the-graph/).

0 commit comments

Comments
 (0)