📡0xgraph CLI Cheat sheet
Streamlined Guide: Deploying Subgraphs with the 0xgraph CLI
This quick start guide outlines streamlined instructions for deploying subgraphs using the Command Line Interface (CLI). Developers looking to swiftly incorporate subgraph capabilities into their projects will find straightforward guidance and pro tips for getting set up fast.
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.
Deployment Network definitions
For developers who are already familiar with Graph Protocol tooling, below are the network definitions to deploy subgraphs on 0xgraph. These settings can be configured in the subgraph.yaml
file:
1. Get started by install the Graph cli
Download the Graph Cli to cli
2. Authentication with API key
Create an API key at https://app.0xgraph.xyz/dashboard/api
Authenticate using the 0xgraph Cli and API key.
Note: You need to specify the 0xgraph deployment endpoint. Your API key should only be used for the 0xgraph deployment endpoint.
Copy your API key when promoted by the command line
3. Generate types and mappings for your subgraph
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
4. Compile your subgraph
Run the following command to compile your subgraph into WASM (WebAssembly).
5. Create your subgraph on 0xgraph
Run the following command to create a subgraph entry on the 0xgraph Service. Note that this step only registers a subgraph and does not deploy the actual subgraph in the 0xgraph service.
6. Deploy your subgraph to 0xgraph service
Run the following command to deploy your subgraph to the 0xgraph service.
7. Remove your subgraph from 0xgraph service
Run the following command to remove/unregister your subgraph from the 0xgraph Subgraph Service.
Quick Start in the App
The 0xgraph Web App also offers a concise guide to assist users in deploying their subgraphs effectively.
Last updated