https://github.com/renproject/renvm-subgraph
Subgraph for querying RenVM stats on EVM chains
https://github.com/renproject/renvm-subgraph
Last synced: 7 months ago
JSON representation
Subgraph for querying RenVM stats on EVM chains
- Host: GitHub
- URL: https://github.com/renproject/renvm-subgraph
- Owner: renproject
- Created: 2020-04-23T01:45:47.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T00:39:51.000Z (over 3 years ago)
- Last Synced: 2023-03-02T04:22:07.036Z (over 3 years ago)
- Language: TypeScript
- Homepage: https://thegraph.com/explorer/subgraph/renproject/renvm
- Size: 19.3 MB
- Stars: 7
- Watchers: 10
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README

### RenVM Subgraph
Currently deployed at
- Mainnet: https://thegraph.com/explorer/subgraph/renproject/renvm
- Testnet: https://thegraph.com/explorer/subgraph/renproject/renvm-testnet
## Examples
### Send a QUERY with cURL:
Shell command:
```sh
curl \
-X POST \
-H "Content-Type: application/json" \
--data '{ "query": "{ transactions { id, amount } }" }' \
https://api.thegraph.com/subgraphs/name/renproject/renvm
```
### Get daily BTC volume
GraphQL query:
```graphql
{
renVM(id: 1) {
volume {
symbol
amountInUsd
}
}
epoches(first: 5, orderBy: timestamp, orderDirection: desc) {
numberOfDarknodes
rewardShares {
symbol
amountInUsd
}
}
}
```
## Developing locally
To setup the graph node, follow the instructions at .
Some things to note:
1. Pass `-d` to `ganache-cli` so generate contracts with the same addresses as `config/ganache.json`.
2. If you restart `ganache-cli`, you may have to run `sudo rm -r data/postgres` in the `graph-node/docker` directory.
Once everything is set-up, restarting will look like:
```sh
# 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
```
## Deploying to thegraph.com
Authorize, using the AUTH_CODE found in your thegraph.com account:
```sh
graph auth https://api.thegraph.com/deploy/
```
Then run one of:
```sh
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.