diff --git a/website/pages/en/deploying/deploying-a-subgraph-to-hosted.mdx b/website/pages/en/deploying/deploying-a-subgraph-to-hosted.mdx index a5451a6b9804..116e8148b5a4 100644 --- a/website/pages/en/deploying/deploying-a-subgraph-to-hosted.mdx +++ b/website/pages/en/deploying/deploying-a-subgraph-to-hosted.mdx @@ -4,7 +4,7 @@ title: Deploying a Subgraph to the Hosted Service > 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). +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-tooling/tree/main/packages/cli). If you have not created a subgraph already, see [creating a subgraph](/developing/creating-a-subgraph). ## Create a hosted service account @@ -32,7 +32,7 @@ Before deploying the subgraph, you need to create it in The Graph Explorer. Go t **Hide** - Switching this on hides the subgraph in the Graph Explorer. -After saving the new subgraph, you are shown a screen with help on how to install the Graph CLI, how to generate the scaffolding for a new subgraph, and how to deploy your subgraph. The first two steps were covered in the [Defining a Subgraph section](/developing/defining-a-subgraph). +After saving the new subgraph, you are shown a screen with help on how to install the Graph CLI, how to generate the scaffolding for a new subgraph, and how to deploy your subgraph. The first two steps were covered in the [Creating a Subgraph section](/developing/creating-a-subgraph/). ## Deploy a Subgraph on the hosted service diff --git a/website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx b/website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx index 973f4d70fda0..65902f1bb587 100644 --- a/website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx +++ b/website/pages/en/deploying/deploying-a-subgraph-to-studio.mdx @@ -1,19 +1,19 @@ --- -title: Deploying a Subgraph to the Subgraph Studio +title: Deploying a Subgraph to Subgraph Studio --- > Learn how you can deploy non rate-limited subgraphs to Subgraph Studio [here](https://www.notion.so/edgeandnode/The-Graph-Subgraph-Studio-Non-Rate-Limited-Chain-Integration-889fe061ee6b4423a7f8e2c8070b9294). -These are the steps to deploy your subgraph to the Subgraph Studio: +These are the steps to deploy your subgraph to Subgraph Studio: - Install The Graph CLI (with either yarn or npm) -- Create your Subgraph in the Subgraph Studio +- Create your Subgraph in Subgraph Studio - Authenticate your account from the CLI -- Deploying a Subgraph to the Subgraph Studio +- Deploying a Subgraph to Subgraph Studio ## Installing Graph CLI -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. +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:** diff --git a/website/pages/en/deploying/hosted-service.mdx b/website/pages/en/deploying/hosted-service.mdx index efe8d21accda..66b9afac4645 100644 --- a/website/pages/en/deploying/hosted-service.mdx +++ b/website/pages/en/deploying/hosted-service.mdx @@ -12,13 +12,13 @@ For a comprehensive list, see [Supported Networks](/developing/supported-network ## Create a Subgraph -First follow the instructions [here](/developing/defining-a-subgraph) to install the Graph CLI. Create a subgraph by passing in `graph init --product hosted-service` +First follow the instructions [here](/developing/creating-a-subgraph/#install-the-graph-cli) to install the Graph CLI. Create a subgraph by passing in `graph init --product hosted-service` ### From an Existing Contract If you already have a smart contract deployed to your network of choice, bootstrapping a new subgraph from this contract can be a good way to get started on the hosted service. -You can use this command to create a subgraph that indexes all events from an existing contract. This will attempt to fetch the contract ABI from [Etherscan](https://etherscan.io/). +You can use this command to create a subgraph that indexes all events from an existing contract. This will attempt to fetch the contract ABI from the block explorer. ```sh graph init \ @@ -27,7 +27,7 @@ graph init \ / [] ``` -Additionally, you can use the following optional arguments. If the ABI cannot be fetched from Etherscan, it falls back to requesting a local file path. If any optional arguments are missing from the command, it takes you through an interactive form. +Additionally, you can use the following optional arguments. If the ABI cannot be fetched from the block explorer, it falls back to requesting a local file path. If any optional arguments are missing from the command, it takes you through an interactive form. ```sh --network \ diff --git a/website/pages/en/deploying/subgraph-studio-faqs.mdx b/website/pages/en/deploying/subgraph-studio-faqs.mdx index 65217d4b7741..b1ee6933c239 100644 --- a/website/pages/en/deploying/subgraph-studio-faqs.mdx +++ b/website/pages/en/deploying/subgraph-studio-faqs.mdx @@ -8,7 +8,7 @@ title: Subgraph Studio FAQs ## 2. How do I create an API Key? -To create an API, navigate to the Subgraph Studio and connect your wallet. You will be able to click the API keys tab at the top. There, you will be able to create an API key. +To create an API, navigate to Subgraph Studio and connect your wallet. You will be able to click the API keys tab at the top. There, you will be able to create an API key. ## 3. Can I create multiple API Keys? @@ -20,12 +20,12 @@ After creating an API Key, in the Security section, you can define the domains t ## 5. Can I transfer my subgraph to another owner? -Yes, subgraphs that have been published to Mainnet can be transferred to a new wallet or a Multisig. You can do so by clicking the three dots next to the 'Publish' button on the subgraph's details page and selecting 'Transfer ownership'. +Yes, subgraphs that have been published to Arbitrum One can be transferred to a new wallet or a Multisig. You can do so by clicking the three dots next to the 'Publish' button on the subgraph's details page and selecting 'Transfer ownership'. Note that you will no longer be able to see or edit the subgraph in Studio once it has been transferred. ## 6. How do I find query URLs for subgraphs if I’m not the developer of the subgraph I want to use? -You can find the query URL of each subgraph in the Subgraph Details section of The Graph Explorer. When you click on the “Query” button, you will be directed to a pane wherein you can view the query URL of the subgraph you’re interested in. You can then replace the `` placeholder with the API key you wish to leverage in the Subgraph Studio. +You can find the query URL of each subgraph in the Subgraph Details section of The Graph Explorer. When you click on the “Query” button, you will be directed to a pane wherein you can view the query URL of the subgraph you’re interested in. You can then replace the `` placeholder with the API key you wish to leverage in Subgraph Studio. Remember that you can create an API key and query any subgraph published to the network, even if you build a subgraph yourself. These queries via the new API key, are paid queries as any other on the network. diff --git a/website/pages/en/deploying/subgraph-studio.mdx b/website/pages/en/deploying/subgraph-studio.mdx index 5d6bcab25fd3..e803adea549f 100644 --- a/website/pages/en/deploying/subgraph-studio.mdx +++ b/website/pages/en/deploying/subgraph-studio.mdx @@ -1,12 +1,12 @@ --- -title: How to Use the Subgraph Studio +title: How to Use Subgraph Studio --- Welcome to your new launchpad 👩🏽‍🚀 -The Subgraph Studio is your place to build and create subgraphs, add metadata, and publish them to the new decentralized Explorer (more on that [here](/network/explorer)). +Subgraph Studio is your place to build and create subgraphs, add metadata, and publish them to the new decentralized Explorer (more on that [here](/network/explorer)). -What you can do in the Subgraph Studio: +What you can do in Subgraph Studio: - Create a subgraph through the Studio UI - Deploy a subgraph using the CLI @@ -15,7 +15,7 @@ What you can do in the Subgraph Studio: - Integrate it in staging using the query URL - Create and manage your API keys for specific subgraphs -Here in the Subgraph Studio, you have full control over your subgraphs. Not only can you test your subgraphs before you publish them, but you can also restrict your API keys to specific domains and only allow certain Indexers to query from their API keys. +Here in Subgraph Studio, you have full control over your subgraphs. Not only can you test your subgraphs before you publish them, but you can also restrict your API keys to specific domains and only allow certain Indexers to query from their API keys. Querying subgraphs generates query fees, used to reward [Indexers](/network/indexing) on the Graph network. If you’re a dapp developer or subgraph developer, the Studio will empower you to build better subgraphs to power your or your community’s queries. The Studio is comprised of 5 main parts: @@ -27,7 +27,7 @@ Querying subgraphs generates query fees, used to reward [Indexers](/network/inde ## How to Create Your Account -1. Sign in with your wallet - you can do this via MetaMask or WalletConnect +1. Sign in with your wallet - you can do this via MetaMask, WalletConnect, Coinbase Wallet or Safe. 1. Once you sign in, you will see your unique deploy key on your account home page. This will allow you to either publish your subgraphs or manage your API keys + billing. You will have a unique deploy key that can be re-generated if you think it has been compromised. ## How to Create a Subgraph in Subgraph Studio @@ -50,7 +50,7 @@ More features & networks will be added to The Graph Network incrementally. ![Subgraph Lifecycle](/img/subgraph-lifecycle.png) -After you have created your subgraph, you will be able to deploy it using the [CLI](https://github.com/graphprotocol/graph-cli), or command-line interface. Deploying a subgraph with the CLI will push the subgraph to the Studio where you’ll be able to test subgraphs using the playground. This will eventually allow you to publish to the Graph Network. For more information on CLI setup, [check this out](/developing/defining-a-subgraph#install-the-graph-cli) (pst, make sure you have your deploy key on hand). Remember, deploying is **not the same as** publishing. When you deploy a subgraph, you just push it to the Studio where you’re able to test it. Versus, when you publish a subgraph, you are publishing it on-chain. +After you have created your subgraph, you will be able to deploy it using the [CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli), or command-line interface. Deploying a subgraph with the CLI will push the subgraph to the Studio where you’ll be able to test subgraphs using the playground. This will eventually allow you to publish to the Graph Network. For more information on CLI setup, [check this out](/developing/defining-a-subgraph#install-the-graph-cli) (psst, make sure you have your deploy key on hand). Remember, deploying is **not the same as** publishing. When you deploy a subgraph, you just push it to the Studio where you’re able to test it. Versus, when you publish a subgraph, you are publishing it on-chain. ## Testing your Subgraph in Subgraph Studio @@ -60,13 +60,13 @@ If you’d like to test your subgraph before publishing it to the network, you c You’ve made it this far - congrats! -In order to publish your subgraph successfully, you’ll need to go through the following steps outlined in this [blog](https://thegraph.com/blog/building-with-subgraph-studio). +In order to publish your subgraph successfully, you’ll need to go through the following steps outlined in this [section](/publishing/publishing-a-subgraph/). Check out the video overview below as well: -Remember, while you’re going through your publishing flow, you’ll be able to push to either mainnet or Goerli. If you’re a first-time subgraph developer, we highly suggest you start with publishing to Goerli, which is free to do. This will allow you to see how the subgraph will work in The Graph Explorer and will allow you to test curation elements. +Remember, while you’re going through your publishing flow, you’ll be able to push to either Arbitrum One or Arbitrum Sepolia. If you’re a first-time subgraph developer, we highly suggest you start with publishing to Arbitrum Sepolia, which is free to do. This will allow you to see how the subgraph will work in The Graph Explorer and will allow you to test curation elements. Indexers need to submit mandatory Proof of Indexing records as of a specific block hash. Because publishing a subgraph is an action taken on-chain, remember that the transaction can take up to a few minutes to go through. Any address you use to publish the contract will be the only one able to publish future versions. Choose wisely! @@ -84,6 +84,6 @@ Please note that there are costs associated with publishing a new version of a s ### Automatic Archiving of Subgraph Versions -Whenever you deploy a new subgraph version in the Subgraph Studio, the previous version will be archived. Archived versions won't be indexed/synced and therefore cannot be queried. You can unarchive an archived version of your subgraph in the Studio UI. Please note that previous versions of non-published subgraphs deployed to the Studio will be automatically archived. +Whenever you deploy a new subgraph version in Subgraph Studio, the previous version will be archived. Archived versions won't be indexed/synced and therefore cannot be queried. You can unarchive an archived version of your subgraph in the Studio UI. Please note that previous versions of non-published subgraphs deployed to the Studio will be automatically archived. ![Subgraph Studio - Unarchive](/img/Unarchive.png) diff --git a/website/pages/en/developing/creating-a-subgraph.mdx b/website/pages/en/developing/creating-a-subgraph.mdx index 838c80fbde83..354ab361292a 100644 --- a/website/pages/en/developing/creating-a-subgraph.mdx +++ b/website/pages/en/developing/creating-a-subgraph.mdx @@ -14,9 +14,9 @@ The subgraph definition consists of a few files: - `AssemblyScript Mappings`: [AssemblyScript](https://github.com/AssemblyScript/assemblyscript) code that translates from the event data to the entities defined in your schema (e.g. `mapping.ts` in this tutorial) -> In order to use your subgraph on The Graph's decentralized network, you will need to [create an API key](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key). It is recommended that you [add signal](/network/curating/#how-to-signal) to your subgraph with at least [3,000 GRT](/network-transition-faq/#how-can-i-ensure-that-my-subgraph-will-be-picked-up-by-indexer-on-the-graph-network). +> In order to use your subgraph on The Graph's decentralized network, you will need to [create an API key](/deploying/subgraph-studio-faqs/#2-how-do-i-create-an-api-key). It is recommended that you [add signal](/network/curating/#how-to-signal) to your subgraph with at least [3,000 GRT](/sunrise/#how-can-i-ensure-high-quality-of-service-and-redundancy-for-subgraphs-on-the-graph-network). -Before you go into detail about the contents of the manifest file, you need to install the [Graph CLI](https://github.com/graphprotocol/graph-cli) which you will need to build and deploy a subgraph. +Before you go into detail about the contents of the manifest file, you need to install the [Graph CLI](https://github.com/graphprotocol/graph-tooling) which you will need to build and deploy a subgraph. ## Install the Graph CLI @@ -61,7 +61,7 @@ The second mode `graph init` supports is creating a new project from an example graph init --studio ``` -The example subgraph is based on the Gravity contract by Dani Grant that manages user avatars and emits `NewGravatar` or `UpdateGravatar` events whenever avatars are created or updated. The subgraph handles these events by writing `Gravatar` entities to the Graph Node store and ensuring these are updated according to the events. The following sections will go over the files that make up the subgraph manifest for this example. +The [example subgraph](https://github.com/graphprotocol/example-subgraph) is based on the Gravity contract by Dani Grant that manages user avatars and emits `NewGravatar` or `UpdateGravatar` events whenever avatars are created or updated. The subgraph handles these events by writing `Gravatar` entities to the Graph Node store and ensuring these are updated according to the events. The following sections will go over the files that make up the subgraph manifest for this example. ## Add New dataSources To An Existing Subgraph @@ -146,7 +146,7 @@ dataSources: The important entries to update for the manifest are: -- `description`: a human-readable description of what the subgraph is. This description is displayed by the Graph Explorer when the subgraph is deployed to the hosted service. +- `description`: a human-readable description of what the subgraph is. This description is displayed by the Graph Explorer when the subgraph is deployed to Subgraph Studio. - `repository`: the URL of the repository where the subgraph manifest can be found. This is also displayed by The Graph Explorer. @@ -550,7 +550,7 @@ let id = Bytes.fromI32(dayID) `const id = Bytes.fromHexString('0xdead...beef')` -There is a [Graph Typescript Library](https://github.com/graphprotocol/graph-ts) which contains utilities for interacting with the Graph Node store and conveniences for handling smart contract data and entities. It can be imported into `mapping.ts` from `@graphprotocol/graph-ts`. +There is a [Graph Typescript Library](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts) which contains utilities for interacting with the Graph Node store and conveniences for handling smart contract data and entities. It can be imported into `mapping.ts` from `@graphprotocol/graph-ts`. ### Handling of entities with identical IDs @@ -1091,7 +1091,7 @@ File data sources are a new subgraph functionality for accessing off-chain data Rather than fetching files "in line" during handler exectuion, this introduces templates which can be spawned as new data sources for a given file identifier. These new data sources fetch the files, retrying if they are unsuccessful, running a dedicated handler when the file is found. -This is similar to the [existing data source templates](https://thegraph.com/docs/en/developing/creating-a-subgraph/#data-source-templates), which are used to dynamically create new chain-based data sources. +This is similar to the [existing data source templates](/developing/creating-a-subgraph/#data-source-templates), which are used to dynamically create new chain-based data sources. > This replaces the existing `ipfs.cat` API @@ -1148,7 +1148,7 @@ type TokenMetadata @entity { If the relationship is 1:1 between the parent entity and the resulting file data source entity, the simplest pattern is to link the parent entity to a resulting file entity by using the IPFS CID as the lookup. Get in touch on Discord if you are having difficulty modelling your new file-based entities! -> You can use [nested filters](https://thegraph.com/docs/en/querying/graphql-api/#example-for-nested-entity-filtering) to filter parent entities on the basis of these nested entities. +> You can use [nested filters](/querying/graphql-api/#example-for-nested-entity-filtering) to filter parent entities on the basis of these nested entities. #### Add a new templated data source with `kind: file/ipfs` or `kind: file/arweave` @@ -1172,11 +1172,11 @@ templates: > Currently `abis` are required, though it is not possible to call contracts from within file data sources -The file data source must specifically mention all the entity types which it will interact with under `entities`. See [limitations](#Limitations) for more details. +The file data source must specifically mention all the entity types which it will interact with under `entities`. See [limitations](#limitations) for more details. #### Create a new handler to process files -This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](https://thegraph.com/docs/en/developing/assemblyscript-api/#json-api)). +This handler should accept one `Bytes` parameter, which will be the contents of the file, when it is found, which can then be processed. This will often be a JSON file, which can be processed with `graph-ts` helpers ([documentation](/developing/assemblyscript-api/#json-api)). The CID of the file as a readable string can be accessed via the `dataSource` as follows: @@ -1220,7 +1220,7 @@ You can now create file data sources during execution of chain-based handlers: For IPFS, Graph Node supports [v0 and v1 content identifiers](https://docs.ipfs.tech/concepts/content-addressing/), and content identifers with directories (e.g. `bafyreighykzv2we26wfrbzkcdw37sbrby4upq7ae3aqobbq7i4er3tnxci/metadata.json`). -For Arweave, as of version 0.33.0 Graph Node can fetch files stored on Arweave based on their [transaction ID](https://docs.arweave.org/developers/server/http-api#transactions) from an Arweave gateway ([example file](https://bdxujjl5ev5eerd5ouhhs6o4kjrs4g6hqstzlci5pf6vhxezkgaa.arweave.net/CO9EpX0lekJEfXUOeXncUmMuG8eEp5WJHXl9U9yZUYA)). Arweave supports transactions uploaded via Bundlr, and Graph Node can also fetch files based on [Bundlr manifests](https://docs.bundlr.network/learn/gateways#indexing). +For Arweave, as of version 0.33.0 Graph Node can fetch files stored on Arweave based on their [transaction ID](https://docs.arweave.org/developers/arweave-node-server/http-api#transactions) from an Arweave gateway ([example file](https://bdxujjl5ev5eerd5ouhhs6o4kjrs4g6hqstzlci5pf6vhxezkgaa.arweave.net/CO9EpX0lekJEfXUOeXncUmMuG8eEp5WJHXl9U9yZUYA)). Arweave supports transactions uploaded via Irys (previously Bundlr), and Graph Node can also fetch files based on [Irys manifests](https://docs.irys.xyz/overview/gateways#indexing). Example: @@ -1279,7 +1279,7 @@ Additionally, it is not possible to create data sources from a file data source, If you are linking NFT metadata to corresponding tokens, use the metadata's IPFS hash to reference a Metadata entity from the Token entity. Save the Metadata entity using the IPFS hash as an ID. -You can use [DataSource context](https://thegraph.com/docs/en/developing/assemblyscript-api/#entity-and-data-source-context) when creating File Data Sources to pass extra information which will be available to the File Data Source handler. +You can use [DataSource context](/developing/graph-ts/api/#entity-and-datasourcecontext) when creating File Data Sources to pass extra information which will be available to the File Data Source handler. If you have entities which are refreshed multiple times, create unique file-based entities using the IPFS hash & the entity ID, and reference them using a derived field in the chain-based entity. @@ -1289,7 +1289,7 @@ If you have entities which are refreshed multiple times, create unique file-base File data sources currently require ABIs, even though ABIs are not used ([issue](https://github.com/graphprotocol/graph-cli/issues/961)). Workaround is to add any ABI. -Handlers for File Data Sources cannot be in files which import `eth_call` contract bindings, failing with "unknown import: `ethereum::ethereum.call` has not been defined" ([issue](https://github.com/graphprotocol/graph-cli/issues/4309)). Workaround is to create file data source handlers in a dedicated file. +Handlers for File Data Sources cannot be in files which import `eth_call` contract bindings, failing with "unknown import: `ethereum::ethereum.call` has not been defined" ([issue](https://github.com/graphprotocol/graph-node/issues/4309)). Workaround is to create file data source handlers in a dedicated file. #### Examples diff --git a/website/pages/en/developing/developer-faqs.mdx b/website/pages/en/developing/developer-faqs.mdx index 0f24bba7beb3..b62378b17ccc 100644 --- a/website/pages/en/developing/developer-faqs.mdx +++ b/website/pages/en/developing/developer-faqs.mdx @@ -46,7 +46,7 @@ docker pull graphprotocol/graph-node:latest ## 9. How do I call a contract function or access a public state variable from my subgraph mappings? -Take a look at `Access to smart contract` state inside the section [AssemblyScript API](/developing/assemblyscript-api). +Take a look at `Access to smart contract` state inside the section [AssemblyScript API](/developing/graph-ts/api/#access-to-smart-contract-state). ## 10. Is it possible to set up a subgraph using `graph init` from `graph-cli` with two contracts? Or should I manually add another datasource in `subgraph.yaml` after running `graph init`? @@ -88,7 +88,7 @@ Not currently, as mappings are written in AssemblyScript. One possible alternati ## 17. Is it possible to specify what block to start indexing on? -Yes. `dataSources.source.startBlock` in the `subgraph.yaml` file specifies the number of the block that the data source starts indexing from. In most cases, we suggest using the block in which the contract was created: Start blocks +Yes. `dataSources.source.startBlock` in the `subgraph.yaml` file specifies the number of the block that the data source starts indexing from. In most cases, we suggest using the block in which the contract was created: [Start blocks](/developing/creating-a-subgraph#start-blocks) ## 18. Are there some tips to increase the performance of indexing? My subgraph is taking a very long time to sync diff --git a/website/pages/en/developing/graph-ts/api.mdx b/website/pages/en/developing/graph-ts/api.mdx index a03c22f0004c..329844dafcc5 100644 --- a/website/pages/en/developing/graph-ts/api.mdx +++ b/website/pages/en/developing/graph-ts/api.mdx @@ -6,7 +6,7 @@ title: AssemblyScript API This page documents what built-in APIs can be used when writing subgraph mappings. Two kinds of APIs are available out of the box: -- the [Graph TypeScript library](https://github.com/graphprotocol/graph-tooling) (`graph-ts`) and +- the [Graph TypeScript library](https://github.com/graphprotocol/graph-tooling/tree/main/packages/ts) (`graph-ts`) and - code generated from subgraph files by `graph codegen`. It is also possible to add other libraries as dependencies, as long as they are compatible with [AssemblyScript](https://github.com/AssemblyScript/assemblyscript). Since this is the language mappings are written in, the [AssemblyScript wiki](https://github.com/AssemblyScript/assemblyscript/wiki) is a good source for language and standard library features. @@ -40,7 +40,7 @@ The `apiVersion` in the subgraph manifest specifies the mapping API version whic ### Built-in Types -Documentation on the base types built into AssemblyScript can be found in the [AssemblyScript wiki](https://github.com/AssemblyScript/assemblyscript/wiki/Types). +Documentation on the base types built into AssemblyScript can be found in the [AssemblyScript wiki](https://www.assemblyscript.org/types.html). The following additional types are provided by `@graphprotocol/graph-ts`. @@ -79,7 +79,7 @@ import { BigDecimal } from '@graphprotocol/graph-ts' `BigDecimal` is used to represent arbitrary precision decimals. -> Note: [Internally](https://github.com/graphprotocol/graph-node/blob/master/graph/src/data/store/scalar.rs) `BigDecimal` is stored in [IEEE-754 decimal128 floating-point format](https://en.wikipedia.org/wiki/Decimal128_floating-point_format), which supports 34 decimal digits of significand. This makes `BigDecimal` unsuitable for representing fixed-point types that can span wider than 34 digits, such as a Solidity [`ufixed256x18`](https://docs.soliditylang.org/en/latest/types.html#fixed-point-numbers) or equivalent. +> Note: [Internally](https://github.com/graphprotocol/graph-node/blob/master/graph/src/data/store/scalar/bigdecimal.rs) `BigDecimal` is stored in [IEEE-754 decimal128 floating-point format](https://en.wikipedia.org/wiki/Decimal128_floating-point_format), which supports 34 decimal digits of significand. This makes `BigDecimal` unsuitable for representing fixed-point types that can span wider than 34 digits, such as a Solidity [`ufixed256x18`](https://docs.soliditylang.org/en/latest/types.html#fixed-point-numbers) or equivalent. _Construction_ @@ -215,7 +215,7 @@ import { store } from '@graphprotocol/graph-ts' The `store` API allows to load, save and remove entities from and to the Graph Node store. -Entities written to the store map one-to-one to the `@entity` types defined in the subgraph's GraphQL schema. To make working with these entities convenient, the `graph codegen` command provided by the [Graph CLI](https://github.com/graphprotocol/graph-cli) generates entity classes, which are subclasses of the built-in `Entity` type, with property getters and setters for the fields in the schema as well as methods to load and save these entities. +Entities written to the store map one-to-one to the `@entity` types defined in the subgraph's GraphQL schema. To make working with these entities convenient, the `graph codegen` command provided by the [Graph CLI](https://github.com/graphprotocol/graph-tooling/tree/main/packages/cli) generates entity classes, which are subclasses of the built-in `Entity` type, with property getters and setters for the fields in the schema as well as methods to load and save these entities. #### Creating entities @@ -536,17 +536,6 @@ For more information: - Encoding/decoding [Rust library/CLI](https://github.com/rust-ethereum/ethabi) - More [complex example](https://github.com/graphprotocol/graph-node/blob/6a7806cc465949ebb9e5b8269eeb763857797efc/tests/integration-tests/host-exports/src/mapping.ts#L72). -#### Balance of an Address - -The balance of an address can be retrieved using the `ethereum` module. This feature is available from `apiVersion: 0.0.9` defined `subgraph.yaml`. The `getBalance()` retrieves the balance of the specified address from the block currently being processed within the subgraph. - -```typescript -import { ethereum } from '@graphprotocol/graph-ts' - -let address = Address.fromString('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045') -let balance = ethereum.getBalance(address) // returns balance in BigInt -``` - ### Logging API ```typescript diff --git a/website/pages/en/developing/substreams-powered-subgraphs-faq.mdx b/website/pages/en/developing/substreams-powered-subgraphs-faq.mdx index 02592fd21457..734cc376e81b 100644 --- a/website/pages/en/developing/substreams-powered-subgraphs-faq.mdx +++ b/website/pages/en/developing/substreams-powered-subgraphs-faq.mdx @@ -4,7 +4,7 @@ title: Substreams-powered subgraphs FAQ ## What are Substreams? -Developed by [StreamingFast](https://www.streamingfast.io/), Substreams is an exceptionally powerful processing engine capable of consuming rich streams of blockchain data. Substreams allow you to refine and shape blockchain data for fast and seamless digestion by end-user applications. More specifically, Substreams is a blockchain-agnostic, parallelized, and streaming-first engine, serving as a blockchain data transformation layer. Powered by the [Firehose](https://firehose.streamingfast.io/), it ​​enables developers to write Rust modules, build upon community modules, provide extremely high-performance indexing, and [sink](https://substreams.streamingfast.io/developers-guide/sink-targets) their data anywhere. +Developed by [StreamingFast](https://www.streamingfast.io/), Substreams is an exceptionally powerful processing engine capable of consuming rich streams of blockchain data. Substreams allow you to refine and shape blockchain data for fast and seamless digestion by end-user applications. More specifically, Substreams is a blockchain-agnostic, parallelized, and streaming-first engine, serving as a blockchain data transformation layer. Powered by the [Firehose](https://firehose.streamingfast.io/), it ​​enables developers to write Rust modules, build upon community modules, provide extremely high-performance indexing, and [sink](https://substreams.streamingfast.io/reference-and-specs/manifests#sink) their data anywhere. Go to the [Substreams Documentation](/substreams) to learn more about Substreams. @@ -22,7 +22,7 @@ By contrast, substreams-powered subgraphs have a single datasource which referen ## What are the benefits of using Substreams-powered subgraphs? -Substreams-powered subgraphs combine all the benefits of Substreams with the queryability of subgraphs. They bring greater composability and high-performance indexing to The Graph. They also enable new data use cases; for example, once you've built your Substreams-powered Subgraph, you can reuse your [Substreams modules](https://substreams.streamingfast.io/developers-guide/modules) to output to different [sinks](https://substreams.streamingfast.io/developers-guide/sink-targets) such as PostgreSQL, MongoDB, and Kafka. +Substreams-powered subgraphs combine all the benefits of Substreams with the queryability of subgraphs. They bring greater composability and high-performance indexing to The Graph. They also enable new data use cases; for example, once you've built your Substreams-powered Subgraph, you can reuse your [Substreams modules](https://substreams.streamingfast.io/documentation/develop/manifest-modules) to output to different [sinks](https://substreams.streamingfast.io/reference-and-specs/manifests#sink) such as PostgreSQL, MongoDB, and Kafka. ## What are the benefits of Substreams? @@ -70,7 +70,7 @@ The [Substreams-powered subgraphs documentation](/cookbook/substreams-powered-su Rust modules are the equivalent of the AssemblyScript mappers in subgraphs. They are compiled to WASM in a similar way, but the programming model allows for parallel execution. They define the sort of transformations and aggregations you want to apply to the raw blockchain data. -See [modules documentation](https://substreams.streamingfast.io/developers-guide/modules) for details. +See [modules documentation](https://substreams.streamingfast.io/documentation/develop/manifest-modules) for details. ## What makes Substreams composable? diff --git a/website/pages/en/publishing/publishing-a-subgraph.mdx b/website/pages/en/publishing/publishing-a-subgraph.mdx index 6119c2ad2e0a..a26843378c9e 100644 --- a/website/pages/en/publishing/publishing-a-subgraph.mdx +++ b/website/pages/en/publishing/publishing-a-subgraph.mdx @@ -2,7 +2,7 @@ title: Publishing a Subgraph to the Decentralized Network --- -Once your subgraph has been [deployed to the Subgraph Studio](/deploying/deploying-a-subgraph-to-studio), you have tested it out, and are ready to put it into production, you can then publish it to the decentralized network. +Once your subgraph has been [deployed to Subgraph Studio](/deploying/deploying-a-subgraph-to-studio), you have tested it out, and are ready to put it into production, you can then publish it to the decentralized network. Publishing a Subgraph to the decentralized network makes it available for [Curators](/network/curating) to begin curating on it, and [Indexers](/network/indexing) to begin indexing it. @@ -12,7 +12,7 @@ You can find the list of the supported networks [Here](/developing/supported-net ## Publishing a subgraph -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 the decentralized network directly from Subgraph Studio dashboard by clicking on the **Publish** button. Once a subgraph is published, it will be available to view in [Graph Explorer](https://thegraph.com/explorer/). - Subgraphs can be published to Arbitrum One. [Learn more about The Graph Network on Arbitrum](/arbitrum/arbitrum-faq). @@ -38,4 +38,4 @@ Alternatively, you can add GRT signal to a published subgraph from Graph Explore ## 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. +Once your subgraph has been published to the decentralized network, you can modify the metadata at any time by making the update in Subgraph Studio dashboard of the subgraph. After saving the changes and publishing your updates to the network, they will be reflected in Graph Explorer. This won’t create a new version, as your deployment hasn’t changed.