The main subgraph repo that houses all of the data associated with the KlimaDAO protocol (except the tokenized carbon subgraphs which live here).
npm install
from root to fetch dependencies- Review the Unit Testing Guide to get any missing deps for WSL/Linux/MacOS
First, deploy a Graph node locally. The most straightforward option is to use
docker-compose
from the graph-node repo.
Make sure to update the ethereum
environment variable of graph-node
in docker/docker-compose.yml
to matic:https://polygon-rpc.com/
.
For information on getting started with a Graph Node see this link: https://github.com/graphprotocol/graph-node/blob/master/docs/getting-started.md
Install any needed packages.
# from root
npm install
Create the subgraph instance. Use -w {workspace_name}
.
npm run -w polygon-digital-carbon create-local
Finally run codegen and deploy the subgraph and start indexing.
npm run -w polygon-digital-carbon codegen && npm run -w polygon-digital-carbon deploy-local
After the subgraph is deployed, navigate to http://127.0.01:8000/subgraphs/name/name-of-subgraph. You can then create GraphQL queries and view the returned data.
- Protocol Metrics: Staging | Production
- Bonds: Staging | Production
- Vesting: Staging | Production
- Carbon Users: Staging | Production
- Token Pairs: Staging | Production
- Polygon Digital Carbon: Staging | Production
- Ethereum Bridged Carbon: Staging | Production
- Celo Bridged Carbon: Staging | Production
Adding credits definitions normally requires updating the lib/projects/Projects.ts
file and recompiling and redeploying the Marketplace and Polygon Digital Carbon subgraphs.
This process is not optimal because the subgraphs deployments are tedious and long.
Projects can be added on the fly (without redeploying the contracts) by updating the CreditManager contract.
- update the
lib/projects/Projects.ts
file with the new project's definitions - set your
ALCHEMY_API_KEY
environment variable - set your
PRIVATE_KEY
environment variable - execute
npm run addCredits-polygon <creditId>