📡Subgraph CLI Cheat sheet
Streamlined Guide: Deploying Mantle Subgraphs with The Graph CLI
Last updated
Streamlined Guide: Deploying Mantle Subgraphs with The Graph CLI
Last updated
Summary: This cheat sheet condenses essential commands, tips, and best practices into an indispensable reference for anyone deploying a subgraph. Developers will find this streamlined guide invaluable for swiftly progressing through the deployment workflow and resolving frequent pain points. With key information consolidated in one place, engineers can deploy subgraphs more efficiently and focus their efforts on building applications powered by real-time, customizable blockchain data indexes.
For developers who are already familiar with Graph Protocol tooling, below are the network definitions to deploy subgraphs on Mantle. These settings can be configured in the subgraph.yaml
file:
For Mantle Andromeda Mainnet:
For Mantle Goerli Testnet:
For Mantle Sepolia Testnet:
Download the Graph Cli to cli
Create an API key at https://subgraph.mantle.xyz/dashboard/api
Authenticate using the Graph Cli and API key.
Note: You need to specify the Mantle deployment endpoint. Your API key should only be used for the Mantle deployment endpoint.
Copy your API key when promoted by the command line
Go to your subgraph root directory where subgraph.yaml
file is located.
Run the following command to generate types and mapping for your subgraph project
Run the following command to compile your subgraph into WASM (WebAssembly).
Run the following command to deploy your subgraph to the Mantle Subgraph Service.
Note: you need to use --node
flag to specify the Mantle deployment endpoint in order to remove your subgraph from the Mantle Subgraph Service.
Run the following command to remove/unregister your subgraph from the Mantle Subgraph Service.
The Mantle Subgraph Web App also offers a concise guide to assist users in deploying their subgraphs effectively.