I have a subgraph that is running on a EC2 Instance and I want to be able to re-compile it, re-generate it and re-deploy it every time a configuration changes. When I say configuration, I refer to the smart contracts I want to track events for.
The commands I have to run are the following:
npx graph-compiler --config configs/config.json --include node_modules/@openzeppelin/subgraphs/src/datasources --export-schema --export-subgraph
graph create generated/sample --node http://127.0.0.1:8020
graph deploy --ipfs http://localhost:5001 --node http://localhost:8020 generated/sample ./generated/sample.subgraph.yaml
Does anybody have done this before and can provide an example of some scripts I can run to achieve this?