This document provides a step-by-step guide on how to deploy your subgraph to BSC, Arbitrum anf Polygon using the provided scripts in your package.json
file. Make sure you have completed the code generation, building, and authentication steps before proceeding with the deployment.
- Prerequisites
- Installing Dependencies
- Code Generation
- Building
- Authentication
- Deploying to Binance Smart Chain
- Deploying to Arbitrum
- Deploying to Polygon
- Node.js and npm installed.
- TheGraph CLI (
graph-cli
) installed.
Before you begin, make sure to install the project's dependencies by running:
npm install
Run the following commands to generate the subgraph's code:
npm run codegen:arbitrum
npm run codegen:binance
npm run codegen:polygon
After code generation, you need to build your subgraph using the following commands:
npm run build:arbitrum
npm run build:binance
npm run build:polygon
To deploy your subgraph, you'll need to authenticate with TheGraph's network. Run the following command and follow the prompts:
npm run auth
Deploy your subgraph to Binance Smart Chain using the following command:
npm run deploy:binance
Deploy your subgraph to Arbitrum using the following command:
npm run deploy:arbitrum
Deploy your subgraph to Polygon using the following command:
npm run deploy:polygon
Congratulations! Your subgraph should now be accessible and queryable on TheGraph's network.