Deploy an Indexer (Subgraph) on Polygon zkEVM with The Graph
Step-by-step guide for deploying a subgraph on Polygon zkEVM using The Graph for efficient blockchain data indexing and querying.
Deploying a subgraph on Polygon zkEVM with Mobula’s infrastructure is a simple process. This guide will walk you through the steps to get your subgraph up and running on the Polygon zkEVM 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)
Prepare Your Subgraph
Make sure your subgraph is set up for Polygon zkEVM. Modify your subgraph.yaml
file to reference zkEVM-specific contracts and events. If you don’t have a subgraph, you can clone the Uniswap V2 (QuickSwap) subgraph template and adjust it for Polygon zkEVM:
Install Dependencies
Ensure that The Graph CLI is installed:
Build Your Subgraph
Compile your subgraph prior to deployment:
Create the Subgraph
Use the following command to deploy your subgraph:
Deploy to Mobula's Polygon zkEVM Node
Use the following command to deploy your subgraph:
Authenticate
When prompted, enter your Mobula API key for authentication. Refer to the authentication section for more information on obtaining and using your API key.
Monitor Deployment
After deployment, you’ll receive a URL to track your subgraph’s indexing progress and status.
Best Practices
- Keep your subgraph regularly updated to maintain compatibility with the latest Polygon zkEVM 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.
- Ensure your API key is valid and has the required permissions.
Need Assistance? Our support team is available to assist with any questions or deployment issues you may encounter.