GithubHelp home page GithubHelp logo

lrt-subgraph's Introduction

Beefy LRT Subgraph

This Subgraph sources events from the Beefy LRT 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

Deploying the subgraph locally

yarn remove-local # if you have already deployed the subgraph
yarn create-local # create the subgraph locally
yarn prepare:<network> # apply configuration for the network
yarn codegen # generate the typescript types
yarn build # build the subgraph code
yarn deploy-local # deploy the subgraph locally

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.
    • clockTickBlocks is the number of blocks between each clock tick, aim for a clock tick every ~5 minutes.
  2. Add dev RPCs in graph-node config docker/graph-node/config.toml.
  3. Add a new prepare:<network> script in package.json.
  4. Add the chain in .github/workflows/Release.yml to configure deployments.
  5. Test the build
    • Apply the configuration: npm run prepare:<chain>
    • Build the application: npm run build
    • Run Tests: npm run test
    • The PROD env is the uncommented url in the lrt-api .graphqlclient file
    • 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>
  6. Update the Deployments section subgraph URLs in this README
  7. Update the LRT API
  8. Standard formatting with npm run format

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

lrt-subgraph's People

Contributors

prevostc avatar kexleybeefy avatar schnarkus avatar reflectivechimp avatar seguido avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.