Skip to content

Commit

Permalink
Sunbeam updates (#629)
Browse files Browse the repository at this point in the history
* 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
4 people authored Apr 11, 2024
1 parent 3a18ace commit 617314c
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 124 deletions.
10 changes: 5 additions & 5 deletions website/pages/en/cookbook/arweave.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Building Subgraphs on Arweave
---

> Arweave support in Graph Node and on the hosted service is in beta: please reach us on [Discord](https://discord.gg/graphprotocol) with any questions about building Arweave subgraphs!
> Arweave support in Graph Node and on the Subgraph Studio is in beta: please reach us on [Discord](https://discord.gg/graphprotocol) with any questions about building Arweave subgraphs!
In this guide, you will learn how to build and deploy Subgraphs to index the Arweave blockchain.

Expand Down Expand Up @@ -83,7 +83,7 @@ dataSources:
```
- Arweave subgraphs introduce a new kind of data source (`arweave`)
- The network should correspond to a network on the hosting Graph Node. On the hosted service, Arweave's mainnet is `arweave-mainnet`
- The network should correspond to a network on the hosting Graph Node. in Subgraph Studio, Arweave's mainnet is `arweave-mainnet`
- Arweave data sources introduce an optional source.owner field, which is the public key of an Arweave wallet

Arweave data sources support two types of handlers:
Expand Down Expand Up @@ -150,12 +150,12 @@ Block handlers receive a `Block`, while transactions receive a `Transaction`.

Writing the mappings of an Arweave Subgraph is very similar to writing the mappings of an Ethereum Subgraph. For more information, click [here](/developing/creating-a-subgraph/#writing-mappings).

## Deploying an Arweave Subgraph on the hosted service
## Deploying an Arweave Subgraph in Subgraph Studio

Once your subgraph has been created on the hosted service dashboard, you can deploy by using the `graph deploy` CLI command.
Once your subgraph has been created on your Subgraph Studio dashboard, you can deploy by using the `graph deploy` CLI command.

```bash
graph deploy --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ --access-token <your-access-token>
graph deploy --studio --access-token <your-access-token>
```

## Querying an Arweave Subgraph
Expand Down
12 changes: 5 additions & 7 deletions website/pages/en/cookbook/cosmos.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -196,16 +196,14 @@ $ graph build

## Deploying a Cosmos subgraph

Once your subgraph has been created, you can deploy your subgraph by using the `graph deploy` CLI command after running the `graph create` CLI command:
Once your subgraph has been created, you can deploy your subgraph by using the `graph deploy` CLI command:

**Hosted Service**
**Subgraph Studio**

```bash
graph create account/subgraph-name --product hosted-service
```
Visit the Subgraph Studio to create a new subgraph.

```bash
graph deploy account/subgraph-name --product hosted-service
graph deploy --studio subgraph-name
```

**Local Graph Node (based on default configuration):**
Expand Down Expand Up @@ -236,7 +234,7 @@ Cosmos Hub mainnet is `cosmoshub-4`. Cosmos Hub current testnet is `theta-testne

### Osmosis

> Osmosis support in Graph Node and on the Hosted Service is in beta: please contact the graph team with any questions about building Osmosis subgraphs!
> Osmosis support in Graph Node and on Subgraph Studio is in beta: please contact the graph team with any questions about building Osmosis subgraphs!

#### What is Osmosis?

Expand Down
2 changes: 1 addition & 1 deletion website/pages/en/cookbook/grafting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In this tutorial, we will be covering a basic usecase. We will replace an existi

## Important Note on Grafting When Upgrading to the Network

> **Caution**: if you are upgrading your subgraph from Subgraph Studio or the hosted service to the decentralized network, it is strongly recommended to avoid using grafting during the upgrade process.
> **Caution**: It is recommended to not use grafting for subgraphs published to The Graph Network
### Why Is This Important?

Expand Down
21 changes: 10 additions & 11 deletions website/pages/en/cookbook/near.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions website/pages/en/cookbook/upgrading-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ More information about the nature of the network and how to handle re-orgs are d

If you would like to update an existing subgraph on the network, you can do this by deploying a new version of your subgraph to Subgraph Studio using the Graph CLI.

1. Make changes to your current subgraph. A good idea is to test small fixes on Subgraph Studio by publishing to Goerli.
1. Make changes to your current subgraph.
2. Deploy the following and specify the new version in the command (eg. v0.0.1, v0.0.2, etc):

```sh
graph deploy --studio <SUBGRAPH_SLUG>
graph deploy --studio --version <version> <SUBGRAPH_SLUG>
```

3. Test the new version in Subgraph Studio by querying in the playground
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Deploying a Subgraph to the Hosted Service
---

> If a network is not supported on the hosted service, you can run your own [graph-node](https://github.com/graphprotocol/graph-node) to index it.
> Hosted service endpoints will be deprecated on June 12th 2024. [Learn more](/sunrise).
This page explains how to deploy a subgraph to the hosted service. To deploy a subgraph you need to first install the [Graph CLI](https://github.com/graphprotocol/graph-cli). If you have not created a subgraph already, see [creating a subgraph](/developing/creating-a-subgraph).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ These are the steps to deploy your subgraph to the Subgraph Studio:

## Installing Graph CLI

We are using the same CLI to deploy subgraphs to our [hosted service](https://thegraph.com/hosted-service/) and to the [Subgraph Studio](https://thegraph.com/studio/). Here are the commands to install graph-cli. This can be done using npm or yarn.
There is a CLI to deploy subgraphs to [Subgraph Studio](https://thegraph.com/studio/). Here are the commands to install graph-cli. This can be done using npm or yarn.

**Install with yarn:**

Expand Down
4 changes: 2 additions & 2 deletions website/pages/en/deploying/hosted-service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: What is the Hosted Service?
---

> Please note, the hosted service will begin sunsetting in 2023, but it will remain available to networks that are not supported on the decentralized network. Developers are encouraged to [upgrade their subgraphs to The Graph Network](/cookbook/upgrading-a-subgraph) as more networks are supported. Each network will have their hosted service equivalents gradually sunset to ensure developers have enough time to upgrade subgraphs to the decentralized network. Read more about the sunsetting of the hosted service [here](https://thegraph.com/blog/sunsetting-hosted-service).
> Please note, hosted service endpoints will be deprecated on June 12th 2024 as all subgraphs will need to upgrade to The Graph Network. Please read more in the [Sunrise FAQ](/sunrise)
This section will walk you through deploying a subgraph to the [hosted service](https://thegraph.com/hosted-service/).

Expand Down Expand Up @@ -59,4 +59,4 @@ graph init \

## Supported Networks on the hosted service

You can find the list of the supported networks [Here](/developing/supported-networks).
You can find the list of the supported networks [here](/developing/supported-networks).
2 changes: 1 addition & 1 deletion website/pages/en/deploying/subgraph-studio.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Querying subgraphs generates query fees, used to reward [Indexers](/network/inde

## Subgraph Compatibility with The Graph Network

The Graph Network is not yet able to support all of the data-sources & features available on the hosted service. In order to be supported by Indexers on the network, subgraphs must:
In order to be supported by Indexers on The Graph Network, subgraphs must:

- Index a [supported network](/developing/supported-networks)
- Must not use any of the following features:
Expand Down
4 changes: 3 additions & 1 deletion website/pages/en/glossary.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ title: Glossary

- **Indexer's Self Stake**: The amount of GRT that Indexers stake to participate in the decentralized network. The minimum is 100,000 GRT, and there is no upper limit.

- **Upgrade Indexer**: A temporary Indexer designed to act as a fallback for subgraph queries not serviced by other Indexers on the network. It ensures a seamless transition for subgraphs upgrading from the hosted service by readily serving their queries upon being published. The upgrade Indexer is not competitive with other Indexers. It supports numerous blockchains that were previously only available on the hosted service.
- **Upgrade Indexer**: A temporary Indexer designed to act as a fallback for subgraph queries not serviced by other Indexers on the network. It ensures a seamless transition for subgraphs upgrading from the hosted service to The Graph Network. The upgrade Indexer is not competitive with other Indexers. It supports numerous blockchains that were previously only available on the hosted service.

- **Delegators**: Network participants who own GRT and delegate their GRT to Indexers. This allows Indexers to increase their stake in subgraphs on the network. In return, Delegators receive a portion of the Indexing Rewards that Indexers receive for processing subgraphs.

Expand Down Expand Up @@ -83,3 +83,5 @@ title: Glossary
- **_Updating_ a subgraph**: The process of releasing a new subgraph version with updates to the subgraph's manifest, schema, or mappings.

- **Migrating**: The process of curation shares moving from an old version of a subgraph to a new version of a subgraph (e.g. when v0.0.1 is updated to v0.0.2).

- **Upgrade Window**: The countdown for hosted service users to upgrade their subgraph(s) to The Graph Network beginning on April 11th, and ending on June 12th 2024.
16 changes: 12 additions & 4 deletions website/pages/en/publishing/publishing-a-subgraph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,28 @@ You can find the list of the supported networks [Here](/developing/supported-net

Subgraphs can be published to the decentralized network directly from the Subgraph Studio dashboard by clicking on the **Publish** button. Once a subgraph is published, it will be available to view in the [Graph Explorer](https://thegraph.com/explorer/).

- Subgraphs can be published to Goerli, Arbitrum goerli, Arbitrum One, or Ethereum mainnet.
- Subgraphs can be published to Arbitrum One. [Learn more about The Graph Network on Arbitrum](/arbitrum/arbitrum-faq).

- Regardless of the network the subgraph was published on, it can index data on any of the [supported networks](/developing/supported-networks).

- When publishing a new version for an existing subgraph the same rules apply as above.

## Curating your subgraph
## Adding signal to your subgraph

> It is recommended that you curate your own subgraph with at least 3,000 GRT to ensure that it is indexed and available for querying as soon as possible.
Developers can add GRT signal to their subgraphs. If a subgraph is eligible for indexing rewards, Indexers who provide a "proof of indexing" will receive a GRT reward, based on the amount of GRT signalled. You can check indexing reward eligibility based on subgraph feature usage [here](https://github.com/graphprotocol/indexer/blob/main/docs/feature-support-matrix.md). Specifically supported networks can be checked [here](/developing/supported-networks).

Subgraph Studio enables you to be the first to curate your subgraph by adding GRT to your subgraph's curation pool in the same transaction. When publishing your subgraph, make sure to check the button that says, "Be the first to signal on this subgraph."
> Adding signal to a subgraph which is not eligible for rewards will not attract additional Indexers.
> If your subgraph is eligible for rewards, is recommended that you curate your own subgraph with at least 3,000 GRT (as of April 11th, 2024) in order to attract additional indexers to index your subgraph
Subgraph Studio enables you to to add signal to your subgraph by adding GRT to your subgraph's curation pool in the same transaction it is published.

![Curation Pool](/img/curate-own-subgraph-tx.png)

Alternatively, you can add GRT signal to a published subgraph from Graph Explorer.

![Signal from Explorer](/img/signal-from-explorer.png)

## Updating metadata for a published subgraph

Once your subgraph has been published to the decentralized network, you can modify the metadata at any time by making the update in the Subgraph Studio dashboard of the subgraph. After saving the changes and publishing your updates to the network, they will be reflected in The Graph Explorer. This won’t create a new version, as your deployment hasn’t changed.
1 change: 0 additions & 1 deletion website/pages/en/querying/_meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ export default {
'querying-from-an-application': '',
'distributed-systems': '',
'graphql-api': '',
'querying-the-hosted-service': '',
'querying-by-subgraph-id-vs-deployment-id': '',
'graph-client': 'Graph Client',
'querying-with-no-code': '',
Expand Down
27 changes: 6 additions & 21 deletions website/pages/en/querying/querying-the-graph.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,16 @@
title: Querying The Graph
---

With the subgraph deployed, visit the [Graph Explorer](https://thegraph.com/explorer) to open up a [GraphiQL](https://github.com/graphql/graphiql) interface where you can explore the deployed GraphQL API for the subgraph by issuing queries and viewing the schema.
When a subgraph is published to The Graph Network, you can visit its subgraph details page on [Graph Explorer](https://thegraph.com/explorer) and use the "Playground" tab to explore the deployed GraphQL API for the subgraph, issuing queries and viewing the schema.

An example is provided below, but please see the [Query API](/querying/graphql-api) for a complete reference on how to query the subgraph's entities.
> Please see the [Query API](/querying/graphql-api) for a complete reference on how to query the subgraph's entities. You can learn about GraphQL querying best practices [here](/querying/querying-best-practices)
## Example

This query lists all the counters our mapping has created. Since we only create one, the result will only contain our one `default-counter`:

```graphql
{
counters {
id
value
}
}
```

## Using The Graph Explorer

Each subgraph published to the decentralized Graph Explorer has a unique query URL that you can find by navigating to the subgraph details page and clicking on the "Query" button on the top right corner. This will open a side pane that will give you the unique query URL of the subgraph as well as some instructions about how to query it.
Each subgraph published to The Graph Network has a unique query URL in Graph Explorer for making direct queries that you can find by navigating to the subgraph details page and clicking on the "Query" button on the top right corner.

![Query Subgraph Pane](/img/query-subgraph-pane.png)

As you can notice, this query URL must use a unique API key. You can create and manage your API keys in the [Subgraph Studio](https://thegraph.com/studio) in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).
Learn more about querying from an application [here](/querying/querying-from-an-application).

Querying subgraphs using your API keys will generate query fees that will be paid in GRT. You can learn more about billing [here](/billing).
As you can notice, this query URL must use a unique API key. You can create and manage your API keys in [Subgraph Studio](https://thegraph.com/studio), in the "API Keys" section. Learn more about how to use Subgraph Studio [here](/deploying/subgraph-studio).

You can also use the GraphQL playground in the "Playground" tab to query a subgraph within The Graph Explorer.
Subgraph Studio users start on a Free Plan, which allows them to make 100,000 queries per month. Additional queries are available on the Growth Plan, which offers usage based pricing for additional queries, payable by credit card, or GRT on Arbitrum. You can learn more about billing [here](/billing).
28 changes: 0 additions & 28 deletions website/pages/en/querying/querying-the-hosted-service.mdx

This file was deleted.

Loading

0 comments on commit 617314c

Please sign in to comment.