Publishing a Subgraph to the Decentralized Network
Reading time: 3 min
Once you have and it's ready to go into production, you can publish it to the decentralized network.
When you publish a subgraph to the decentralized network, you make it available for:
All published versions of an existing subgraph can:
- After publishing your subgraph to the decentralized network, you can update the metadata anytime in Subgraph Studio.
- Once you’ve saved your changes and published the updates, they will appear in Graph Explorer.
- It's important to note that this process will not create a new version since your deployment has not changed.
As of version 0.73.0, you can also publish your subgraph with the .
- Open the
graph-cli
. - Use the following commands:
graph codegen && graph build
thengraph publish
. - A window will open, allowing you to connect your wallet, add metadata, and deploy your finalized subgraph to a network of your choice.
You can upload your subgraph build to a specific IPFS node and further customize your deployment with the following flags:
USAGE$ graph publish [SUBGRAPH-MANIFEST] [-h] [--protocol-network arbitrum-one|arbitrum-sepolia --subgraph-id <value>] [-i <value>] [--ipfs-hash <value>] [--webapp-url<value>]FLAGS-h, --help Show CLI help.-i, --ipfs=<value> [default: https://api.thegraph.com/ipfs/api/v0] Upload build results to an IPFS node.--ipfs-hash=<value> IPFS hash of the subgraph manifest to deploy.--protocol-network=<option> [default: arbitrum-one] The network to use for the subgraph deployment.<options: arbitrum-one|arbitrum-sepolia>--subgraph-id=<value> Subgraph ID to publish to.--webapp-url=<value> [default: https://cli.thegraph.com/publish] URL of the web UI you want to use to deploy.
Developers can add GRT signal to their subgraphs to incentivize Indexers to query the subgraph.
-
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 .
Adding signal to a subgraph which is not eligible for rewards will not attract additional Indexers.
If your subgraph is eligible for rewards, it is recommended that you curate your own subgraph with at least 3,000 GRT in order to attract additional indexers to index your subgraph.
The ensures the indexing of all subgraphs. However, signaling GRT on a particular subgraph will draw more indexers to it. This incentivization of additional Indexers through curation aims to enhance the quality of service for queries by reducing latency and enhancing network availability.
When signaling, Curators can decide to signal on a specific version of the subgraph or to signal using auto-migrate. If they signal using auto-migrate, a curator’s shares will always be updated to the latest version published by the developer. If they decide to signal on a specific version instead, shares will always stay on this specific version.
Indexers can find subgraphs to index based on curation signals they see in Graph Explorer.
Subgraph Studio enables you to add signal to your subgraph by adding GRT to your subgraph's curation pool in the same transaction it is published.
Alternatively, you can add GRT signal to a published subgraph from Graph Explorer.