Steps to deploy the subgraph
-
Go to thegraph portal, authenticate using you github account
-
Create a new subgraph
-
Generate deployemnt key
-
yarn install
-
Configure subgraph.yaml:
- yarn prepare:mainnet-test
- or
- yarn prepare:mainnet
-
Generate models from abi
- yarn codgen
-
Authenticate in graph
- graph auth https://api.thegraph.com/deploy/ KEY
-
Deploy subgraph
- graph deploy USERNAME/SUBGRAPHNAME --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/
username and subgraphname you can get from graph portal url
Note: Once you start deployment you will not be able to stop the indexing process, for eg running it against mainnet could take more than 24 hours. mainnet-test runs much faster, it starts indexing from block 12093425