This Subgraph sources events from the Beefy contracts in different networks.
- Avalanche
- Arbitrum
- Base
- Bsc
- Ethereum
- Fantom
- Fraxtal
- Gnosis
- Linea
- Lisk
- Manta
- Mantle
- Metis
- Mode
- Moonbeam
- Optimism
- Polygon
- Rootstock
- Scroll
- Sei
- Zksync
- Git: git-scm.com
- Node.js: nodejs.org, see version in .nvmrc
- Yarn: yarnpkg.com
yarn install
yarn infra:strat
yarn test # run all tests
yarn test:graph # run only matchstick-as graph tests
yarn test:lint # run prettier linter
- 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)
- Add dev RPCs in graph-node config docker/graph-node/config.toml.
- Add the chain in
.github/workflows/Release.yml
to configure deployments. - Test the build
- Apply the configuration:
npm run prepare:<chain>
- Build the application:
npm run build
- Run Tests:
npm run test
- Deploy the new chain in DEV:
./bin/deploy.sh <chain> <dev provider>
- Test the data in the dev provider subgraph explorer
- Manually deploy the new chain in PROD for the first version:
./bin/deploy.sh <chain> <dev provider>
- Apply the configuration:
- Update the
Deployments
section subgraph URLs in this README - Update the Balances API
- Standard formatting with
npm run format
- Create or update the schema.graphql file.
- See TheGraph docs for defining entities
- Run
yarn codegen
to generate the typescript types.
- See TheGraph docs for TypeScript code generation
- Update subgraph.template.yaml with the new entity bindings and/or data sources if needed.
- TheGraph docs for defining a call handler
- TheGraph docs for defining a block handler
- TheGraph docs for defining a data source template
- Update or create the mappings in the mappings folder to handle the new entity.
- TheGraph docs for defining mappings
- TheGraph AssemblyScript API
- Write tests for the new mappings in the tests folder.
- TheGraph docs for testing mappings
./bin/deploy.sh <network> goldsky
./bin/deploy.sh <network> 0xgraph
# or both
./bin/deploy.sh <network> goldsky 0xgraph
- Go to https://github.com/beefyfinance/beefy-balances-subgraph/releases
- Add a new realease with a tag matching semver (tag matching X.X.X)
- Github actions will update all subgraph
- Monitor the indexing progress in the subgraph explorer