8000 Add Erigon support for devnets by Raneet10 · Pull Request #184 · maticnetwork/matic-cli · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add Erigon support for devnets #184

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
May 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 51 additions & 36 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,26 +1,37 @@
# terraform variables
TF_VAR_AWS_PROFILE=default# do not change this
TF_VAR_VM_NAME=YOUR_IDENTIFIER# default "polygon-user". It can be any string, used to discriminate between instances
TF_VAR_DOCKERIZED=no# default "no", otherwise only one VM is created and the Polygon devnet will run in docker containers
TF_VAR_DISK_SIZE_GB=100# size of the disk in GB (default is 100GB)
TF_VAR_ARCHIVE_DISK_SIZE_GB=100 # size of the disk in GB in archive node (default is 100GB)
TF_VAR_IOPS=3000# Amount of provisioned IOPS
TF_VAR_ARCHIVE_IOPS=15000 # Amount of provisioned IOPS in archive node
TF_VAR_VALIDATOR_COUNT=2# number of validator nodes (default is 2). Note that while spinning up a public network (mainnet/mumbai) node, this will serve as a non-validator
TF_VAR_SENTRY_COUNT=1# number of non-validator sentry nodes (default is 1)
TF_VAR_ARCHIVE_COUNT=0 # number of archive nodes (default is 0)
TF_VAR_INSTANCE_TYPE=t2.xlarge# type of the EC2 VM instance (default is t2.xlarge)
TF_VAR_ARCHIVE_INSTANCE_TYPE=t2.xlarge # default t2.xlarge
TF_VAR_VOLUME_TYPE=gp3 # default gp3
TF_VAR_ARCHIVE_VOLUME_TYPE=io1 # type of EBS volume for archive nodes (default is io1)
TF_VAR_INSTANCE_AMI=ami-017fecd1353bcc96e# ami instance type (default is ami-017fecd1353bcc96e, running ubuntu 22.04)
TF_VAR_PEM_FILE=aws-key# name of the certificate (.pem file) previously generated (default is aws-key)
TF_VAR_REGION=us-west-2# AWS region to deploy to (default is us-west-2)
PEM_FILE_PATH=/absolute/path/to/your/aws-key.pem# absolute path pointing to the certificate previously downloaded
TF_VAR_AWS_PROFILE=default # do not change this
TF_VAR_VM_NAME=YOUR_IDENTIFIER # default "polygon-user". It can be any string, used to discriminate between instances
TF_VAR_DOCKERIZED=no # default "no", otherwise only one VM is created and the Polygon devnet will run in docker containers
TF_VAR_BOR_DISK_SIZE_GB=20 # size of the disk in GB for Bor client (default is 100GB)
TF_VAR_ERIGON_DISK_SIZE_GB=20 # size of the disk in GB for Erigon client (default is 100GB)
TF_VAR_BOR_ARCHIVE_DISK_SIZE_GB=100 # size of the disk in GB in Bor archive node (default is 100GB)
TF_VAR_ERIGON_ARCHIVE_DISK_SIZE_GB=100 # size of the disk in GB in Erigon archive node (default is 100GB)
TF_VAR_BOR_IOPS=3000 # Amount of provisioned IOPS for Bor client
TF_VAR_ERIGON_IOPS=3000 # Amount of provisioned IOPS for Erigon client
TF_VAR_BOR_ARCHIVE_IOPS=15000 # Amount of provisioned IOPS in Bor archive node
TF_VAR_ERIGON_ARCHIVE_IOPS=15000 # Amount of provisioned IOPS in Erigon archive node
TF_VAR_BOR_VALIDATOR_COUNT=2 # number of Bor validator nodes (default is 2). Note that while spinning up a public network (mainnet/mumbai) node, this will serve as a non-validator
TF_VAR_BOR_SENTRY_COUNT=1 # number of non-validator Bor sentry nodes (default is 1)
TF_VAR_BOR_ARCHIVE_COUNT=0 # number of Bor archive nodes (default is 0)
TF_VAR_ERIGON_VALIDATOR_COUNT=0 # number of Erigon validator nodes (default is 0). Note that while spinning up a public network (mainnet/mumbai) node, this will serve as a non-validator
TF_VAR_ERIGON_SENTRY_COUNT=0 # number of non-validator Erigon sentry nodes (default is 0)
TF_VAR_ERIGON_ARCHIVE_COUNT=0 # number of Erigon archive nodes (default is 0)
TF_VAR_BOR_INSTANCE_TYPE=t2.xlarge # type of the EC2 VM instance for Bor client (default is t2.xlarge)
TF_VAR_ERIGON_INSTANCE_TYPE=r5b.large # type of the EC2 VM instance for Erigon client (default is r5b.large)
TF_VAR_BOR_ARCHIVE_INSTANCE_TYPE=t2.xlarge # default t2.xlarge
TF_VAR_ERIGON_ARCHIVE_INSTANCE_TYPE=r5b.large # default r5b.large
TF_VAR_BOR_VOLUME_TYPE=gp3 # default gp3
TF_VAR_ERIGON_VOLUME_TYPE=gp3 # default gp3
TF_VAR_BOR_ARCHIVE_VOLUME_TYPE=io1 # type of EBS volume for Bor archive nodes (default is io1)
TF_VAR_ERIGON_ARCHIVE_VOLUME_TYPE=io1 # type of EBS volume for Erigon archive nodes (default is io1)
TF_VAR_INSTANCE_AMI=ami-017fecd1353bcc96e # ami instance type (default is ami-017fecd1353bcc96e, running ubuntu 22.04)
TF_VAR_PEM_FILE=aws-key # name of the certificate (.pem file) previously generated (default is aws-key)
TF_VAR_REGION=us-west-2 # AWS region to deploy to (default is us-west-2)
PEM_FILE_PATH=/absolute/path/to/your/aws-key.pem # absolute path pointing to the certificate previously downloaded

# Polygon network based variables (see configs/README.md) for more detailed info
DEFAULT_STAKE=10000# default stake for each validator (in matic)
DEFAULT_FEE=2000# default amount of fee to topup heimdall validator
DEFAULT_STAKE=10000 # default stake for each validator (in matic)
DEFAULT_FEE=2000 # default amount of fee to topup heimdall validator
NETWORK= # mention "mumbai", "mainnet" or leave empty if spinning up a local devnet
HEIMDALL_SEEDS=e72c0466a02ea43b2198bd3a9454b87a3ef0d77e@54.147.31.250:26656,b302d1ddb21102e794b524d05152a7834da05bd1@34.226.134.117:26656 # Heimdall seeds to be added in config.toml (when running a mainnet/mumbai node )
BOR_CHAIN_ID= # bor chainID (leave empty to get a random one)
Expand All @@ -30,37 +41,41 @@ SPRINT_SIZE_BLOCK_NUMBER=0 # comma separated values defining the block heights o
BLOCK_NUMBER=0 # comma separated values defining the block heights of bor where block time must change
BLOCK_TIME=2 # comma separated values defining the block times for the relative BLOCK_NUMBERs
BOR_REPO="https://github.com/maticnetwork/bor.git" # repo of bor project
BOR_BRANCH=develop# bor branch defining the version to be used in the devnet
BOR_BRANCH=develop # bor branch defining the version to be used in the devnet
ERIGON_REPO="https://github.com/ledgerwatch/erigon.git" # repo of Erigon project
ERIGON_BRANCH=devel # Erigon branch defining the version to be used in the devnet
HEIMDALL_REPO="https://github.com/maticnetwork/heimdall.git" # repo of heimdall project
HEIMDALL_BRANCH=develop# heimdall branch defining the version to be used in the devnet
HEIMDALL_BRANCH=develop # heimdall branch defining the version to be used in the devnet
CONTRACTS_REPO="https://github.com/maticnetwork/contracts.git" # repo of contracts project
CONTRACTS_BRANCH=mardizzone/node-16 # contracts branch defining the version to be used in the devnet. To use node v16.x, please stick with it
GENESIS_CONTRACTS_REPO="https://github.com/maticnetwork/genesis-contracts.git" # repo of genesis-contracts project
GENESIS_CONTRACTS_BRANCH=master# Genesis contracts branch defining the version to be used in the devnet
MATIC_CLI_REPO="https://github.com/maticnetwork/matic-cli.git" # repo of matic-cli to run a specific version remotely using express-cli
MATIC_CLI_BRANCH=master# matic-cli branch used on the remote machines to start the environment
DEVNET_BOR_USERS=ubuntu,ubuntu,ubuntu#users' names of VMs for all the nodes (comma separated). Its length must be equal to "TF_VAR_VALIDATOR_COUNT + TF_VAR_SENTRY_COUNT"
BOR_DOCKER_BUILD_CONTEXT="https://github.com/maticnetwork/bor.git#c5569e4da9ebe0ce4e63aec571966c71234f7cfc" # todo change to develop once https://polygon.atlassian.net/browse/POS-979 is solved (docker build context for bor. Used in docker setup (TF_VAR_DOCKERIZED=yes))
MATIC_CLI_BRANCH=master # matic-cli branch used on the remote machines to start the environment
DEVNET_BOR_USERS=ubuntu,ubuntu,ubuntu # users' names of VMs for all the nodes (comma separated). Its length must be equal to "TF_VAR_BOR_VALIDATOR_COUNT + TF_VAR_BOR_SENTRY_COUNT + TF_VAR_BOR_ARCHIVE_COUNT"
DEVNET_ERIGON_USERS=ubuntu # users' names of VMs for all the nodes (comma separated). Its length must be equal to "TF_VAR_ERIGON_VALIDATOR_COUNT + TF_VAR_ERIGON_SENTRY_COUNT + TF_VAR_ERIGON_ARCHIVE_COUNT"
BOR_DOCKER_BUILD_CONTEXT="https://github.com/maticnetwork/bor.git#develop" # todo change to develop once https://polygon.atlassian.net/browse/POS-979 is solved (docker build context for bor. Used in docker setup (TF_VAR_DOCKERIZED=yes))
HEIMDALL_DOCKER_BUILD_CONTEXT="https://github.com/maticnetwork/heimdall.git#develop" # docker build context for heimdall. Used in docker setup (TF_VAR_DOCKERIZED=yes)
VERBOSE=true# if set to true will print logs also from remote machines
DD_API_KEY=DATADOG_API_KEY# Datadog API key
VERBOSE=true # if set to true will print logs also from remote machines
DD_API_KEY=DATADOG_API_KEY # Datadog API key

# Bor and Heimdall Snapshot related variables (when running mainnet/testnet node)
# Bor, Erigon and Heimdall Snapshot related variables (when running mainnet/testnet node)
BOR_SNAPSHOT_URL=https://snapshot-download.polygon.technology/bor-mumbai-fullnode-2023-03-18.tar.zst # URL for bor data snapshot (refer: https://snapshot.polygon.technology/)
HEIMDALL_SNAPSHOT_URL=https://snapshot-download.polygon.technology/heimdall-mumbai-fullnode-2023-03-18.tar.zst # URL for heimdall data snapshot (refer: https://snapshot.polygon.technology/)
ERIGON_SNAPSHOT_URL= # URL for Erigon data snapshot (refer: https://snapshot.polygon.technology/)

#Stress test variables (used to run stress tests against the remote nodes)
MNEMONIC="clock radar mass judge dismiss just intact mind resemble fringe diary casino" #random mnemonic
SPEED=200# TPS = ~2 * SPEED (Default SPEED = 200; TPS = ~400)
MAX_ACCOUNTS=100000# number of transactions to be sent
FUND=true# boolean flag to fund the accounts or not (use true for first time and false for subsequent runs)
STRESS_DEBUG_LOGS=false# boolean flag to enable debug logs for the stress tests
SPEED=200 # TPS = ~2 * SPEED (Default SPEED = 200; TPS = ~400)
MAX_ACCOUNTS=100000 # number of transactions to be sent
FUND=true # boolean flag to fund the accounts or not (use true for first time and false for subsequent runs)
STRESS_DEBUG_LOGS=false # boolean flag to enable debug logs for the stress tests

#EIP-1559 test variables
BURN_CONTRACT_ADDRESS=0x000000000000000000000000000000000000dead# Burn contract address
MAX_FEE=30000000009# Max fee per gas
MAX_PRIORITY_FEE=30000000000# Max priority fee per gas
COUNT=10# Number of times to execute the test
BURN_CONTRACT_ADDRESS=0x000000000000000000000000000000000000dead # Burn contract address
MAX_FEE=30000000009 # Max fee per gas
MAX_PRIORITY_FEE=30000000000 # Max priority fee per gas
COUNT=10 # Number of times to execute the test

#Shadow fork related variables
SHADOW_CHAIN_ID= #Chain Id of the shadow node (leave empty to get random one)
Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,35 +140,43 @@ The `express-cli` also comes with additional utility commands, listed below. Som

- `../../bin/express-cli --update-all [index]`

- Fetches `heimdall` and `bor` branches defined as `HEIMDALL_BRANCH` and `BOR_BRANCH` in `.env.devnet<id>` file,
pulls relative changes and restarts those services on the remote machines. If an integer `index` is used, the job will be
performed only on the VM corresponding to that index.
- Fetches `heimdall`,`bor` and `erigon` branches defined as `HEIMDALL_BRANCH`, `BOR_BRANCH` and `ERIGON_BRANCH` in `.env. devnet<id>` file, pulls relative changes and restarts those services on the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.

- `../../bin/express-cli --update-bor [index]`

- Fetches `bor` branch defined as `BOR_BRANCH` in `.env.devnet<id>` file, pulls relative changes and restarts it on
the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index.

- `../../bin/express-cli --update-erigon [index]`

- Fetches `erigon` branch defined as `ERIGON_BRANCH` in `.env.devnet<id>` file, pulls relative changes and restarts it on
the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes and you wanted to target the first erigon node, `index` will be 2.

- `../../bin/express-cli --update-heimdall [index]`

- Fetches `heimdall` branch defined as `HEIMDALL_BRANCH` in `.env.devnet<id>` file, pulls relative changes and restarts it on
the remote machines. If an integer `index` is used, the job will be performed only on the VM corresponding to that
index.
index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.

- `../../bin/express-cli --restart-all [index]`

- Restarts `bor` and `heimdall` on all the remote machines. If an integer `index` is used, the job will be performed
only on the VM corresponding to that index.
- Restarts `bor`, `erigon` and `heimdall` on all the remote machines. If an integer `index` is used, the job will be performed
only on the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.

- `../../bin/express-cli --restart-bor [index]`

- Restarts `bor` on all the remote machines. If an integer `index` is used, the job will be performed only on the VM
corresponding to that index.

- `../../bin/express-cli --restart-erigon [index]`

- Restarts `erigon` on all the remote machines. If an integer `index` is used, the job will be performed only on the VM
corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes and you wanted to target the first erigon node, `index` will be 2.

- `../../bin/express-cli --restart-heimdall [index]`

- Restarts `heimdall` on all the remote machines. If an integer `index` is used, the job will be performed only on
the VM corresponding to that index.
the VM corresponding to that index. For example if the devnet consists of 2 bor and erigon nodes, then the indices for bor machines would be 0 and 1 and for erigon it'll be 2 and 3.

- `../../bin/express-cli --cleanup`

Expand All @@ -179,19 +187,19 @@ The `express-cli` also comes with additional utility commands, listed below. Som

- Create a `state-sync` transaction on the remote network

- `../../bin/express-cli --send-staked-event`
- `../../bin/express-cli --send-staked-event [validatorID]`

- Create a `Staked` transaction on the remote network and adds a new validator.

- `../../bin/express-cli --send-stakeupdate-event`
- `../../bin/express-cli --send-stakeupdate-event [validatorID]`

- Create a `StakeUpdate` transaction on the remote network and increase stake of 1st validator by 100 MATIC.

- `../../bin/express-cli --send-signerchange-event`
- `../../bin/express-cli --send-signerchange-event [validatorID]`

- Create a `SignerChange` transaction on the remote network and changes the signer of the 1st validator.

- `../../bin/express-cli --send-topupfee-event`
- `../../bin/express-cli --send-topupfee-event [validatorID]`

- Create a `TopUpFee` transaction on the remote network and adds balance/heimdallFee for the first validator on Heimdall.

Expand Down
6 changes: 3 additions & 3 deletions configs/devnet/docker-setup-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ sprintSize: 64
sprintSizeBlockNumber: 0
blockNumber: '0'
blockTime: '2'
numOfValidators: 1
numOfNonValidators: 1
numOfArchiveNodes: 0
numOfBorValidators: 1
numOfBorSentries: 1
numOfBorArchiveNodes: 0
ethURL: http://ganache:9545
ethHostUser: ubuntu
devnetType: docker
Expand Down
9 changes: 6 additions & 3 deletions configs/devnet/remote-setup-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ sprintSize: 64
sprintSizeBlockNumber: 0
blockNumber: '0'
blockTime: '2'
numOfValidators: 1
numOfNonValidators: 1
numOfArchiveNodes: 0
numOfBorValidators: 1
numOfBorSentries: 1
numOfBorArchiveNodes: 0
numOfErigonValidators: 1
numOfErigonSentries: 1
numOfErigonArchiveNodes: 0
ethURL: http://ec2-xx-xxx-xxx-xx.us-west-2.compute.amazonaws.com:9545
ethHostUser: ubuntu
devnetType: remote
Expand Down
3F66 Loading
0