-
Specify the contract address of the locally deployed Smart Contract, the emitted Events and their handlers in
subgraph.template.yaml
file. -
npm run codegen
whenever there are changes inschema.graphql
file or the Contract abi(abis/*.json) -
npm run prepare:local
to createsubgraph.yaml
file. -
Start a graph-node instance with
docker-compose up
-
npm run create-local
to create an instance of the graph (run only first time. Subsequent Deployments are done on the same graph node instance) -
npm run deploy-local
to deploy event handler mappings to the graph node.
sign up on the graph with a github account create a graph project
-
npm install -g @graphprotocol/graph-cli
-
graph auth --product hosted-service <ACCESS_TOKEN>
npm run codegen
set contract address and startblock in .json
set repository address (/) in subgraph.template.yaml and package.json
npm run deploy