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: docs/getting-started.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ To answer this question, you need to process all [`Birth` events](https://github
22
22
23
23
Even for this relatively simple question, it would take hours or even days for a dApp running in a browser to find an answer. Indexing and caching data off blockchains is hard. There are also edge cases around finality, chain reorganizations, uncled blocks, etc., which make it even more difficult to display deterministic data to the end user.
24
24
25
-
The Graph solves this issue by providing an open source node implementation, [Graph Node](../README.md), which handles indexing and caching of blockchain data. The entire community can contribute to and utilize this tool. In the current implemention, it exposes functionality through a GraphQL API for end users.
25
+
The Graph solves this issue by providing an open source node implementation, [Graph Node](../README.md), which handles indexing and caching of blockchain data. The entire community can contribute to and utilize this tool. In the current implementation, it exposes functionality through a GraphQL API for end users.
26
26
27
27
### 0.2 How Does It Work?
28
28
@@ -123,7 +123,7 @@ The ABI JSON file must contain the correct ABI to source all the events or any c
123
123
* If you are building a subgraph for a public project, you can download that project to your computer and generate the ABI by using [`truffle compile`](https://truffleframework.com/docs/truffle/overview) or `solc` to compile. This creates the ABI files that you can then transfer to your subgraph `/abi` folder.
124
124
* Sometimes, you can also find the ABI on [Etherscan](https://etherscan.io), but this is not always reliable because the uploaded ABI may be out of date. Make sure you have the correct ABI. Otherwise, you will not be able to start a Graph Node.
125
125
126
-
If you run into trouble here, doublecheck the ABI and ensure that the event signatures exist *exactly* as you expect them by examining the smart contract code you are sourcing. Also, note with the ABI, you only need the array for the ABI. Compiling the contracts locally results in a `.json` file that contains the complete ABI nested within the `.json` file under the key `abi`.
126
+
If you run into trouble here, double-check the ABI and ensure that the event signatures exist *exactly* as you expect them by examining the smart contract code you are sourcing. Also, note with the ABI, you only need the array for the ABI. Compiling the contracts locally results in a `.json` file that contains the complete ABI nested within the `.json` file under the key `abi`.
127
127
128
128
An example `abi` for the `Transfer` event is shown below and would be stored in the `/abi` folder with the name `ERC721ABI.json`:
129
129
@@ -238,15 +238,15 @@ A few things to note from this code:
238
238
239
239
The only way that entities may be added to The Graph is by calling `<entity>.save()`, which may be called multiple times in an event handler. `<entity>.save()` will only set the entity attributes that have explicitly been set on the `entity`. Attributes that are not explicitly set or are unset by calling `Entity.unset(<attribute>)` will not be overwritten. This means you can safely update one field of an entity and not worry about overwriting other fields not referenced in the mapping.
240
240
241
-
The definitiion for `<entity>.save()` is:
241
+
The definition for `<entity>.save()` is:
242
242
243
243
```typescript
244
244
entity.save() // Entity is representative of the entity type being updated. In our example above, it is Token.
245
245
```
246
246
247
247
`<entity>.load()` expects the entity type and ID of the entity. Use `<entity>.load()` to retrieve information previously added with `<entity>.save()`.
248
248
249
-
The definitiion for `<entity>.load()` is:
249
+
The definition for `<entity>.load()` is:
250
250
251
251
```typescript
252
252
entity.load() // Entity is representative of the entity type being updated. In our example above, it is Token.
@@ -315,7 +315,7 @@ createdb <POSTGRES_DB_NAME>
315
315
```
316
316
Name the database something relevant to the project so that you always know how to access it.
317
317
318
-
### 2.3 Start the Graph Node and Connect to an Etheruem Node
318
+
### 2.3 Start the Graph Node and Connect to an Ethereum Node
319
319
320
320
When you start the Graph Node, you need to specify which Ethereum network it should connect to. There are three common ways to do this:
0 commit comments