From c98678eb3e95490032391ab3fcafc55407aadbc1 Mon Sep 17 00:00:00 2001 From: Idalith Bustos Date: Wed, 4 Dec 2024 16:30:26 -0800 Subject: [PATCH 1/2] re-org --- website/pages/en/network/developing.mdx | 61 +------------------------ website/pages/en/subgraphs.mdx | 51 +++++++++++++++++++-- 2 files changed, 49 insertions(+), 63 deletions(-) diff --git a/website/pages/en/network/developing.mdx b/website/pages/en/network/developing.mdx index 8c77b59c5c34..6ba33f6d916c 100644 --- a/website/pages/en/network/developing.mdx +++ b/website/pages/en/network/developing.mdx @@ -23,67 +23,8 @@ On The Graph, you can: - Create custom subgraphs to fulfill specific data needs, allowing improved scalability and flexibility for other developers. - Deploy, publish and signal your subgraphs within The Graph Network. -## Subgraph Specifics - ### What are subgraphs? A subgraph is a custom API built on blockchain data. It extracts data from a blockchain, processes it, and stores it so that it can be easily queried via GraphQL. -A subgraph primarily consists of the following files: - -- `subgraph.yaml`: this YAML file contains the [subgraph manifest](/developing/creating-a-subgraph/#the-subgraph-manifest). -- `subgraph.graphql`: this GraphQL schema defines what data is stored for your subgraph, and how to query it via [GraphQL](/developing/creating-a-subgraph/#the-graphql-schema). -- `mappings`: this [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) mappings file translates data from the event data to the entities defined in your schema. - -Learn the detailed specifics to [create a subgraph](/developing/creating-a-subgraph/). - -## Subgraph Lifecycle - -Here is a general overview of a subgraph’s lifecycle: - -![Subgraph Lifecycle](/img/subgraph-lifecycle.png) - -### Build locally - -Great subgraphs start with a local development environment and unit tests. Developers use [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli), a command-line interface tool for building and deploying subgraphs on The Graph. They can also use [Graph TypeScript](/developing/graph-ts/) and [Matchstick](/developing/unit-testing-framework/) to create robust subgraphs. - -### Deploy to Subgraph Studio - -Once defined, a subgraph can be [deployed to Subgraph Studio](/deploying/deploying-a-subgraph-to-studio/). In Subgraph Studio, you can do the following: - -- Use its staging environment to index the deployed subgraph and make it available for review. -- Verify that your subgraph doesn't have any indexing errors and works as expected. - -### Publish to the Network - -When you're happy with your subgraph, you can [publish it](/publishing/publishing-a-subgraph/) to The Graph Network. - -- This is an on-chain action, which registers the subgraph and makes it discoverable by Indexers. -- Published subgraphs have a corresponding NFT, which defines the ownership of the subgraph. You can [transfer the subgraph's ownership](/managing/transfer-a-subgraph/) by sending the NFT. -- Published subgraphs have associated metadata, which provides other network participants with useful context and information. - -### Add Curation Signal for Indexing - -Published subgraphs are unlikely to be picked up by Indexers without curation signal. To encourage indexing you should add signal to your subgraph. Learn more about signaling and [curating](/network/curating/) on The Graph. - -#### What is signal? - -- Signal is locked GRT associated with a given subgraph. It indicates to Indexers that a given subgraph will receive query volume and it contributes to the indexing rewards available for processing it. -- Third party Curators may also signal on a given subgraph, if they deem the subgraph likely to drive query volume. - -### Querying & Application Development - -Subgraphs on The Graph Network receive 100,000 free queries per month, after which point developers can either [pay for queries with GRT or a credit card](/billing/). - -Learn more about [querying subgraphs](/querying/querying-the-graph/). - -### Updating Subgraphs - -To update your subgraph with bug fixes or new functionalities, initiate a transaction to point it to the new version. You can deploy new versions of your subgraphs to [Subgraph Studio](https://thegraph.com/studio/) for development and testing. - -- If you selected "auto-migrate" when you applied the signal, updating the subgraph will migrate any signal to the new version and incur a migration tax. -- This signal migration should prompt Indexers to start indexing the new version of the subgraph, so it should soon become available for querying. - -### Deleting & Transferring Subgraphs - -If you no longer need a published subgraph, you can [delete](/managing/delete-a-subgraph/) or [transfer](/managing/transfer-a-subgraph/) it. Deleting a subgraph returns any signaled GRT to [Curators](/network/curating/). +Check out the documentation on [subgraphs](/subgraphs/) to learn specifics. diff --git a/website/pages/en/subgraphs.mdx b/website/pages/en/subgraphs.mdx index 698de7622d41..aa5560d87e5f 100644 --- a/website/pages/en/subgraphs.mdx +++ b/website/pages/en/subgraphs.mdx @@ -26,6 +26,12 @@ The **subgraph definition** consists of the following files: To learn more about each subgraph component, check out [creating a subgraph](/developing/creating-a-subgraph/). +## Subgraph Lifecycle + +Here is a general overview of a subgraph’s lifecycle: + +![Subgraph Lifecycle](/img/subgraph-lifecycle.png) + ## Subgraph Development 1. [Create a subgraph](/developing/creating-a-subgraph/) @@ -34,8 +40,47 @@ To learn more about each subgraph component, check out [creating a subgraph](/de 4. [Publish a subgraph](/publishing/publishing-a-subgraph/) 5. [Signal on a subgraph](/publishing/publishing-a-subgraph/#adding-signal-to-your-subgraph) -## Subgraph Lifecycle +### Build locally -Here is a general overview of a subgraph’s lifecycle: +Great subgraphs start with a local development environment and unit tests. Developers use [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli), a command-line interface tool for building and deploying subgraphs on The Graph. They can also use [Graph TypeScript](/developing/graph-ts/) and [Matchstick](/developing/unit-testing-framework/) to create robust subgraphs. -![Subgraph Lifecycle](/img/subgraph-lifecycle.png) +### Deploy to Subgraph Studio + +Once defined, a subgraph can be [deployed to Subgraph Studio](/deploying/deploying-a-subgraph-to-studio/). In Subgraph Studio, you can do the following: + +- Use its staging environment to index the deployed subgraph and make it available for review. +- Verify that your subgraph doesn't have any indexing errors and works as expected. + +### Publish to the Network + +When you're happy with your subgraph, you can [publish it](/publishing/publishing-a-subgraph/) to The Graph Network. + +- This is an on-chain action, which registers the subgraph and makes it discoverable by Indexers. +- Published subgraphs have a corresponding NFT, which defines the ownership of the subgraph. You can [transfer the subgraph's ownership](/managing/transfer-a-subgraph/) by sending the NFT. +- Published subgraphs have associated metadata, which provides other network participants with useful context and information. + +### Add Curation Signal for Indexing + +Published subgraphs are unlikely to be picked up by Indexers without curation signal. To encourage indexing you should add signal to your subgraph. Learn more about signaling and [curating](/network/curating/) on The Graph. + +#### What is signal? + +- Signal is locked GRT associated with a given subgraph. It indicates to Indexers that a given subgraph will receive query volume and it contributes to the indexing rewards available for processing it. +- Third party Curators may also signal on a given subgraph, if they deem the subgraph likely to drive query volume. + +### Querying & Application Development + +Subgraphs on The Graph Network receive 100,000 free queries per month, after which point developers can either [pay for queries with GRT or a credit card](/billing/). + +Learn more about [querying subgraphs](/querying/querying-the-graph/). + +### Updating Subgraphs + +To update your subgraph with bug fixes or new functionalities, initiate a transaction to point it to the new version. You can deploy new versions of your subgraphs to [Subgraph Studio](https://thegraph.com/studio/) for development and testing. + +- If you selected "auto-migrate" when you applied the signal, updating the subgraph will migrate any signal to the new version and incur a migration tax. +- This signal migration should prompt Indexers to start indexing the new version of the subgraph, so it should soon become available for querying. + +### Deleting & Transferring Subgraphs + +If you no longer need a published subgraph, you can [delete](/managing/delete-a-subgraph/) or [transfer](/managing/transfer-a-subgraph/) it. Deleting a subgraph returns any signaled GRT to [Curators](/network/curating/). From 37b44cd31001b9fd3ae27226e6d8cee53924bc54 Mon Sep 17 00:00:00 2001 From: Idalith <126833353+idalithb@users.noreply.github.com> Date: Thu, 5 Dec 2024 13:44:47 -0800 Subject: [PATCH 2/2] Update website/pages/en/subgraphs.mdx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Benoît Rouleau --- website/pages/en/subgraphs.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/pages/en/subgraphs.mdx b/website/pages/en/subgraphs.mdx index aa5560d87e5f..42c1e806f822 100644 --- a/website/pages/en/subgraphs.mdx +++ b/website/pages/en/subgraphs.mdx @@ -66,7 +66,7 @@ Published subgraphs are unlikely to be picked up by Indexers without curation si #### What is signal? - Signal is locked GRT associated with a given subgraph. It indicates to Indexers that a given subgraph will receive query volume and it contributes to the indexing rewards available for processing it. -- Third party Curators may also signal on a given subgraph, if they deem the subgraph likely to drive query volume. +- Third-party Curators may also signal on a given subgraph, if they deem the subgraph likely to drive query volume. ### Querying & Application Development