For the graph-node configuration, check ./provision.
To manage containers, update the subgraph: ssh [email protected]
To admin the server: ssh [email protected]
Make sure you've updated the networks/:DAO.json. Attention: the shape of the JSON needs to be:
{
"networkName": {
"ContractName": {
"address": "...",
"startBlock": 123
},
},
}
Otherwise it will error upon deployment
Connect to [email protected], run tmux attach
to connect to the current tmux session, go to /home/worker/subgraph/dao
, run
- staging instance:
pnpm run remove-local:DAO ; pnpm run create-local:DAO ; pnpm deploy-staging:DAO
- production instance:
pnpm run remove-local:DAO ; pnpm run create-local:DAO ; pnpm deploy-production:DAO
Note: At the moment, :DAO
can be neokingdom
, crowdpunk
or teledisko
Another important note: for neokingdom
, you also need to export the $FORK env variable.
ℹ️ Update the network json (if not updated already), push the code.
ssh [email protected]
worker@neokingdom2:~$ cd NEOKingdomDAO/subgraph/dao
worker@neokingdom2:~/NEOKingdomDAO/subgraph/dao$ git pull
worker@neokingdom2:~/NEOKingdomDAO/subgraph/dao$ pnpm run remove-local:crowdpunk; pnpm create-local:crowdpunk; pnpm deploy-production:crowdpunk
✅
worker@neokingdom2:~$ docker ps | grep node
88ccf892a3a1 graphprotocol/graph-node:d33bb7e
worker@neokingdom2:~$ docker logs 88ccf892a3a1 -n1000 -f
ERRO the genesis block hash for chain tevmos has changed from X to Y since the last time we ran, component: BlockStore
See: graphprotocol/graph-node#3655
Solution: stop docker compose, remove /home/worker/subgraph/data
dir, restart docker compose.
See: graphprotocol/graph-node#3699
Solution:
- check if the testnet has been restarted and recreated using a new genesis file: https://github.com/evmos/testnets
- if so, check the new lowest block number
- update the lowest block number in
docker-compose.yml
, env variableGRAPH_ETHEREUM_GENESIS_BLOCK_NUMBER
npm install -g @graphprotocol/graph-cli
# make sure your env contains the following variable
ETHEREUM=<tevmos:https://eth.bd.evmos.dev:8545 | evmos:https://eth.bd.evmos.org:8545>
GENESIS_BLOCK=<genesis block>
IPFS=http://localhost:5001 # or the remote ipfs endpoint
# in case, the fork name
FORK=fork-name
# install and run ethnode or ganache-cli
# deploy contracts locally
git clone https://github.com/graphprotocol/graph-node/
cd graph-node/docker
docker-compose up
graph create --node http://localhost:8020/ <subgraph-name>
graph init --product hosted-service --from-contract <address> --allow-simple-name --index-events --contract-name <contract-name> --abi <dir> --network mainnet --protocol ethereum <subgraph-name>
graph deploy <subgraph-name> -g http://localhost:8020/ -i http://localhost:5001/
graph create --node http://localhost:8020/ <subgraph-name>
graph init --product hosted-service --from-contract <address> --allow-simple-name --index-events --contract-name <contract-name> --abi <dir> --network mainnet --protocol ethereum <subgraph-name>
graph deploy <subgraph-name> -g http://localhost:8020/ -i http://localhost:5001/