This repository implements a subgraph to index data and events for pools, tokens, and users on the GYSR platform.
It is deployed here: https://thegraph.com/explorer/subgraph/gysr-io/gysr
Documentation can be found here: https://docs.gysr.io/developers/subgraph
Both Node.js and npm are required for package management and deployment. See instructions
for installation here. This
codebase has been tested with nvm: v0.37.x
, Node.js: v18.x
, and npm: v10.x
.
To install node packages and other dependencies:
npm install
Deploy GYSR core contracts to a public EVM network or look up existing deployment information.
Define configuration variables as needed in config/<network>.json
.
Register or login at the Graph studio dashboard.
Create a new subgraph if needed and retrieve your access token.
Authenticate locally (one time)
npx graph auth --studio <ACCESS_TOKEN>
Generate subgraph.yaml
from network config
npm run prepare:sepolia
Run subgraph code generation
npm run codegen
Build subgraph (without deploying)
npm run build
Build and deploy subgraph to the Graph studio
npm run deploy:sepolia
Publish the subgraph to the Graph network using the studio interface.
It is also possible to run a local blockchain and graph node for testing and development.
Run a local development blockchain using the Ganache desktop app or CLI. (warning: now deprecated)
Deploy the GYSR core protocol to your local blockchain instance.
Follow the quickstart to setup a local graph node.
Register subgraph with local graph node (one time)
npm run create-local
Build and deploy subgraph to local graph node
npm run deploy:local
Launch the truffle console and start interacting with the deployed core contracts to generate some events and activity.
npx truffle console
Monitor indexing logs of the graph node for debugging.
Examine and validate indexed data with the query sandbox at: http://localhost:8000/subgraphs/name/gysr-io/gysr