From f20231522ed5578842fd6ee6dbe45c5462640d15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Pr=C3=A9vost?= <998369+prevostc@users.noreply.github.com> Date: Mon, 9 Dec 2024 18:42:03 +0100 Subject: [PATCH] Add lisk --- .github/workflows/Release.yml | 1 + README.md | 28 +++++++++------------------- bin/deploy.sh | 2 +- bin/release.sh | 2 +- config/_real.json | 21 +++++++++++++++++++++ config/lisk.json | 25 +++++++++++++++++++++++++ data/lisk_data.json | 4 ++++ docker/.gitignore | 1 - docker/graph-node/config.toml | 35 ----------------------------------- package.json | 23 ++--------------------- 10 files changed, 64 insertions(+), 78 deletions(-) create mode 100644 config/_real.json create mode 100644 config/lisk.json create mode 100644 data/lisk_data.json delete mode 100644 docker/.gitignore delete mode 100644 docker/graph-node/config.toml diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml index e854488..f4bcb96 100644 --- a/.github/workflows/Release.yml +++ b/.github/workflows/Release.yml @@ -22,6 +22,7 @@ jobs: "fraxtal", "gnosis", "linea", + "lisk", "manta", "mantle", "metis", diff --git a/README.md b/README.md index 4528628..0801737 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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 @@ -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: # 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 @@ -74,18 +65,17 @@ yarn test:lint # run prettier linter 1. Add the network configuration [config/.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:` 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:` - Build the application: `npm run build` - Run Tests: `npm run test` - Deploy the new chain in DEV: `./bin/deploy.sh ` - Test the data in the dev provider subgraph explorer - Manually deploy the new chain in PROD for the first version: `./bin/deploy.sh ` -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 diff --git a/bin/deploy.sh b/bin/deploy.sh index 969e4e9..e57a896 100755 --- a/bin/deploy.sh +++ b/bin/deploy.sh @@ -15,7 +15,7 @@ function exit_help { function prepare { CHAIN=$1 echo "preparing $CHAIN" - yarn prepare:$CHAIN + yarn configure $CHAIN yarn codegen yarn build } diff --git a/bin/release.sh b/bin/release.sh index f3c4b38..2baa0c5 100755 --- a/bin/release.sh +++ b/bin/release.sh @@ -17,7 +17,7 @@ function exit_help { function prepare { CHAIN=$1 echo "preparing $CHAIN" - yarn prepare:$CHAIN + yarn configure $CHAIN yarn codegen yarn build } diff --git a/config/_real.json b/config/_real.json new file mode 100644 index 0000000..6616da8 --- /dev/null +++ b/config/_real.json @@ -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)" +} diff --git a/config/lisk.json b/config/lisk.json new file mode 100644 index 0000000..703191c --- /dev/null +++ b/config/lisk.json @@ -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)" + } + \ No newline at end of file diff --git a/data/lisk_data.json b/data/lisk_data.json new file mode 100644 index 0000000..0e2c6c9 --- /dev/null +++ b/data/lisk_data.json @@ -0,0 +1,4 @@ +{ + "old_vaults": [], + "old_boosts": [] +} diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index 6320cd2..0000000 --- a/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -data \ No newline at end of file diff --git a/docker/graph-node/config.toml b/docker/graph-node/config.toml deleted file mode 100644 index f94d4ef..0000000 --- a/docker/graph-node/config.toml +++ /dev/null @@ -1,35 +0,0 @@ -# A simple store configuration: we use one database for everything -# This is equivalent to the old way of configuring the store for tests -# by just setting the environment variable THEGRAPH_STORE_POSTGRES_DIESEL_URL - -[store] -[store.primary] -connection = "postgresql://graph-node:let-me-in@postgres:5432/graph-node" -pool_size = 10 - -[deployment] -[[deployment.rule]] -store = "primary" -indexers = ["default"] - -[chains] -ingestor = "default" - -[chains.arbitrum-one] -shard = "primary" - -# archive node test: -# curl https://arbitrum.llamarpc.com -X POST -H "Content-Type: application/json" --data '{"method":"eth_getBalance","params":["0x82af49447d8a07e3bd95bd0d56f35241523fbab1", "0x55"],"id":1,"jsonrpc":"2.0"}' -provider = [ - # { label = "blutgang-http", url = "http://rpc-proxy-cache-arbitrum:3000", features = [ "archive" ] }, - { label = "ankr", url = "https://rpc.ankr.com/arbitrum", features = ["archive"] }, - { label = "gatewayfm", url = "https://rpc.arb1.arbitrum.gateway.fm", features = ["archive"] }, - { label = "tornadoeth", url = "https://rpc.tornadoeth.cash/arbitrum", features = ["archive"] }, - { label = "nodies", url = "https://arb-pokt.nodies.app", features = [] }, - { label = "arbitrumio", url = "https://arb1.arbitrum.io/rpc", features = [] }, - { label = "meowrpc", url = "https://arbitrum.meowrpc.com", features = [] }, - { label = "1rpc", url = "https://1rpc.io/arb", features = [] }, - { label = "publicnode", url = "https://arbitrum-one.publicnode.com", features = [] } - # value: conflicting network identifiers for chain arbitrum: `net_version: 42161, genesis_block_hash: ...` != `net_version: 0xa4b1, genesis_block_hash: ...` - #{ label = "llamarpc", url = "https://arbitrum.llamarpc.com", features = [] }, -] diff --git a/package.json b/package.json index fa0722e..f0d779a 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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": {