Skip to content

Commit 08da7cb

Browse files
authored
docs: update links for graph tooling repo (#4303)
docs: update links for graph tooling repo dependabot: weekly yarn.lock upgrade rebuild lockfile update lockfiles fixes
1 parent 6120a53 commit 08da7cb

File tree

33 files changed

+2655
-1092
lines changed

33 files changed

+2655
-1092
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
version: 2
22
updates:
3+
4+
- package-ecosystem: npm
5+
directory: tests/integration-tests
6+
schedule:
7+
interval: weekly
8+
open-pull-requests-limit: 10
9+
allow:
10+
# We always want to test against the latest Graph CLI tooling: `graph-cli`,
11+
# `graph-ts`.
12+
- dependency-name: "@graphprotocol/graph-*"
13+
versioning-strategy: lockfile-only
14+
315
- package-ecosystem: cargo
416
directory: "/"
517
schedule:

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ jobs:
102102
uses: actions/checkout@v2
103103
- uses: Swatinem/rust-cache@v2
104104

105-
- name: Install Node 14
105+
- name: Install Node 16
106106
uses: actions/setup-node@v3
107107
with:
108-
node-version: "14"
108+
node-version: "16"
109109
cache: yarn
110110
cache-dependency-path: "tests/integration-tests/yarn.lock"
111111

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ can access these via:
5959
- `postgresql://graph-node:let-me-in@localhost:5432/graph-node`
6060

6161
Once this is up and running, you can use
62-
[`graph-cli`](https://github.com/graphprotocol/graph-cli) to create and
62+
[`graph-cli`](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) to create and
6363
deploy your subgraph to the running Graph Node.
6464

6565
### Running Graph Node on an Macbook M1

docs/getting-started.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The high-level dataflow for a dApp using The Graph is as follows:
4343
### 0.3 What's Needed to Build a Graph Node?
4444
Three repositories are relevant to building on The Graph:
4545
1. [Graph Node](../README.md) – A server implementation for indexing, caching, and serving queries against data from Ethereum.
46-
2. [Graph CLI](https://github.com/graphprotocol/graph-cli) – A CLI for building and compiling projects that are deployed to the Graph Node.
46+
2. [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) – A CLI for building and compiling projects that are deployed to the Graph Node.
4747
3. [Graph TypeScript Library](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts) – TypeScript/AssemblyScript library for writing subgraph mappings to be deployed to The Graph.
4848

4949
### 0.4 Getting Started Overview
@@ -182,9 +182,9 @@ schema:
182182
```
183183

184184
### 1.3 Create a Subgraph Project and Generate Types
185-
Once you have the `subgraph.yaml` manifest and the `./schema.graphql` file, you are ready to use the Graph CLI to set up the subgraph directory. The Graph CLI is a command-line tool that contains helpful commands for deploying the subgraphs. Before continuing with this guide, please go to the [Graph CLI README](https://github.com/graphprotocol/graph-cli/) and follow the instructions up to Step 7 for setting up the subgraph directory.
185+
Once you have the `subgraph.yaml` manifest and the `./schema.graphql` file, you are ready to use the Graph CLI to set up the subgraph directory. The Graph CLI is a command-line tool that contains helpful commands for deploying the subgraphs. Before continuing with this guide, please go to the [Graph CLI README](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) and follow the instructions up to Step 7 for setting up the subgraph directory.
186186

187-
Once you run `yarn codegen` as outlined in the [Graph CLI README](https://github.com/graphprotocol/graph-cli/), you are ready to create the mappings.
187+
Once you run `yarn codegen` as outlined in the [Graph CLI README](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli), you are ready to create the mappings.
188188

189189
`yarn codegen` looks at the contract ABIs defined in the subgraph manifest and generates TypeScript classes for the smart contracts the mappings script will interface with, which includes the types of public methods and events. In reality, the classes are AssemblyScript but more on that later.
190190

@@ -228,7 +228,7 @@ export function handleTransfer(event: Transfer): void {
228228
```
229229
A few things to note from this code:
230230
* We create a new entity named `token`, which is stored in the Graph Node database.
231-
* We create an ID for that token, which must be unique, and then create an entity with `new Token(tokenID)`. We get the token ID from the event emitted by Ethereum, which was turned into an AssemblyScript type by the [Graph TypeScript Library](https://github.com/graphprotocol/graph-ts). We access it at `event.params.tokenId`. Note that you must set `ID` as a string and call `toHex()` on the `tokenID` to turn it into a hex string.
231+
* We create an ID for that token, which must be unique, and then create an entity with `new Token(tokenID)`. We get the token ID from the event emitted by Ethereum, which was turned into an AssemblyScript type by the [Graph TypeScript Library](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts). We access it at `event.params.tokenId`. Note that you must set `ID` as a string and call `toHex()` on the `tokenID` to turn it into a hex string.
232232
* This entity is updated by the `Transfer` event emitted by the ERC721 contract.
233233
* The current owner is gathered from the event with `event.params.to`. It is set as an Address by the Token class.
234234
* Event handlers functions always return `void`.
@@ -252,7 +252,7 @@ The definition for `<entity>.load()` is:
252252
entity.load() // Entity is representative of the entity type being updated. In our example above, it is Token.
253253
```
254254

255-
Once again, all these functions come from the [Graph TypeScript Library](https://github.com/graphprotocol/graph-ts).
255+
Once again, all these functions come from the [Graph TypeScript Library](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts).
256256

257257
Let's look at the ERC721 token as an example for using `token.load()`. Above, we showed how to use `token.save()`. Now, let's consider that you have another event handler that needs to retrieve the currentOwner of an ERC721 token. To do this within an event handler, you would write the following:
258258

@@ -407,7 +407,7 @@ If you want to sync using a public testnet such as Kovan, Rinkeby, or Ropsten, j
407407

408408
When you deploy the subgraph to the Graph Node, it will start ingesting all the subgraph events from the blockchain, transforming that data with the subgraph mappings and storing it in the Graph Node. Note that a running subgraph can safely be stopped and restarted, picking up where it left off.
409409

410-
Now that the infrastructure is set up, you can run `yarn create-subgraph` and then `yarn deploy` in the subgraph directory. These commands should have been added to `package.json` in section 1.3 when we took a moment to go through the set up for [Graph CLI documentation](https://github.com/graphprotocol/graph-cli). This builds the subgraph and creates the WASM files in the `dist/` folder. Next, it uploads the `dist/
410+
Now that the infrastructure is set up, you can run `yarn create-subgraph` and then `yarn deploy` in the subgraph directory. These commands should have been added to `package.json` in section 1.3 when we took a moment to go through the set up for [Graph CLI documentation](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli). This builds the subgraph and creates the WASM files in the `dist/` folder. Next, it uploads the `dist/
411411
` files to IPFS and deploys it to the Graph Node. The subgraph is now fully running.
412412
413413
The `watch` flag allows the subgraph to continually restart every time you save an update to the `manifest`, `schema`, or `mappings`. If you are making many edits or have a subgraph that has been syncing for a few hours, leave this flag off.

docs/implementation/add-chain.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -256,22 +256,22 @@ Just like in the `server` crate, you'll just have to handle the new `BlockchainK
256256

257257
## What else?
258258

259-
Besides making `graph-node` support the new chain, [graph-cli](https://github.com/graphprotocol/graph-cli) and [graph-ts](https://github.com/graphprotocol/graph-ts) should also include the new types and enable the new functionality so that subgraph developers can use it.
259+
Besides making `graph-node` support the new chain, [graph-cli](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) and [graph-ts](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts) should also include the new types and enable the new functionality so that subgraph developers can use it.
260260

261261
For now this document doesn't include how to do that integration, here are a few PRs that might help you with that:
262262

263263
- NEAR
264264
- `graph-cli`
265-
- https://github.com/graphprotocol/graph-cli/pull/760
266-
- https://github.com/graphprotocol/graph-cli/pull/783
265+
- https://github.com/graphprotocol/graph-tooling/pull/760
266+
- https://github.com/graphprotocol/graph-tooling/pull/783
267267
- `graph-ts`
268268
- https://github.com/graphprotocol/graph-ts/pull/210
269269
- https://github.com/graphprotocol/graph-ts/pull/217
270270
- Cosmos
271271
- `graph-cli`
272-
- https://github.com/graphprotocol/graph-cli/pull/827
273-
- https://github.com/graphprotocol/graph-cli/pull/851
274-
- https://github.com/graphprotocol/graph-cli/pull/888
272+
- https://github.com/graphprotocol/graph-tooling/pull/827
273+
- https://github.com/graphprotocol/graph-tooling/pull/851
274+
- https://github.com/graphprotocol/graph-toolingpull/888
275275
- `graph-ts`
276276
- https://github.com/graphprotocol/graph-ts/pull/250
277277
- https://github.com/graphprotocol/graph-ts/pull/273

docs/subgraph-manifest.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Any data format that has a well-defined 1:1 mapping with the [IPLD Canonical For
3434
| --- | --- | --- |
3535
| **kind** | *String | The type of data source. Possible values: *ethereum/contract*.|
3636
| **name** | *String* | The name of the source data. Will be used to generate APIs in the mapping and also for self-documentation purposes. |
37-
| **network** | *String* | For blockchains, this describes which network the subgraph targets. For Ethereum, this can be any of "mainnet", "rinkeby", "kovan", "ropsten", "goerli", "poa-core", "poa-sokol", "xdai", "matic", "mumbai", "fantom", "bsc" or "clover". Developers could look for an up to date list in the graph-cli [*code*](https://github.com/graphprotocol/graph-cli/blob/main/packages/cli/src/protocols/index.js#L70-L107).|
37+
| **network** | *String* | For blockchains, this describes which network the subgraph targets. For Ethereum, this can be any of "mainnet", "rinkeby", "kovan", "ropsten", "goerli", "poa-core", "poa-sokol", "xdai", "matic", "mumbai", "fantom", "bsc" or "clover". Developers could look for an up to date list in the graph-cli [*code*](https://github.com/graphprotocol/graph-tooling/blob/main/packages/cli/src/protocols/index.ts#L76-L117).|
3838
| **source** | [*EthereumContractSource*](#151-ethereumcontractsource) | The source data on a blockchain such as Ethereum. |
3939
| **mapping** | [*Mapping*](#152-mapping) | The transformation logic applied to the data prior to being indexed. |
4040

runtime/test/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Runtime tests
22

3-
These are the unit tests that check if the WASM runtime code is working. For now we only run code compiled from the [`AssemblyScript`](https://www.assemblyscript.org/) language, which is done by [`asc`](https://github.com/AssemblyScript/assemblyscript) (the AssemblyScript Compiler) in our [`CLI`](https://github.com/graphprotocol/graph-cli).
3+
These are the unit tests that check if the WASM runtime code is working. For now we only run code compiled from the [`AssemblyScript`](https://www.assemblyscript.org/) language, which is done by [`asc`](https://github.com/AssemblyScript/assemblyscript) (the AssemblyScript Compiler) in our [`CLI`](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli).
44

55
We support two versions of their compiler/language for now:
66

tests/integration-tests/api-version-v0-0-4/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"create:test": "graph create test/api-version-v0-0-4 --node $GRAPH_NODE_ADMIN_URI",
99
"deploy:test": "graph deploy test/api-version-v0-0-4 --version-label v0.0.1 --ipfs $IPFS_URI --node $GRAPH_NODE_ADMIN_URI"
1010
},
11+
"note": "Do not update the dependencies below - we want to make sure it's backward comaptible, so we are using an old CLI version on purpose.",
1112
"devDependencies": {
1213
"@graphprotocol/graph-cli": "https://github.com/graphprotocol/graph-cli#v0.21.1",
1314
"@graphprotocol/graph-ts": "https://github.com/graphprotocol/graph-ts#v0.21.1",

tests/integration-tests/ganache-reverts/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"deploy:test": "graph deploy test/ganache-reverts --version-label v0.0.1 --ipfs $IPFS_URI --node $GRAPH_NODE_ADMIN_URI"
1010
},
1111
"devDependencies": {
12-
"@graphprotocol/graph-cli": "https://github.com/graphprotocol/graph-cli#main",
13-
"@graphprotocol/graph-ts": "https://github.com/graphprotocol/graph-ts#main",
12+
"@graphprotocol/graph-cli": "0.50.0",
13+
"@graphprotocol/graph-ts": "0.30.0",
1414
"solc": "^0.8.2"
1515
},
1616
"dependencies": {

tests/integration-tests/ganache-reverts/subgraph.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
specVersion: 0.0.2
1+
specVersion: 0.0.4
22
schema:
33
file: ./schema.graphql
44
dataSources:
@@ -10,7 +10,7 @@ dataSources:
1010
abi: Contract
1111
mapping:
1212
kind: ethereum/events
13-
apiVersion: 0.0.5
13+
apiVersion: 0.0.6
1414
language: wasm/assemblyscript
1515
abis:
1616
- name: Contract

0 commit comments

Comments
 (0)