Currently deployed at
- Mainnet: https://thegraph.com/explorer/subgraph/renproject/renvm
- Testnet: https://thegraph.com/explorer/subgraph/renproject/renvm-testnet
Shell command:
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ transactions { id, amount } }" }' \
https://api.thegraph.com/subgraphs/name/renproject/renvm
GraphQL query:
{
renVM(id: 1) {
volume {
symbol
amountInUsd
}
}
epoches(first: 5, orderBy: timestamp, orderDirection: desc) {
numberOfDarknodes
rewardShares {
symbol
amountInUsd
}
}
}
To setup the graph node, follow the instructions at https://thegraph.com/docs/quick-start.
Some things to note:
- Pass
-d
toganache-cli
so generate contracts with the same addresses asconfig/ganache.json
. - If you restart
ganache-cli
, you may have to runsudo rm -r data/postgres
in thegraph-node/docker
directory.
Once everything is set-up, restarting will look like:
# In darknode-sol
yarn
yarn ganache-cli -h 0.0.0.0 -d
# In a different terminal
yarn truffle migrate
# In graph-node
cd docker
sudo rm -rf data/postgres
./setup.sh # (may have to update docker-compose.yml manually, replace ethereum address with `host.docker.internal` or correct IP)
docker-compose up
# In renvm-subgraph
yarn
yarn create:local
yarn deploy:local
Authorize, using the AUTH_CODE found in your thegraph.com account:
graph auth https://api.thegraph.com/deploy/ <AUTH_CODE>
Then run one of:
yarn deploy:mainnet
yarn deploy:testnet
yarn deploy:devnet
Note: only run one deployment at a time, as they all have to generate ./src/_config.ts
with values specific to the network.