What you’ll need
- Basic knowledge of The Graph and subgraphs.
- Your subgraph project files
- The Graph CLI installed
- A Mobula API key (for authentication)
Walkthrough
1
Prepare Your Subgraph
Make sure your subgraph is set up for Base. Modify your
subgraph.yaml
file to point to Base-specific contracts and events. If you don’t have a subgraph yet, you can clone the Uniswap V2 subgraph template and adjust it for Base:2
Install Dependencies
Ensure that The Graph CLI is installed:
3
Install Mobula CLI
Install our CLI tool using npm:
4
Setup API Key
Configure your API key with the CLI. You can get your API key from the Dashboard.
Please refer to the authentication section for detailed steps on obtaining your API key.
5
Build Your Subgraph
Compile your subgraph before deployment:
6
Deploy your subgraph
Deploy your subgraph using the Mobula CLI:
7
Monitor Deployment
After deployment, you’ll receive a URL to monitor your subgraph’s indexing progress and status.
Best Practices
- Keep your subgraph regularly updated to maintain compatibility with the latest Base network changes.
- Thoroughly test your subgraph on a testnet before deploying to the mainnet.
- Continuously monitor your subgraph’s performance and optimize queries for better efficiency.
Troubleshooting
If you encounter issues during deployment:- Carefully review your
subgraph.yaml
configuration. - Confirm that you’re using the correct network name and Mobula node URLs.
- Make sure your API key is valid and has the required permissions.