Skip to content

Commit

Permalink
Add lisk
Browse files Browse the repository at this point in the history
  • Loading branch information
prevostc committed Dec 9, 2024
1 parent 4393852 commit f202315
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 78 deletions.
1 change: 1 addition & 0 deletions .github/workflows/Release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
"fraxtal",
"gnosis",
"linea",
"lisk",
"manta",
"mantle",
"metis",
Expand Down
28 changes: 9 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,12 @@ This Subgraph sources events from the Beefy contracts in different networks.
- [Ethereum](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-ethereum/latest/gn)
- [Fantom](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-fantom/latest/gn)
- [Fraxtal](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-fraxtal/latest/gn)
- [Gnosis](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-gnosis/latest/gn)
- [Linea](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-linea/latest/gn)
- [Lisk](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-lisk/latest/gn)
- [Manta](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-manta/latest/gn)
- [Mantle](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-mantle/latest/gn)
- [Metis](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-metis/latest/gn)
- [Mode](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-mode/latest/gn)
- [Moonbeam](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-moonbeam/latest/gn)
- [Optimism](https://api.goldsky.com/api/public/project_clu2walwem1qm01w40v3yhw1f/subgraphs/beefy-balances-optimism/latest/gn)
Expand All @@ -33,8 +37,6 @@ This Subgraph sources events from the Beefy contracts in different networks.
- Git: [git-scm.com](https://git-scm.com)
- Node.js: [nodejs.org](https://nodejs.org), see version in [.nvmrc](.nvmrc)
- Yarn: [yarnpkg.com](https://yarnpkg.com)
- Docker: [docker.com](https://www.docker.com)
- Docker Compose: [docker.com](https://docs.docker.com/compose/install/)

## Setup the project

Expand All @@ -48,17 +50,6 @@ yarn install
yarn infra:strat
```

## Deploying the subgraph locally

```bash
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

```bash
Expand All @@ -74,18 +65,17 @@ yarn test:lint # run prettier linter
1. Add the network configuration [config/<network>.json](config/).
- `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](https://thegraph.com/docs/en/cookbook/pruning/#how-to-prune-a-subgraph-with-indexerhints))
2. Add dev RPCs in graph-node config [docker/graph-node/config.toml](docker/graph-node/config.toml).
3. Add a new `prepare:<network>` script in [package.json](package.json).
4. Add the chain in `.github/workflows/Release.yml` to configure deployments.
5. Test the build
3. Add the chain in `.github/workflows/Release.yml` to configure deployments.
4. 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>`
6. Update the `Deployments` section subgraph URLs in this README
7. Update the [Balances API](https://github.com/beefyfinance/beefy-balances-api)
8. Standard formatting with `npm run format`
5. Update the `Deployments` section subgraph URLs in this README
6. Update the [Balances API](https://github.com/beefyfinance/beefy-balances-api)
7. Standard formatting with `npm run format`

### How to update the schema

Expand Down
2 changes: 1 addition & 1 deletion bin/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function exit_help {
function prepare {
CHAIN=$1
echo "preparing $CHAIN"
yarn prepare:$CHAIN
yarn configure $CHAIN
yarn codegen
yarn build
}
Expand Down
2 changes: 1 addition & 1 deletion bin/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function exit_help {
function prepare {
CHAIN=$1
echo "preparing $CHAIN"
yarn prepare:$CHAIN
yarn configure $CHAIN
yarn codegen
yarn build
}
Expand Down
21 changes: 21 additions & 0 deletions config/_real.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"network": "real",
"indexerHintPrune": 10800000,
"shareTokenMintAddress": "0x0000000000000000000000000000000000000000",
"burnAddress": "0x000000000000000000000000000000000000dead",
"firstBlock": 93102906,

"clmManagerFactoryAddress": "0x2AfB174c22D9eE334895C4e300ab93154d800aA0",
"clmManagerFactoryStartBlock": 93102906,
"clmStrategyFactoryAddress": "0x70127945067E4224d7B6ABfDc6f57e3ea45d5CA4",
"clmStrategyFactoryStartBlock": 93102956,
"rewardPoolFactoryAddress": "0xe103ab2f922aa1a56EC058AbfDA2CeEa1e95bCd7",
"rewardPoolFactoryStartBlock": 93102931,
"beefyClassicVaultFactoryAddress": "0x91BB303E972995EbE5f593BCddBb6F5Ef49Dbcbd",
"beefyClassicVaultFactoryStartBlock": 92535412,

"beefyContractDeployerAddress": "0xcc536552A6214d6667fBC3EC38965F7f556A6391",
"beefyContractDeployerStartBlock": 93106093,

"vaultInitializedEvent": "Initialized(uint8)"
}
25 changes: 25 additions & 0 deletions config/lisk.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"network": "lisk",
"indexerHintPrune": 2000000,

"shareTokenMintAddress": "0x0000000000000000000000000000000000000000",
"burnAddress": "0x000000000000000000000000000000000000dead",
"firstBlock": 8910850,

"clmManagerFactoryAddress": "0x3C0b1765C379833b86A1704997019A7496Afdfae",
"clmManagerFactoryStartBlock": 9252397,
"clmStrategyFactoryAddress": "0x7cac900B2f504047b40F5554F633248f78bD960A",
"clmStrategyFactoryStartBlock": 9252416,
"rewardPoolFactoryAddress": "0xA5Cd8A60a05571141370D184e255777e5c2d5968",
"rewardPoolFactoryStartBlock": 9252403,
"beefyClassicVaultFactoryAddress": "0xBC4a342B0c057501E081484A2d24e576E854F823",
"beefyClassicVaultFactoryStartBlock": 8910851,
"beefyClassicBoostFactoryAddress": "0x0000000000000000000000000000000000000000",
"beefyClassicBoostFactoryStartBlock": 8910851,

"beefyContractDeployerAddress": "0xcc536552A6214d6667fBC3EC38965F7f556A6391",
"beefyContractDeployerStartBlock": 9387884,

"vaultInitializedEvent": "Initialized(uint8)"
}

4 changes: 4 additions & 0 deletions data/lisk_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"old_vaults": [],
"old_boosts": []
}
1 change: 0 additions & 1 deletion docker/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions docker/graph-node/config.toml

This file was deleted.

23 changes: 2 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "beefy-balances-subgraph",
"private": true,
"scripts": {
"postinstall": "yarn run --silent prepare:linea && yarn run --silent codegen",
"postinstall": "yarn run --silent configure linea && yarn run --silent codegen",
"codegen": "rm -Rf generated && graph codegen",
"build": "graph build",
"format": "prettier . --write",
Expand All @@ -15,26 +15,7 @@
"create-local": "graph create beefyfinance/local --node http://127.0.0.1:8020",
"deploy-local": "graph deploy beefyfinance/local --node http://127.0.0.1:8020 --ipfs http://localhost:5001",
"remove-local": "graph remove beefyfinance/local --node http://127.0.0.1:8020",
"prepare:avax": "./bin/prepare.sh avax",
"prepare:arbitrum": "./bin/prepare.sh arbitrum",
"prepare:base": "./bin/prepare.sh base",
"prepare:bsc": "./bin/prepare.sh bsc",
"prepare:ethereum": "./bin/prepare.sh ethereum",
"prepare:fantom": "./bin/prepare.sh fantom",
"prepare:fraxtal": "./bin/prepare.sh fraxtal",
"prepare:gnosis": "./bin/prepare.sh gnosis",
"prepare:linea": "./bin/prepare.sh linea",
"prepare:manta": "./bin/prepare.sh manta",
"prepare:mantle": "./bin/prepare.sh mantle",
"prepare:metis": "./bin/prepare.sh metis",
"prepare:mode": "./bin/prepare.sh mode",
"prepare:moonbeam": "./bin/prepare.sh moonbeam",
"prepare:optimism": "./bin/prepare.sh optimism",
"prepare:polygon": "./bin/prepare.sh polygon",
"prepare:rootstock": "./bin/prepare.sh rootstock",
"prepare:scroll": "./bin/prepare.sh scroll",
"prepare:sei": "./bin/prepare.sh sei",
"prepare:zksync": "./bin/prepare.sh zksync"
"configure": "./bin/prepare.sh "
},
"main": "./bin/index.js",
"bin": {
Expand Down

0 comments on commit f202315

Please sign in to comment.