Deploying a subgraph on Bahamut using Mobula’s infrastructure is a straightforward process. This guide will walk you through the steps to get your subgraph up and running on the Bahamut network.

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

Ensure your subgraph is configured for Bahamut. Update your subgraph.yaml file to reference Bahamut-specific contracts and events. If you don’t have any subgraph, you can clone the Uniswap V2 (SilkSwap) subgraph template and modify it for Bahamut:

git clone https://github.com/MobulaFi/univ2-subgraph-bahamut
2

Install Dependencies

Make sure you have The Graph CLI installed:

npm install -g @graphprotocol/graph-cli
3

Install Mobula CLI

Install our CLI tool using npm:

npm i mobula-cli
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.

mob apikey set
5

Build Your Subgraph

Compile your subgraph before deployment:

graph codegen && graph build
6

Deploy your subgraph

Deploy your subgraph using the Mobula CLI:

mob deploy -n subgraphName
7

Monitor Deployment

After deployment, you’ll receive a URL to monitor your subgraph’s indexing progress and status.

Best Practices

  • Regularly update your subgraph to ensure compatibility with the latest Bahamut network changes.
  • Test your subgraph thoroughly on a testnet before deploying to mainnet.
  • Monitor your subgraph’s performance and optimize queries for efficiency.

Troubleshooting

If you encounter issues during deployment:

  • Review your subgraph.yaml configuration.
  • Ensure you’re using the correct network name and Mobula node URLs.
  • Verify your API key is valid and has the necessary permissions.

Need Assistance? Our support team is ready to help you with any questions or deployment challenges.