-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Editing * Date placeholders * update cookbooks to use subgraph studio * remove querying-the-hosted-service * simplify placeholder * update upgrading and publishing guides * add note to hosted service deployment page * update querying page * update faq * linting * capital I Co-authored-by: Benoît Rouleau <[email protected]> * Simon's feedback * Update website/pages/en/querying/querying-the-graph.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/publishing/publishing-a-subgraph.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/publishing/publishing-a-subgraph.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/deploying/hosted-service.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/cookbook/near.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/cookbook/near.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Update website/pages/en/cookbook/near.mdx Co-authored-by: Benoît Rouleau <[email protected]> * Subgraph studio fix * final tweaks * Adding dates * Adding year --------- Co-authored-by: azf20 <[email protected]> Co-authored-by: Adam Fuller <[email protected]> Co-authored-by: Benoît Rouleau <[email protected]>
- Loading branch information
1 parent
3a18ace
commit 617314c
Showing
18 changed files
with
141 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,6 @@ | |
title: Building Subgraphs on NEAR | ||
--- | ||
|
||
> NEAR support in Graph Node and on the Hosted Service is in beta: please contact [email protected] with any questions about building NEAR subgraphs! | ||
This guide is an introduction to building subgraphs indexing smart contracts on the [NEAR blockchain](https://docs.near.org/). | ||
|
||
## What is NEAR? | ||
|
@@ -73,7 +71,7 @@ dataSources: | |
``` | ||
- NEAR subgraphs introduce a new `kind` of data source (`near`) | ||
- The `network` should correspond to a network on the hosting Graph Node. On the Hosted Service, NEAR's mainnet is `near-mainnet`, and NEAR's testnet is `near-testnet` | ||
- The `network` should correspond to a network on the hosting Graph Node. On Subgraph Studio, NEAR's mainnet is `near-mainnet`, and NEAR's testnet is `near-testnet` | ||
- NEAR data sources introduce an optional `source.account` field, which is a human-readable ID corresponding to a [NEAR account](https://docs.near.org/docs/concepts/account). This can be an account or a sub-account. | ||
- NEAR data sources introduce an alternative optional `source.accounts` field, which contains optional suffixes and prefixes. At least prefix or suffix must be specified, they will match the any account starting or ending with the list of values respectively. The example below would match: `[app|good].*[morning.near|morning.testnet]`. If only a list of prefixes or suffixes is necessary the other field can be omitted. | ||
|
||
|
@@ -175,34 +173,35 @@ This includes a new JSON parsing function - logs on NEAR are frequently emitted | |
|
||
Once you have a built subgraph, it is time to deploy it to Graph Node for indexing. NEAR subgraphs can be deployed to any Graph Node `>=v0.26.x` (this version has not yet been tagged & released). | ||
|
||
The Graph's Hosted Service currently supports indexing NEAR mainnet and testnet in beta, with the following network names: | ||
Subgraph Studio and the upgrade Indexer on The Graph Network currently supports indexing NEAR mainnet and testnet in beta, with the following network names: | ||
|
||
- `near-mainnet` | ||
- `near-testnet` | ||
|
||
More information on creating and deploying subgraphs on the Hosted Service can be found [here](/deploying/deploying-a-subgraph-to-hosted). | ||
More information on creating and deploying subgraphs on Subgraph Studio can be found [here](/deploying/deploying-a-subgraph-to-studio). | ||
|
||
As a quick primer - the first step is to "create" your subgraph - this only needs to be done once. On the Hosted Service, this can be done from [your Dashboard](https://thegraph.com/hosted-service/dashboard): "Add Subgraph". | ||
As a quick primer - the first step is to "create" your subgraph - this only needs to be done once. On Subgraph Studio, this can be done from [your Dashboard](https://thegraph.com/studio/): "Create a subgraph". | ||
|
||
Once your subgraph has been created, you can deploy your subgraph by using the `graph deploy` CLI command: | ||
|
||
```sh | ||
$ graph create --node <graph-node-url> subgraph/name # creates a subgraph on a local Graph Node (on the Hosted Service, this is done via the UI) | ||
$ graph deploy --node <graph-node-url> --ipfs https://api.thegraph.com/ipfs/ # uploads the build files to a specified IPFS endpoint, and then deploys the subgraph to a specified Graph Node based on the manifest IPFS hash | ||
$ graph create --node <graph-node-url> <subgraph-name> # creates a subgraph on a local Graph Node (on Subgraph Studio, this is done via the UI) | ||
$ graph deploy --node <graph-node-url> --ipfs https://api.thegraph.com/ipfs/ <subgraph-name> # uploads the build files to a specified IPFS endpoint, and then deploys the subgraph to a specified Graph Node based on the manifest IPFS hash | ||
``` | ||
|
||
The node configuration will depend on where the subgraph is being deployed. | ||
|
||
### Hosted Service | ||
### Subgraph Studio | ||
|
||
```sh | ||
graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token <your-access-token> | ||
graph auth --studio | ||
graph deploy --studio <subgraph-name> | ||
``` | ||
|
||
### Local Graph Node (based on default configuration) | ||
|
||
```sh | ||
graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 | ||
graph deploy --node http://localhost:8020/ --ipfs http://localhost:5001 <subgraph-name> | ||
``` | ||
|
||
Once your subgraph has been deployed, it will be indexed by Graph Node. You can check its progress by querying the subgraph itself: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.