Skip to content

beefyfinance/beefy-balances-subgraph

Repository files navigation

Beefy beefy-balances Subgraph

This Subgraph sources events from the Beefy contracts in different networks.

Deployments

Goldsky.com

Latest endpoints

Contributing

Prerequisites

Setup the project

yarn install

Running a local instance of graph-node locally

yarn infra:strat

Run tests

yarn test # run all tests
yarn test:graph # run only matchstick-as graph tests
yarn test:lint # run prettier linter

HOWTOs

How to add a new network

  1. Add the network configuration config/.json.
    • indexerHintPrune is the number of blocks to keep for the indexer hint, aim for 2 months. Can be set to "auto" to prune as much as possible. Recommended for performance and cost. Or set to "never" to keep all updates history. (Thegraph docs)
  2. Add the data configuration data/.json
  3. Add the chain in .github/workflows/Release.yml to configure deployments.
  4. Add the endpoint link to the README in alphabetical order.
  5. Release the first version of the subgraph for the new network using the ./bin/release.sh script.
    • Must be logged in to goldsky with the provided cli.
    • Only used to deploy the first version, see below for updating a subgraph.

How to update the schema

  1. Create or update the schema.graphql file.
  1. Run yarn codegen to generate the typescript types.
  1. Update subgraph.template.yaml with the new entity bindings and/or data sources if needed.
  1. Update or create the mappings in the mappings folder to handle the new entity.
  1. Write tests for the new mappings in the tests folder.

Deploy the subgraph

Manually

./bin/deploy.sh <network> goldsky
./bin/deploy.sh <network> 0xgraph

# or both
./bin/deploy.sh <network> goldsky 0xgraph

Release a new version