To run subgraph local development on avalanche
- open
packages/subgraph/lib/graph-node/docker/docker-compose.yml
- change line 20
ethereum: 'mainnet:http://host.docker.internal:8545'
toethereum: 'avalanche:http://host.docker.internal:8545'
- change the image to
image: graphprotocol/graph-node:c724404
to prevent errors from custom solidity errors.
run yarn fork avalanche --hostname 0.0.0.0
run yarn c:export
to update contract.json file
cd packages/subgraph/lib/graph-node/docker
and docker-compose up
if using fork:fresh avalanche
, you'll need to copy & paste the address that SectorVaultFactory is deployed to into packages/subgraph/config/avalanche.js
if you're testing timelock you'll also want to update that address in the same file.
then set process.env.PUBLIC_SUBGRAPH = 'localhost'
cd packages/subgraph
and yarn codegen:avalanche && yarn create-local && yarn deploy-local
and press enter to skip version number
there will be an explorer at http://localhost:8000/subgraphs/name/sector-fi/sector-localhost/graphql