diff --git a/.github/workflows/testnet_tests.yml b/.github/workflows/testnet_tests.yml new file mode 100644 index 0000000..5fcddc5 --- /dev/null +++ b/.github/workflows/testnet_tests.yml @@ -0,0 +1,112 @@ +name: testnet tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + besu: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: testnet + el_name: besu + cl_name: ${{matrix.cl_name}} + # erigon: + # runs-on: ubuntu-24.04 + # strategy: + # matrix: + # cl_name: + # - lighthouse + # - lodestar + # - nimbus-eth2 + # - prysm + # - teku + # fail-fast: false + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - uses: ./node-test + # with: + # network: testnet + # el_name: erigon + # cl_name: ${{matrix.cl_name}} + # geth: + # runs-on: ubuntu-24.04 + # strategy: + # matrix: + # cl_name: + # - lighthouse + # - lodestar + # - nimbus-eth2 + # - prysm + # - teku + # fail-fast: false + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - uses: ./node-test + # with: + # network: testnet + # el_name: geth + # cl_name: ${{matrix.cl_name}} + + # nethermind: + # runs-on: ubuntu-24.04 + # strategy: + # matrix: + # cl_name: + # - lighthouse + # - lodestar + # - nimbus-eth2 + # - prysm + # - teku + # fail-fast: false + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - uses: ./node-test + # with: + # network: testnet + # el_name: nethermind + # cl_name: ${{matrix.cl_name}} + # reth: + # runs-on: ubuntu-24.04 + # strategy: + # matrix: + # cl_name: + # - lighthouse + # - lodestar + # - nimbus-eth2 + # - prysm + # - teku + # fail-fast: false + # steps: + # - name: Checkout code + # uses: actions/checkout@v4 + + # - uses: ./node-test + # with: + # networK: testnet + # el_name: reth + # cl_name: ${{matrix.cl_name}} diff --git a/README.md b/README.md index 7b7da0c..c8bb794 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,12 @@ # run-a-node +[![mainnet](https://github.com/eth-pkg/run-a-node/actions/workflows/mainnet_tests.yml/badge.svg)](https://github.com/eth-pkg/run-a-node/actions/workflows/mainnet_tests.yml) +[![holesky](https://github.com/eth-pkg/run-a-node/actions/workflows/holesky_tests.yml/badge.svg)](https://github.com/eth-pkg/run-a-node/actions/workflows/holesky_tests.yml) +[![sepolia](https://github.com/eth-pkg/run-a-node/actions/workflows/sepolia_tests.yml/badge.svg)](https://github.com/eth-pkg/run-a-node/actions/workflows/sepolia_tests.yml) + +[![testnet](https://github.com/eth-pkg/run-a-node/actions/workflows/testnet_tests.yml/badge.svg)](https://github.com/eth-pkg/run-a-node/actions/workflows/testnet_tests.yml) +[![ephemery](https://github.com/eth-pkg/run-a-node/actions/workflows/ephemery_tests.yml/badge.svg)](https://github.com/eth-pkg/run-a-node/actions/workflows/ephemery_tests.yml) + This repository features two main components: the `run-a-node` top-level node running script and the `run-a-client` standardized script. The `run-a-client` script is designed to run each client uniformly, respecting each client's unique options while providing a minimal abstraction layer. This allows users to easily run clients without delving into detailed configurations until they are ready to modify specific config values. Options are moved into configuration files, which are provided through CLI variables, ensuring a consistent format for each client. However, specific client configuration files can still be used if needed. @@ -10,6 +17,7 @@ This repository was created as a result of the `eth-nodes` Debian packaging proj **NOTE:** This repository is under active development. The code can change drastically, and bugs should be expected. + ## Running a Client Pair Open two terminals and execute the following commands: @@ -39,3 +47,23 @@ The available options for both `run-a-client` and `run-a-node` scripts are: - ``: ephemery, holesky, mainnet, sepolia, testnet - ``: lighthouse, lodestar, nimbus-eth2, prsym, teku - ``: besu, erigon, geth, nethermind, reth + + +## Running tests + + +```bash +bats --show-output-of-passing-tests tests/test_.bats +``` + +If you want to filter by client or client pair, (timeout is based on how slow or fast your internet download speed) + +```bash +timeout 11m bats --show-output-of-passing-tests tests/test_.bats --filter +``` + +or by client pair + +```bash +timeout 25m bats --show-output-of-passing-tests tests/test_.bats --filter - +``` \ No newline at end of file diff --git a/clients/besu/24.5.1/run-besu.sh b/clients/besu/24.5.1/run-besu.sh index 0542500..38e52f4 100755 --- a/clients/besu/24.5.1/run-besu.sh +++ b/clients/besu/24.5.1/run-besu.sh @@ -2,7 +2,6 @@ set -e - display_help() { echo "Usage: $0 [OPTIONS]" echo "" @@ -248,4 +247,4 @@ append_option "--bonsai-limit-trie-logs-enabled" "$BESU_CLI_BONSAI_LIMIT_TRIE_LO echo "Running: besu $OPTIONS" -besu $OPTIONS \ No newline at end of file +exec besu $OPTIONS \ No newline at end of file diff --git a/clients/erigon/2.60.0/run-erigon.sh b/clients/erigon/2.60.0/run-erigon.sh index ac46a6e..0a2cd6d 100755 --- a/clients/erigon/2.60.0/run-erigon.sh +++ b/clients/erigon/2.60.0/run-erigon.sh @@ -292,4 +292,4 @@ add_option "--config" "$ERIGON_CLI_CONFIG" echo "Using Options: erigon $OPTIONS" -erigon $OPTIONS \ No newline at end of file +exec erigon $OPTIONS \ No newline at end of file diff --git a/clients/geth/1.14.3/run-geth.sh b/clients/geth/1.14.3/run-geth.sh index 38a5729..1c63c7b 100755 --- a/clients/geth/1.14.3/run-geth.sh +++ b/clients/geth/1.14.3/run-geth.sh @@ -269,4 +269,4 @@ fi echo "Using Options: geth $OPTIONS" -geth $OPTIONS +exec geth $OPTIONS diff --git a/clients/lighthouse/5.1.3/run-lighthouse.sh b/clients/lighthouse/5.1.3/run-lighthouse.sh index bf31114..d189cd4 100755 --- a/clients/lighthouse/5.1.3/run-lighthouse.sh +++ b/clients/lighthouse/5.1.3/run-lighthouse.sh @@ -238,4 +238,4 @@ append_option "--wss-checkpoint" "$LIGHTHOUSE_CLI_BN_WSS_CHECKPOINT" echo "Starting lighthouse beacon_node $OPTIONS" -lighthouse beacon_node $OPTIONS \ No newline at end of file +exec lighthouse beacon_node $OPTIONS \ No newline at end of file diff --git a/clients/lighthouse/5.1.3/run-validator.sh b/clients/lighthouse/5.1.3/run-validator.sh index dce55e5..e78f994 100755 --- a/clients/lighthouse/5.1.3/run-validator.sh +++ b/clients/lighthouse/5.1.3/run-validator.sh @@ -1,4 +1,6 @@ -set -e +#!/usr/bin/env bash + +set -e display_help() { echo "Usage: $0 [OPTIONS]" @@ -147,4 +149,4 @@ append_option "--web3-signer-max-idle-connections" "$LIGHTHOUSE_CLI_VALIDATOR_WE echo "Using Options: $OPTIONS" -lighthouse validator_client $OPTIONS \ No newline at end of file +exec lighthouse validator_client $OPTIONS \ No newline at end of file diff --git a/clients/lodestar/1.18.1/run-lodestar.sh b/clients/lodestar/1.18.1/run-lodestar.sh index 3b3679b..d4d073b 100755 --- a/clients/lodestar/1.18.1/run-lodestar.sh +++ b/clients/lodestar/1.18.1/run-lodestar.sh @@ -158,4 +158,6 @@ append_option "--network.connectToDiscv5Bootnodes" "$LODESTAR_CLI_NETWORK_CONNEC append_option "--genesisStateFile" "$LODESTAR_CLI_BN_GENSIS_STATE_FILE" echo "Starting lodestar beacon $OPTIONS" -lodestar beacon $OPTIONS + +# on ci the postrm fails, so it not in path +exec /usr/lib/eth-node-lodestar/bin/lodestar beacon $OPTIONS diff --git a/clients/lodestar/1.18.1/run-validator.sh b/clients/lodestar/1.18.1/run-validator.sh index 1127867..493f777 100644 --- a/clients/lodestar/1.18.1/run-validator.sh +++ b/clients/lodestar/1.18.1/run-validator.sh @@ -132,4 +132,4 @@ append_flag "--distributed" "$LODESTAR_CLI_VALIDATOR_DISTRIBUTED" echo "Using Options: $OPTIONS" -docker run chainsafe/lodestar validator $OPTIONS \ No newline at end of file +exec docker run chainsafe/lodestar validator $OPTIONS \ No newline at end of file diff --git a/clients/nethermind/1.26.0/run-nethermind.sh b/clients/nethermind/1.26.0/run-nethermind.sh index 4e149da..5dc8a2b 100755 --- a/clients/nethermind/1.26.0/run-nethermind.sh +++ b/clients/nethermind/1.26.0/run-nethermind.sh @@ -563,4 +563,5 @@ append_option "--Wallet.DevAccounts" "$NETHERMIND_CLI_WALLET_DEV_ACCOUNTS" echo "Using Options: nethermind $OPTIONS" -nethermind $OPTIONS \ No newline at end of file +# CI problem again, with cache +exec /usr/lib/eth-node-nethermind/bin/Nethermind.Runner/release/nethermind $OPTIONS \ No newline at end of file diff --git a/clients/nimbus-eth2/24.5.1/run-nimbus-eth2.sh b/clients/nimbus-eth2/24.5.1/run-nimbus-eth2.sh index 2d66716..977a219 100755 --- a/clients/nimbus-eth2/24.5.1/run-nimbus-eth2.sh +++ b/clients/nimbus-eth2/24.5.1/run-nimbus-eth2.sh @@ -1,12 +1,12 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash -set -e +set -e display_help() { echo "Usage: $0 [OPTIONS]" echo "" echo "Options:" - echo " --conf-file FILE, -e FILE Path to .conf formatted configuration file." + echo " --conf-file FILE, -e FILE Path to .conf formatted configuration file." echo " --help, -h Displays this help text and exits." echo " --version, -v Displays the version and exits." exit 0 @@ -24,22 +24,22 @@ VERSION=false while [[ "$#" -gt 0 ]]; do case $1 in - --conf-file|-e) - CONFIG_FILES+=("$2") - shift 2 - ;; - --help|-h) - HELP=true - shift - ;; - --version|-v) - VERSION=true - shift - ;; - *) - echo "Error: Unknown option $1" - display_help - ;; + --conf-file | -e) + CONFIG_FILES+=("$2") + shift 2 + ;; + --help | -h) + HELP=true + shift + ;; + --version | -v) + VERSION=true + shift + ;; + *) + echo "Error: Unknown option $1" + display_help + ;; esac done @@ -69,15 +69,15 @@ done OPTIONS="" add_option() { - local option=$1 - local value=$2 - if [ -n "$value" ]; then - if [ "$value" == "" ];then - OPTIONS="$OPTIONS $option" - else - OPTIONS="$OPTIONS $option=$value" - fi - fi + local option=$1 + local value=$2 + if [ -n "$value" ]; then + if [ "$value" == "" ]; then + OPTIONS="$OPTIONS $option" + else + OPTIONS="$OPTIONS $option=$value" + fi + fi } add_option "--config-file" "$NIMBUS_ETH2_CONFIG_FILE" @@ -159,8 +159,22 @@ add_option "--payload-builder-url" "$NIMBUS_ETH2_PAYLOAD_BUILDER_URL" add_option "--local-block-value-boost" "$NIMBUS_ETH2_LOCAL_BLOCK_VALUE_BOOST" add_option "--history" "$NIMBUS_ETH2_HISTORY" -echo "Using Options: $OPTIONS" -echo "Using Options: nimbus-eth2 $OPTIONS" +echo "Using Options: nimbus_beacon_node $OPTIONS" + +# hack to download state before starting client +if [ -n "$NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE" ]; then + echo "Downloading checkpoint state for nimbus-eth2" + echo "curl -o $NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE \ + -H 'Accept: application/octet-stream' \ + $BASE_CONFIG_CL_CHECKPPOINT_SYNC_URLr/eth/v2/debug/beacon/states/finalized" + if [ "$NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE" != "" ]; then + curl -o $NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE \ + -H 'Accept: application/octet-stream' \ + $BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL/eth/v2/debug/beacon/states/finalized + + fi +fi -nimbus_beacon_node $OPTIONS \ No newline at end of file +# on ci the postrm fails, so it not in path +exec /usr/lib/eth-node-nimbus-eth2/bin/nimbus_beacon_node $OPTIONS diff --git a/clients/nimbus-eth2/24.5.1/run-validator.sh b/clients/nimbus-eth2/24.5.1/run-validator.sh index 297b70b..f1fd214 100644 --- a/clients/nimbus-eth2/24.5.1/run-validator.sh +++ b/clients/nimbus-eth2/24.5.1/run-validator.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e display_help() { @@ -84,4 +86,5 @@ append_flag(){ echo "Using Options: $OPTIONS" -/usr/lib/eth-node-nimbus-eth2/bin/validator $OPTIONS \ No newline at end of file +# TODO +exec /usr/lib/eth-node-nimbus-eth2/bin/validator $OPTIONS \ No newline at end of file diff --git a/clients/prysm/5.0.3/run-prysm.sh b/clients/prysm/5.0.3/run-prysm.sh index 967d65f..1226186 100755 --- a/clients/prysm/5.0.3/run-prysm.sh +++ b/clients/prysm/5.0.3/run-prysm.sh @@ -120,7 +120,6 @@ append_flag "--slasher" "$PRSYM_CLI_SLASHER" append_flag "--interop-eth1data-votes" "$PRSYM_CLI_INTEROP_ETH1DATA_VOTES" append_flag "--force-clear-db" "$PRSYM_CLI_FORCE_CLEAR_DB" - append_option "--api-timeout" "$PRSYM_CLI_API_TIMEOUT" append_option "--bootstrap-node" "$PRSYM_CLI_BOOTSTRAP_NODE" append_option "--chain-config-file" "$PRSYM_CLI_CHAIN_CONFIG_FILE" @@ -218,4 +217,5 @@ append_option "--interop-num-validators" "$PRSYM_CLI_INTEROP_NUM_VALIDATORS" echo "Using Options: beacon-chain $OPTIONS" -beacon-chain $OPTIONS \ No newline at end of file +# on ci the postrm fails, so it not in path +exec /usr/lib/eth-node-prysm/bin/beacon-chain $OPTIONS \ No newline at end of file diff --git a/clients/prysm/5.0.3/run-validator.sh b/clients/prysm/5.0.3/run-validator.sh index b0a013a..50cb119 100755 --- a/clients/prysm/5.0.3/run-validator.sh +++ b/clients/prysm/5.0.3/run-validator.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e display_help() { @@ -167,4 +169,5 @@ append_option "--interop-start-index" "$PRYSM_CLI_VALIDATOR_INTEROP_START_INDEX" echo "Using Options: $OPTIONS" -/usr/lib/eth-node-prysm/bin/validator $OPTIONS \ No newline at end of file +# TODO +exec /usr/lib/eth-node-prysm/bin/validator $OPTIONS \ No newline at end of file diff --git a/clients/reth/1.0.0/run-reth.sh b/clients/reth/1.0.0/run-reth.sh index fe02d3b..be1802a 100755 --- a/clients/reth/1.0.0/run-reth.sh +++ b/clients/reth/1.0.0/run-reth.sh @@ -201,4 +201,4 @@ append_flag "--quiet" "$RETH_CLI_NODE_QUIET" echo "Starting node with options: reth node $OPTIONS" -reth node $OPTIONS \ No newline at end of file +exec reth node $OPTIONS \ No newline at end of file diff --git a/clients/teku/24.4.0/run-teku.sh b/clients/teku/24.4.0/run-teku.sh index 2e2661f..1097aaa 100755 --- a/clients/teku/24.4.0/run-teku.sh +++ b/clients/teku/24.4.0/run-teku.sh @@ -182,4 +182,4 @@ append_option "--metrics-publish-interval" "$TEKU_CLI_METRICS_PUBLISH_INTERVAL" echo "Using Options: $OPTIONS" -teku $OPTIONS \ No newline at end of file +exec teku $OPTIONS \ No newline at end of file diff --git a/clients/teku/24.4.0/run-validator.sh b/clients/teku/24.4.0/run-validator.sh index 217c818..5b4613b 100755 --- a/clients/teku/24.4.0/run-validator.sh +++ b/clients/teku/24.4.0/run-validator.sh @@ -1,3 +1,5 @@ +#!/usr/bin/env bash + set -e display_help() { @@ -141,4 +143,4 @@ append_option "--validators-proposer-default-fee-recipient" $TEKU_CLI_VALIDATOR_ echo "Using Options: $OPTIONS" -teku validator-client $OPTIONS \ No newline at end of file +exec teku validator-client $OPTIONS \ No newline at end of file diff --git a/handle_ephemery.sh b/handle_ephemery.sh index 601aa60..28ce98c 100644 --- a/handle_ephemery.sh +++ b/handle_ephemery.sh @@ -1,16 +1,20 @@ -#!/usr/bin/env bash +#!/usr/bin/env bash set -e -if [ "$network" == "ephemery" ]; then - echo "fetching ephemery state" +if [ "$network" == "ephemery" ]; then # TODO option to reset # rm -rf $ephemery_dir - if [ ! -d "$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR" ];then - wget -q https://github.com/ephemery-testnet/ephemery-genesis/releases/download/ephemery-111/testnet-all.tar.gz - mkdir $BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR && tar -xzf testnet-all.tar.gz -C $BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR - rm testnet-all.tar.gz - fi + echo "$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR" + if [ ! -d "$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR" ]; then + echo "fetching ephemery state" + rm -f testnet-all.tar.gz + wget https://github.com/ephemery-testnet/ephemery-genesis/releases/download/ephemery-111/testnet-all.tar.gz -O testnet-all.tar.gz + mkdir -p $BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR && tar -xzf testnet-all.tar.gz -C $BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR + rm testnet-all.tar.gz + else + echo "ephemery state already exists" + fi BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID=$(cat $BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/genesis.json | grep chainId | tr -d ',' | sed 's/"chainId"://g' | tr -d '[:space:]') ENR_FILE="$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/boot_enr.txt" BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR=$(awk '{printf "%s,", $0}' "$ENR_FILE" | sed -e "s/- enr/enr/g" -e 's/,$//') diff --git a/network/ephemery/cl/lighthouse/lighthouse-ephemery.conf b/network/ephemery/cl/lighthouse/lighthouse-ephemery.conf index a49f688..3b33ce8 100644 --- a/network/ephemery/cl/lighthouse/lighthouse-ephemery.conf +++ b/network/ephemery/cl/lighthouse/lighthouse-ephemery.conf @@ -26,4 +26,11 @@ LIGHTHOUSE_CLI_BN_BOOT_NODES=$BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR # Enable syncing from genesis, which is generally insecure and incompatible with data availability checks. Checkpoint syncing is the preferred method for syncing a node. Only use this flag when testing. DO NOT use on mainnet! # MUST be set for ephemery -LIGHTHOUSE_CLI_BN_ALLOW_INSECURE_GENESIS_SYNC=true \ No newline at end of file +LIGHTHOUSE_CLI_BN_ALLOW_INSECURE_GENESIS_SYNC=true + +LIGHTHOUSE_CLI_BN_HTTP=true + +LIGHTHOUSE_CLI_BN_HTTP_PORT=$BASE_CONFIG_CL_RPC_PORT + +# TODO remove +LIGHTHOUSE_CLI_BN_HTTP_ALLOW_ORIGIN=* \ No newline at end of file diff --git a/network/ephemery/cl/lodestar/lodestar-ephemery.conf b/network/ephemery/cl/lodestar/lodestar-ephemery.conf index 160c471..06fd12d 100644 --- a/network/ephemery/cl/lodestar/lodestar-ephemery.conf +++ b/network/ephemery/cl/lodestar/lodestar-ephemery.conf @@ -25,7 +25,7 @@ LODESTAR_CLI_DEV_REST_PORT=9597 LODESTAR_CLI_DEV_PORT=9000 # Pick namespaces to expose for HTTP API -LODESTAR_CLI_BN_REST_NAMESPACE=* +LODESTAR_CLI_BN_REST_NAMESPACE=eth # Set host for HTTP API LODESTAR_CLI_BN_REST_ADDRESS=127.0.0.1 @@ -46,3 +46,13 @@ LODESTAR_CLI_BN_GENSIS_STATE_FILE=$BASE_CONFIG_CUSTOM_NETWORK_GENESIS_STATE # Bootnodes for discv5 discovery LODESTAR_CLI_DEV_BOOTNODES= + + +# Enable/disable HTTP API +LODESTAR_CLI_BN_REST=true + +# Pick namespaces to expose for HTTP API +LODESTAR_CLI_BN_REST_NAMESPACE=eth + +# Set port for HTTP API +LODESTAR_CLI_BN_REST_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/ephemery/cl/nimbus-eth2/nimbus-eth2-ephemery.conf b/network/ephemery/cl/nimbus-eth2/nimbus-eth2-ephemery.conf index 3236455..9689004 100644 --- a/network/ephemery/cl/nimbus-eth2/nimbus-eth2-ephemery.conf +++ b/network/ephemery/cl/nimbus-eth2/nimbus-eth2-ephemery.conf @@ -29,7 +29,7 @@ NIMBUS_ETH2_REST_PORT= NIMBUS_ETH2_REST_ADDRESS= # Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). -NIMBUS_ETH2_REST_ALLOW_ORIGIN=* +NIMBUS_ETH2_REST_ALLOW_ORIGIN=localhost # If enabled, the beacon node prudently listens for 2 epochs for attestations from a validator with the same index (a doppelganger), before sending an attestation itself. This protects against slashing (due to double-voting) but means you will miss two attestations when restarting. [=true]. NIMBUS_ETH2_DOPPELGANGER_DETECTION=false @@ -37,5 +37,14 @@ NIMBUS_ETH2_DOPPELGANGER_DETECTION=false # Subscribe to all subnet topics when gossiping [=false]. NIMBUS_ETH2_SUBSCRIBE_ALL_SUBNETS=true +# Enable the REST server [=false]. +NIMBUS_ETH2_REST=true +# Port for the REST server [=5052]. +NIMBUS_ETH2_REST_PORT=$BASE_CONFIG_CL_RPC_PORT +# Listening address of the REST server [=127.0.0.1]. +NIMBUS_ETH2_REST_ADDRESS= + +# Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). +NIMBUS_ETH2_REST_ALLOW_ORIGIN= \ No newline at end of file diff --git a/network/ephemery/cl/prysm/prysm-ephemery.conf b/network/ephemery/cl/prysm/prysm-ephemery.conf index b857902..407e185 100644 --- a/network/ephemery/cl/prysm/prysm-ephemery.conf +++ b/network/ephemery/cl/prysm/prysm-ephemery.conf @@ -48,4 +48,21 @@ PRSYM_CLI_CONTRACT_DEPLOYMENT_BLOCK=0 PRSYM_CLI_MIN_SYNC_PEERS=0 # Path to a YAML file with chain config values -PRSYM_CLI_CHAIN_CONFIG_FILE=$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/config.yaml \ No newline at end of file +PRSYM_CLI_CHAIN_CONFIG_FILE=$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/config.yaml + + + +# Disable the gRPC gateway for JSON-HTTP requests (default: false) +PRSYM_CLI_DISABLE_GRPC_GATEWAY=false + +# Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. (default: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000") +PRSYM_CLI_GRPC_GATEWAY_CORSDOMAIN= + +# The host on which the gateway server runs on (default: "127.0.0.1") +PRSYM_CLI_GRPC_GATEWAY_HOST= + +# The port on which the gateway server runs on (default: 3500) +PRSYM_CLI_GRPC_GATEWAY_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Comma-separated list of API module names. Possible values: prysm,eth. (default: "prysm,eth") +PRSYM_CLI_HTTP_MODULES=eth \ No newline at end of file diff --git a/network/ephemery/cl/teku/teku-ephemery.conf b/network/ephemery/cl/teku/teku-ephemery.conf index 0c035a8..82957e6 100644 --- a/network/ephemery/cl/teku/teku-ephemery.conf +++ b/network/ephemery/cl/teku/teku-ephemery.conf @@ -20,4 +20,23 @@ TEKU_CLI_P2P_DISCOVERY_BOOTNODES=$BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR TEKU_CLI_GENESIS_STATE=$BASE_CONFIG_CUSTOM_NETWORK_GENESIS_STATE # Allows syncing outside of the weak subjectivity period. Default: false -TEKU_CLI_IGNORE_WEAK_SUBJECTIVITY_PERIOD_ENABLED=true \ No newline at end of file +TEKU_CLI_IGNORE_WEAK_SUBJECTIVITY_PERIOD_ENABLED=true + +# THIS optiosn will be modular only for TESTS +# Comma separated list of origins to allow, or * to allow any origin. Default: [] +TEKU_CLI_REST_API_CORS_ORIGINS= + +# Enable swagger-docs and swagger-ui endpoints. Default: false +TEKU_CLI_REST_API_DOCS_ENABLED= + +# Enables Beacon Rest API. Default: null +TEKU_CLI_REST_API_ENABLED=true + +# Comma-separated list of hostnames to allow, or * to allow any host. Default: [127.0.0.1, localhost] +TEKU_CLI_REST_API_HOST_ALLOWLIST= + +# Interface of Beacon Rest API. Default: 127.0.0.1 +TEKU_CLI_REST_API_INTERFACE= + +# Port number of Beacon Rest API. +TEKU_CLI_REST_API_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/ephemery/el/besu/besu-ephemery.conf b/network/ephemery/el/besu/besu-ephemery.conf index e8fe159..bfa45ee 100644 --- a/network/ephemery/el/besu/besu-ephemery.conf +++ b/network/ephemery/el/besu/besu-ephemery.conf @@ -16,44 +16,12 @@ BESU_CLI_NETWORK_ID=$BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID # Logging verbosity levels: OFF, ERROR, WARN, INFO, DEBUG, TRACE, ALL (default: INFO) BESU_CLI_LOGGING= -# Comma separated list of hostnames to allow for RPC access, or * to accept any host (default: localhost,127.0.0.1) -BESU_CLI_HOST_ALLOWLIST=* - -# Set to start the JSON-RPC HTTP service (default: false) -BESU_CLI_RPC_HTTP_ENABLED=true - -# Host for JSON-RPC HTTP to listen on (default: null) -BESU_CLI_RPC_HTTP_HOST=127.0.0.1 - -# Port for JSON-RPC HTTP to listen on (default: 8545) -BESU_CLI_RPC_HTTP_PORT= - -# Comma separated list of APIs to enable on JSON-RPC HTTP service (default: [ETH, NET, WEB3]) -BESU_CLI_RPC_HTTP_API=ADMIN,CLIQUE,ETH,NET,DEBUG,TXPOOL,ENGINE,TRACE,WEB3 - -# Set to start the JSON-RPC WebSocket service (default: false) -BESU_CLI_RPC_WS_ENABLED=true - -# Host for JSON-RPC WebSocket service to listen on (default: null) -BESU_CLI_RPC_WS_HOST=127.0.0.1 - -# Comma separated list of APIs to enable on JSON-RPC WebSocket service (default: [ETH, NET, WEB3]) -BESU_CLI_RPC_WS_API=ADMIN,CLIQUE,ETH,NET,DEBUG,TXPOOL,ENGINE,TRACE,WEB3 - -# Enable P2P functionality (default: true) -BESU_CLI_P2P_ENABLED= - -# IP address this node advertises to its peers (default: 127.0.0.1) -BESU_CLI_P2P_HOST= - -# Port on which to listen for P2P communication (default: 30303) -BESU_CLI_P2P_PORT= # Enable the engine api, even in the absence of merge-specific configurations (default: false) BESU_CLI_ENGINE_RPC_ENABLED=true # Comma separated list of hostnames to allow for RPC access, or * to accept any host (default: localhost,127.0.0.1) -BESU_CLI_HOST_ALLOWLIST=* +BESU_CLI_HOST_ALLOWLIST=localhost # Synchronization mode, possible values are FULL, FAST, SNAP, CHECKPOINT, X_SNAP, X_CHECKPOINT (default: SNAP if a --network is supplied and privacy isn't enabled. FULL otherwise.) BESU_CLI_SYNC_MODE=full @@ -63,3 +31,10 @@ BESU_CLI_GENESIS_FILE=$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/besu.json # --bonsai-limit-trie-logs-enabled BESU_CLI_BONSAI_LIMIT_TRIE_LOGS_ENABLED=false + + +BESU_CLI_RPC_HTTP_API=ETH + +BESU_CLI_RPC_HTTP_ENABLED=true + +BESU_CLI_RPC_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT \ No newline at end of file diff --git a/network/ephemery/el/erigon/erigon-ephemery.conf b/network/ephemery/el/erigon/erigon-ephemery.conf index 366e458..aa21bd6 100644 --- a/network/ephemery/el/erigon/erigon-ephemery.conf +++ b/network/ephemery/el/erigon/erigon-ephemery.conf @@ -8,7 +8,22 @@ ERIGON_CLI_DATADIR=$BASE_CONFIG_DATA_DIR ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_HTTP_VHOSTS=* +ERIGON_CLI_HTTP_VHOSTS=localhost + +# Enable the WS-RPC server +ERIGON_CLI_WS=true + +# Allow insecure account unlocking when account-related RPCs are exposed by http +ERIGON_CLI_ALLOW_INSECURE_UNLOCK=true + +# JSON-RPC server (enabled by default). Use HTTP=false to disable it. +ERIGON_CLI_HTTP=true + +# APIs offered over the HTTP-RPC interface +ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin + +# Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. +ERIGON_CLI_HTTP_VHOSTS=localhost # Enable the WS-RPC server ERIGON_CLI_WS=true @@ -23,20 +38,10 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of domains from which to accept cross-origin requests (browser enforced) -ERIGON_CLI_HTTP_CORSDOMAIN=* - +ERIGON_CLI_HTTP_CORSDOMAIN=localhost # HTTP-RPC server listening interface for the Engine API ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_AUTHRPC_VHOSTS=* - -# Path to the token that ensures safe connection between CL and EL -ERIGON_CLI_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE - -# JSON-RPC server (enabled by default). Use HTTP=false to disable it. -ERIGON_CLI_HTTP=true - -# Comma separated enode URLs for P2P discovery bootstrap -ERIGON_CLI_BOOTNODES=$BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR +ERIGON_CLI_AUTHRPC_VHOSTS=localhost diff --git a/network/ephemery/el/nethermind/nethermind-ephemery.conf b/network/ephemery/el/nethermind/nethermind-ephemery.conf index 40f5027..fed7bb2 100644 --- a/network/ephemery/el/nethermind/nethermind-ephemery.conf +++ b/network/ephemery/el/nethermind/nethermind-ephemery.conf @@ -1,21 +1,6 @@ # Data directory NETHERMIND_CLI_DATADIR=$BASE_CONFIG_DATA_DIR -# Whether to enable WebSocket service for the default JSON-RPC port on startup. (DEFAULT: true) -NETHERMIND_CLI_INIT_WEB_SOCKETS_ENABLED=true - -# An array of JSON-RPC namespaces to enable. For instance, `[debug,eth]`. Built-in namespaces: - `admin` - `client` - `debug` - `engine` - `eth` - `evm` - `health` - `net` - `parity` - `personal` - `proof` - `rpc` - `subscribe` - `trace` - `txpool` - `web3` (DEFAULT: [Eth,Subscribe,Trace,TxPool,Web3,Personal,Proof,Net,Parity,Health,Rpc]) -NETHERMIND_CLI_JSON_RPC_ENABLED_MODULES=et,eth,consensus,subscribe,web3,admin - -# The JSON-RPC service host. (DEFAULT: 127.0.0.1) -NETHERMIND_CLI_JSON_RPC_HOST=127.0.0.1 - -# The Engine API host. (DEFAULT: 127.0.0.1) -NETHERMIND_CLI_JSON_RPC_ENGINE_HOST=127.0.0.1 - -# The Engine API port. (DEFAULT: null) -NETHERMIND_CLI_JSON_RPC_ENGINE_PORT=8551 - # The path to the JWT secret file required for the Engine API authentication. (DEFAULT: keystore/jwt-secret) NETHERMIND_CLI_JSON_RPC_JWT_SECRET_FILE=$BASE_CONFIG_SECRETS_FILE diff --git a/network/ephemery/el/reth/reth-ephemery.conf b/network/ephemery/el/reth/reth-ephemery.conf index 5f21fbb..022b9fe 100644 --- a/network/ephemery/el/reth/reth-ephemery.conf +++ b/network/ephemery/el/reth/reth-ephemery.conf @@ -7,3 +7,22 @@ RETH_CLI_NODE_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE RETH_CLI_NODE_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP RETH_CLI_NODE_AUTHRPC_PORT=$BASE_CONFIG_ENGINE_API_PORT + + +# Enable the HTTP-RPC server +RETH_CLI_NODE_HTTP=true + +# Http server address to listen on +# Default: 127.0.0.1 +RETH_CLI_NODE_HTTP_ADDR= + +# Http server port to listen on +# Default: 8545 +RETH_CLI_NODE_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT + +# Rpc Modules to be configured for the HTTP server +# Possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle +RETH_CLI_NODE_HTTP_API=eth + +# Http Corsdomain to allow request from +RETH_CLI_NODE_HTTP_CORSDOMAIN=localhost \ No newline at end of file diff --git a/network/ephemery/ephemery.conf b/network/ephemery/ephemery.conf index 8d17587..d604778 100644 --- a/network/ephemery/ephemery.conf +++ b/network/ephemery/ephemery.conf @@ -29,19 +29,19 @@ BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID= # execution_client only options BASE_CONFIG_EL_METRICS_PORT= BASE_CONFIG_EL_WS_PORT= -BASE_CONFIG_EL_RPC_PORT= +BASE_CONFIG_EL_RPC_PORT=8545 BASE_CONFIG_EL_P2P_PORT= # consensus_client only options BASE_CONFIG_CL_BEACON_API_URL= -BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL= +BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://ephemery.beaconstate.ethstaker.cc/ BASE_CONFIG_CL_METRICS_PORT= -BASE_CONFIG_CL_RPC_PORT= +BASE_CONFIG_CL_RPC_PORT=5052 BASE_CONFIG_CL_P2P_PORT= # validator related options shared between consensus client & validator BASE_CONFIG_VALIDATOR_DATADIR=$BASE_CONFIG_DATA_DIR/validator -BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=BASE_CONFIG_ENGINE_HOST:4000 +BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=$BASE_CONFIG_ENGINE_HOST:4000 BASE_CONFIG_VALIDATOR_NUM_VALIDATORS=64 BASE_CONFIG_VALIDATOR_SHARED_FEE_RECEIPENT_ADDRESS=0x123463a4b065722e99115d6c222f267d9cabb524 \ No newline at end of file diff --git a/network/holesky/cl/lighthouse/lighthouse-holesky.conf b/network/holesky/cl/lighthouse/lighthouse-holesky.conf index e4fad2e..ddbb85e 100644 --- a/network/holesky/cl/lighthouse/lighthouse-holesky.conf +++ b/network/holesky/cl/lighthouse/lighthouse-holesky.conf @@ -16,3 +16,10 @@ LIGHTHOUSE_CLI_BN_EXECUTION_ENDPOINT=$BASE_CONFIG_ENDPOINT_URL # File path which contains the hex-encoded JWT secret for the execution endpoint provided in the --execution-endpoint flag. LIGHTHOUSE_CLI_BN_EXECUTION_JWT=$BASE_CONFIG_SECRETS_FILE + +LIGHTHOUSE_CLI_BN_HTTP=true + +LIGHTHOUSE_CLI_BN_HTTP_PORT=$BASE_CONFIG_CL_RPC_PORT + +# TODO remove +LIGHTHOUSE_CLI_BN_HTTP_ALLOW_ORIGIN=* \ No newline at end of file diff --git a/network/holesky/cl/lodestar/lodestar-holesky.conf b/network/holesky/cl/lodestar/lodestar-holesky.conf index 4d79511..cd88789 100644 --- a/network/holesky/cl/lodestar/lodestar-holesky.conf +++ b/network/holesky/cl/lodestar/lodestar-holesky.conf @@ -11,4 +11,13 @@ LODESTAR_CLI_BN_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE LODESTAR_CLI_BN_EXECUTION_URLS=$BASE_CONFIG_ENDPOINT_URL # Server URL hosting Beacon Node APIs to fetch weak subjectivity state -LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL \ No newline at end of file +LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# Enable/disable HTTP API +LODESTAR_CLI_BN_REST=true + +# Pick namespaces to expose for HTTP API +LODESTAR_CLI_BN_REST_NAMESPACE=eth + +# Set port for HTTP API +LODESTAR_CLI_BN_REST_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/holesky/cl/nimbus-eth2/nimbus-eth2-holesky.conf b/network/holesky/cl/nimbus-eth2/nimbus-eth2-holesky.conf index 7d44ecf..89cdd06 100644 --- a/network/holesky/cl/nimbus-eth2/nimbus-eth2-holesky.conf +++ b/network/holesky/cl/nimbus-eth2/nimbus-eth2-holesky.conf @@ -8,4 +8,24 @@ NIMBUS_ETH2_DATA_DIR=$BASE_CONFIG_DATA_DIR NIMBUS_ETH2_WEB3_URL=$BASE_CONFIG_ENDPOINT_URL # A file containing the hex-encoded 256 bit secret key to be used for verifying/generating JWT tokens. -NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE \ No newline at end of file +NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE + +# External beacon API to use for syncing (on empty database). +# TODO it times out so we us finalized state instead +#NIMBUS_ETH2_EXTERNAL_BEACON_API_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# NIMBUS_ETH2_TRUSTED_STATE_ROOT=0xca279e8bc2eb7b776a5a0a099438b092132975f94b89ab89f325a53682ae6d34 + +NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE=$BASE_CONFIG_DATA_DIR/state.finalized.ssz + +# Enable the REST server [=false]. +NIMBUS_ETH2_REST=true + +# Port for the REST server [=5052]. +NIMBUS_ETH2_REST_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Listening address of the REST server [=127.0.0.1]. +NIMBUS_ETH2_REST_ADDRESS= + +# Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). +NIMBUS_ETH2_REST_ALLOW_ORIGIN= \ No newline at end of file diff --git a/network/holesky/cl/prysm/prysm-holesky.conf b/network/holesky/cl/prysm/prysm-holesky.conf index 3ead32c..80c3557 100644 --- a/network/holesky/cl/prysm/prysm-holesky.conf +++ b/network/holesky/cl/prysm/prysm-holesky.conf @@ -21,3 +21,18 @@ PRSYM_CLI_ACCEPT_TERMS_OF_USE=true # Data directory for the databases. (default: "$HOME/.eth2") PRSYM_CLI_DATADIR=$BASE_CONFIG_DATA_DIR + +# Disable the gRPC gateway for JSON-HTTP requests (default: false) +PRSYM_CLI_DISABLE_GRPC_GATEWAY=false + +# Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. (default: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000") +PRSYM_CLI_GRPC_GATEWAY_CORSDOMAIN= + +# The host on which the gateway server runs on (default: "127.0.0.1") +PRSYM_CLI_GRPC_GATEWAY_HOST= + +# The port on which the gateway server runs on (default: 3500) +PRSYM_CLI_GRPC_GATEWAY_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Comma-separated list of API module names. Possible values: prysm,eth. (default: "prysm,eth") +PRSYM_CLI_HTTP_MODULES=eth \ No newline at end of file diff --git a/network/holesky/cl/teku/teku-holesky.conf b/network/holesky/cl/teku/teku-holesky.conf index 214a07c..39e53c0 100644 --- a/network/holesky/cl/teku/teku-holesky.conf +++ b/network/holesky/cl/teku/teku-holesky.conf @@ -11,4 +11,23 @@ TEKU_CLI_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL TEKU_CLI_DATA_BASE_PATH=$BASE_CONFIG_DATA_DIR # Represents which network to use. Default: mainnet -TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK \ No newline at end of file +TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK + +# THIS optiosn will be modular only for TESTS +# Comma separated list of origins to allow, or * to allow any origin. Default: [] +TEKU_CLI_REST_API_CORS_ORIGINS= + +# Enable swagger-docs and swagger-ui endpoints. Default: false +TEKU_CLI_REST_API_DOCS_ENABLED= + +# Enables Beacon Rest API. Default: null +TEKU_CLI_REST_API_ENABLED=true + +# Comma-separated list of hostnames to allow, or * to allow any host. Default: [127.0.0.1, localhost] +TEKU_CLI_REST_API_HOST_ALLOWLIST= + +# Interface of Beacon Rest API. Default: 127.0.0.1 +TEKU_CLI_REST_API_INTERFACE= + +# Port number of Beacon Rest API. +TEKU_CLI_REST_API_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/holesky/el/besu/besu-holesky.conf b/network/holesky/el/besu/besu-holesky.conf index 3639040..115e959 100644 --- a/network/holesky/el/besu/besu-holesky.conf +++ b/network/holesky/el/besu/besu-holesky.conf @@ -5,4 +5,10 @@ BESU_CLI_DATA_PATH=$BASE_CONFIG_DATA_DIR BESU_CLI_ENGINE_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE # Synchronize against the indicated network: MAINNET, SEPOLIA, GOERLI, HOLESKY, DEV, FUTURE_EIPS, EXPERIMENTAL_EIPS, CLASSIC, MORDOR. (default: MAINNET) -BESU_CLI_NETWORK=HOLESKY \ No newline at end of file +BESU_CLI_NETWORK=HOLESKY + +BESU_CLI_RPC_HTTP_API=ETH + +BESU_CLI_RPC_HTTP_ENABLED=true + +BESU_CLI_RPC_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT \ No newline at end of file diff --git a/network/holesky/el/erigon/erigon-holesky.conf b/network/holesky/el/erigon/erigon-holesky.conf index a0906f6..894fdc1 100644 --- a/network/holesky/el/erigon/erigon-holesky.conf +++ b/network/holesky/el/erigon/erigon-holesky.conf @@ -14,7 +14,7 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_HTTP_VHOSTS=* +ERIGON_CLI_HTTP_VHOSTS=localhost # Enable the WS-RPC server ERIGON_CLI_WS=true @@ -29,10 +29,10 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of domains from which to accept cross-origin requests (browser enforced) -ERIGON_CLI_HTTP_CORSDOMAIN=* +ERIGON_CLI_HTTP_CORSDOMAIN=localhost # HTTP-RPC server listening interface for the Engine API ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_AUTHRPC_VHOSTS=* +ERIGON_CLI_AUTHRPC_VHOSTS=localhost diff --git a/network/holesky/el/reth/reth-holesky.conf b/network/holesky/el/reth/reth-holesky.conf index 7ea4dbd..1a4b31a 100644 --- a/network/holesky/el/reth/reth-holesky.conf +++ b/network/holesky/el/reth/reth-holesky.conf @@ -7,3 +7,21 @@ RETH_CLI_NODE_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE RETH_CLI_NODE_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP RETH_CLI_NODE_AUTHRPC_PORT=$BASE_CONFIG_ENGINE_API_PORT + +# Enable the HTTP-RPC server +RETH_CLI_NODE_HTTP=true + +# Http server address to listen on +# Default: 127.0.0.1 +RETH_CLI_NODE_HTTP_ADDR= + +# Http server port to listen on +# Default: 8545 +RETH_CLI_NODE_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT + +# Rpc Modules to be configured for the HTTP server +# Possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle +RETH_CLI_NODE_HTTP_API=eth + +# Http Corsdomain to allow request from +RETH_CLI_NODE_HTTP_CORSDOMAIN=localhost \ No newline at end of file diff --git a/network/holesky/holesky.conf b/network/holesky/holesky.conf index 25014e1..0ac4886 100644 --- a/network/holesky/holesky.conf +++ b/network/holesky/holesky.conf @@ -29,19 +29,19 @@ BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID= # execution_client only options BASE_CONFIG_EL_METRICS_PORT= BASE_CONFIG_EL_WS_PORT= -BASE_CONFIG_EL_RPC_PORT= +BASE_CONFIG_EL_RPC_PORT=8545 BASE_CONFIG_EL_P2P_PORT= # consensus_client only options BASE_CONFIG_CL_BEACON_API_URL=https://beaconstate.info -BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://beaconstate-holesky.chainsafe.io +BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://checkpoint-sync.holesky.ethpandaops.io BASE_CONFIG_CL_METRICS_PORT= -BASE_CONFIG_CL_RPC_PORT= +BASE_CONFIG_CL_RPC_PORT=5052 BASE_CONFIG_CL_P2P_PORT= # validator related options shared between consensus client & validator BASE_CONFIG_VALIDATOR_DATADIR=$BASE_CONFIG_DATA_DIR/validator -BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=BASE_CONFIG_ENGINE_HOST:4000 +BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=$BASE_CONFIG_ENGINE_HOST:4000 BASE_CONFIG_VALIDATOR_NUM_VALIDATORS=64 BASE_CONFIG_VALIDATOR_SHARED_FEE_RECEIPENT_ADDRESS=0x123463a4b065722e99115d6c222f267d9cabb524 \ No newline at end of file diff --git a/network/mainnet/cl/lighthouse/lighthouse-mainnet.conf b/network/mainnet/cl/lighthouse/lighthouse-mainnet.conf index 86a1bfa..0a2ee05 100644 --- a/network/mainnet/cl/lighthouse/lighthouse-mainnet.conf +++ b/network/mainnet/cl/lighthouse/lighthouse-mainnet.conf @@ -16,3 +16,10 @@ LIGHTHOUSE_CLI_BN_EXECUTION_ENDPOINT=$BASE_CONFIG_ENDPOINT_URL # File path which contains the hex-encoded JWT secret for the execution endpoint provided in the --execution-endpoint flag. LIGHTHOUSE_CLI_BN_EXECUTION_JWT=$BASE_CONFIG_SECRETS_FILE + +LIGHTHOUSE_CLI_BN_HTTP=true + +LIGHTHOUSE_CLI_BN_HTTP_PORT=$BASE_CONFIG_CL_RPC_PORT + +# TODO remove +LIGHTHOUSE_CLI_BN_HTTP_ALLOW_ORIGIN=* \ No newline at end of file diff --git a/network/mainnet/cl/lodestar/lodestar-mainnet.conf b/network/mainnet/cl/lodestar/lodestar-mainnet.conf index 4d79511..cd88789 100644 --- a/network/mainnet/cl/lodestar/lodestar-mainnet.conf +++ b/network/mainnet/cl/lodestar/lodestar-mainnet.conf @@ -11,4 +11,13 @@ LODESTAR_CLI_BN_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE LODESTAR_CLI_BN_EXECUTION_URLS=$BASE_CONFIG_ENDPOINT_URL # Server URL hosting Beacon Node APIs to fetch weak subjectivity state -LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL \ No newline at end of file +LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# Enable/disable HTTP API +LODESTAR_CLI_BN_REST=true + +# Pick namespaces to expose for HTTP API +LODESTAR_CLI_BN_REST_NAMESPACE=eth + +# Set port for HTTP API +LODESTAR_CLI_BN_REST_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/mainnet/cl/nimbus-eth2/nimbus-eth2-mainnet.conf b/network/mainnet/cl/nimbus-eth2/nimbus-eth2-mainnet.conf index 7d44ecf..89cdd06 100644 --- a/network/mainnet/cl/nimbus-eth2/nimbus-eth2-mainnet.conf +++ b/network/mainnet/cl/nimbus-eth2/nimbus-eth2-mainnet.conf @@ -8,4 +8,24 @@ NIMBUS_ETH2_DATA_DIR=$BASE_CONFIG_DATA_DIR NIMBUS_ETH2_WEB3_URL=$BASE_CONFIG_ENDPOINT_URL # A file containing the hex-encoded 256 bit secret key to be used for verifying/generating JWT tokens. -NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE \ No newline at end of file +NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE + +# External beacon API to use for syncing (on empty database). +# TODO it times out so we us finalized state instead +#NIMBUS_ETH2_EXTERNAL_BEACON_API_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# NIMBUS_ETH2_TRUSTED_STATE_ROOT=0xca279e8bc2eb7b776a5a0a099438b092132975f94b89ab89f325a53682ae6d34 + +NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE=$BASE_CONFIG_DATA_DIR/state.finalized.ssz + +# Enable the REST server [=false]. +NIMBUS_ETH2_REST=true + +# Port for the REST server [=5052]. +NIMBUS_ETH2_REST_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Listening address of the REST server [=127.0.0.1]. +NIMBUS_ETH2_REST_ADDRESS= + +# Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). +NIMBUS_ETH2_REST_ALLOW_ORIGIN= \ No newline at end of file diff --git a/network/mainnet/cl/prysm/prysm-mainnet.conf b/network/mainnet/cl/prysm/prysm-mainnet.conf index 04cc5b9..b888221 100644 --- a/network/mainnet/cl/prysm/prysm-mainnet.conf +++ b/network/mainnet/cl/prysm/prysm-mainnet.conf @@ -18,3 +18,19 @@ PRSYM_CLI_ACCEPT_TERMS_OF_USE=true # Data directory for the databases. (default: "$HOME/.eth2") PRSYM_CLI_DATADIR=$BASE_CONFIG_DATA_DIR + + +# Disable the gRPC gateway for JSON-HTTP requests (default: false) +PRSYM_CLI_DISABLE_GRPC_GATEWAY=false + +# Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. (default: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000") +PRSYM_CLI_GRPC_GATEWAY_CORSDOMAIN= + +# The host on which the gateway server runs on (default: "127.0.0.1") +PRSYM_CLI_GRPC_GATEWAY_HOST= + +# The port on which the gateway server runs on (default: 3500) +PRSYM_CLI_GRPC_GATEWAY_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Comma-separated list of API module names. Possible values: prysm,eth. (default: "prysm,eth") +PRSYM_CLI_HTTP_MODULES=eth \ No newline at end of file diff --git a/network/mainnet/cl/teku/teku-mainnet.conf b/network/mainnet/cl/teku/teku-mainnet.conf index 214a07c..a4e035a 100644 --- a/network/mainnet/cl/teku/teku-mainnet.conf +++ b/network/mainnet/cl/teku/teku-mainnet.conf @@ -11,4 +11,24 @@ TEKU_CLI_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL TEKU_CLI_DATA_BASE_PATH=$BASE_CONFIG_DATA_DIR # Represents which network to use. Default: mainnet -TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK \ No newline at end of file +TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK + + +# THIS optiosn will be modular only for TESTS +# Comma separated list of origins to allow, or * to allow any origin. Default: [] +TEKU_CLI_REST_API_CORS_ORIGINS= + +# Enable swagger-docs and swagger-ui endpoints. Default: false +TEKU_CLI_REST_API_DOCS_ENABLED= + +# Enables Beacon Rest API. Default: null +TEKU_CLI_REST_API_ENABLED=true + +# Comma-separated list of hostnames to allow, or * to allow any host. Default: [127.0.0.1, localhost] +TEKU_CLI_REST_API_HOST_ALLOWLIST= + +# Interface of Beacon Rest API. Default: 127.0.0.1 +TEKU_CLI_REST_API_INTERFACE= + +# Port number of Beacon Rest API. +TEKU_CLI_REST_API_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/mainnet/el/besu/besu-mainnet.conf b/network/mainnet/el/besu/besu-mainnet.conf index 74ca866..98084b1 100644 --- a/network/mainnet/el/besu/besu-mainnet.conf +++ b/network/mainnet/el/besu/besu-mainnet.conf @@ -5,4 +5,10 @@ BESU_CLI_DATA_PATH=$BASE_CONFIG_DATA_DIR BESU_CLI_ENGINE_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE # Synchronize against the indicated network: MAINNET, SEPOLIA, GOERLI, HOLESKY, DEV, FUTURE_EIPS, EXPERIMENTAL_EIPS, CLASSIC, MORDOR. (default: MAINNET) -BESU_CLI_NETWORK=MAINNET \ No newline at end of file +BESU_CLI_NETWORK=MAINNET + +BESU_CLI_RPC_HTTP_API=ETH + +BESU_CLI_RPC_HTTP_ENABLED=true + +BESU_CLI_RPC_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT \ No newline at end of file diff --git a/network/mainnet/el/erigon/erigon-mainnet.conf b/network/mainnet/el/erigon/erigon-mainnet.conf index a0906f6..5dc5bb8 100644 --- a/network/mainnet/el/erigon/erigon-mainnet.conf +++ b/network/mainnet/el/erigon/erigon-mainnet.conf @@ -14,7 +14,7 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_HTTP_VHOSTS=* +ERIGON_CLI_HTTP_VHOSTS=localhost # Enable the WS-RPC server ERIGON_CLI_WS=true @@ -29,10 +29,10 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of domains from which to accept cross-origin requests (browser enforced) -ERIGON_CLI_HTTP_CORSDOMAIN=* +ERIGON_CLI_HTTP_CORSDOMAIN=localhost # HTTP-RPC server listening interface for the Engine API ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_AUTHRPC_VHOSTS=* +ERIGON_CLI_AUTHRPC_VHOSTS=localhost \ No newline at end of file diff --git a/network/mainnet/el/reth/reth-mainnet.conf b/network/mainnet/el/reth/reth-mainnet.conf index 7ea4dbd..1a4b31a 100644 --- a/network/mainnet/el/reth/reth-mainnet.conf +++ b/network/mainnet/el/reth/reth-mainnet.conf @@ -7,3 +7,21 @@ RETH_CLI_NODE_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE RETH_CLI_NODE_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP RETH_CLI_NODE_AUTHRPC_PORT=$BASE_CONFIG_ENGINE_API_PORT + +# Enable the HTTP-RPC server +RETH_CLI_NODE_HTTP=true + +# Http server address to listen on +# Default: 127.0.0.1 +RETH_CLI_NODE_HTTP_ADDR= + +# Http server port to listen on +# Default: 8545 +RETH_CLI_NODE_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT + +# Rpc Modules to be configured for the HTTP server +# Possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle +RETH_CLI_NODE_HTTP_API=eth + +# Http Corsdomain to allow request from +RETH_CLI_NODE_HTTP_CORSDOMAIN=localhost \ No newline at end of file diff --git a/network/mainnet/mainnet.conf b/network/mainnet/mainnet.conf index 8ea1155..efd53e2 100644 --- a/network/mainnet/mainnet.conf +++ b/network/mainnet/mainnet.conf @@ -29,15 +29,15 @@ BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID= # execution_client only options BASE_CONFIG_EL_METRICS_PORT= BASE_CONFIG_EL_WS_PORT= -BASE_CONFIG_EL_RPC_PORT= +BASE_CONFIG_EL_RPC_PORT=8545 BASE_CONFIG_EL_P2P_PORT= # consensus_client only options BASE_CONFIG_CL_BEACON_API_URL=https://beaconstate.info -BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://mainnet.checkpoint.sigp.io +BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://mainnet-checkpoint-sync.stakely.io BASE_CONFIG_CL_METRICS_PORT= -BASE_CONFIG_CL_RPC_PORT= +BASE_CONFIG_CL_RPC_PORT=5052 BASE_CONFIG_CL_P2P_PORT= # validator related options shared between consensus client & validator diff --git a/network/sepolia/cl/lighthouse/lighthouse-sepolia.conf b/network/sepolia/cl/lighthouse/lighthouse-sepolia.conf index e4fad2e..ddbb85e 100644 --- a/network/sepolia/cl/lighthouse/lighthouse-sepolia.conf +++ b/network/sepolia/cl/lighthouse/lighthouse-sepolia.conf @@ -16,3 +16,10 @@ LIGHTHOUSE_CLI_BN_EXECUTION_ENDPOINT=$BASE_CONFIG_ENDPOINT_URL # File path which contains the hex-encoded JWT secret for the execution endpoint provided in the --execution-endpoint flag. LIGHTHOUSE_CLI_BN_EXECUTION_JWT=$BASE_CONFIG_SECRETS_FILE + +LIGHTHOUSE_CLI_BN_HTTP=true + +LIGHTHOUSE_CLI_BN_HTTP_PORT=$BASE_CONFIG_CL_RPC_PORT + +# TODO remove +LIGHTHOUSE_CLI_BN_HTTP_ALLOW_ORIGIN=* \ No newline at end of file diff --git a/network/sepolia/cl/lodestar/lodestar-sepolia.conf b/network/sepolia/cl/lodestar/lodestar-sepolia.conf index 4d79511..cd88789 100644 --- a/network/sepolia/cl/lodestar/lodestar-sepolia.conf +++ b/network/sepolia/cl/lodestar/lodestar-sepolia.conf @@ -11,4 +11,13 @@ LODESTAR_CLI_BN_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE LODESTAR_CLI_BN_EXECUTION_URLS=$BASE_CONFIG_ENDPOINT_URL # Server URL hosting Beacon Node APIs to fetch weak subjectivity state -LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL \ No newline at end of file +LODESTAR_CLI_BN_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# Enable/disable HTTP API +LODESTAR_CLI_BN_REST=true + +# Pick namespaces to expose for HTTP API +LODESTAR_CLI_BN_REST_NAMESPACE=eth + +# Set port for HTTP API +LODESTAR_CLI_BN_REST_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/sepolia/cl/nimbus-eth2/nimbus-eth2-sepolia.conf b/network/sepolia/cl/nimbus-eth2/nimbus-eth2-sepolia.conf index 7d44ecf..a3bfe46 100644 --- a/network/sepolia/cl/nimbus-eth2/nimbus-eth2-sepolia.conf +++ b/network/sepolia/cl/nimbus-eth2/nimbus-eth2-sepolia.conf @@ -8,4 +8,24 @@ NIMBUS_ETH2_DATA_DIR=$BASE_CONFIG_DATA_DIR NIMBUS_ETH2_WEB3_URL=$BASE_CONFIG_ENDPOINT_URL # A file containing the hex-encoded 256 bit secret key to be used for verifying/generating JWT tokens. -NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE \ No newline at end of file +NIMBUS_ETH2_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE + +# External beacon API to use for syncing (on empty database). +# TODO it times out so we us finalized state instead +# NIMBUS_ETH2_EXTERNAL_BEACON_API_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL + +# NIMBUS_ETH2_TRUSTED_STATE_ROOT=0xca279e8bc2eb7b776a5a0a099438b092132975f94b89ab89f325a53682ae6d34 + +NIMBUS_ETH2_FINALIZED_CHECKPOINT_STATE=$BASE_CONFIG_DATA_DIR/state.finalized.ssz + +# Enable the REST server [=false]. +NIMBUS_ETH2_REST=true + +# Port for the REST server [=5052]. +NIMBUS_ETH2_REST_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Listening address of the REST server [=127.0.0.1]. +NIMBUS_ETH2_REST_ADDRESS= + +# Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). +NIMBUS_ETH2_REST_ALLOW_ORIGIN= \ No newline at end of file diff --git a/network/sepolia/cl/prysm/prysm-sepolia.conf b/network/sepolia/cl/prysm/prysm-sepolia.conf index 4ec69b3..3e19b27 100644 --- a/network/sepolia/cl/prysm/prysm-sepolia.conf +++ b/network/sepolia/cl/prysm/prysm-sepolia.conf @@ -21,3 +21,18 @@ PRSYM_CLI_ACCEPT_TERMS_OF_USE=true # Data directory for the databases. (default: "$HOME/.eth2") PRSYM_CLI_DATADIR=$BASE_CONFIG_DATA_DIR + +# Disable the gRPC gateway for JSON-HTTP requests (default: false) +PRSYM_CLI_DISABLE_GRPC_GATEWAY=false + +# Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. (default: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000") +PRSYM_CLI_GRPC_GATEWAY_CORSDOMAIN= + +# The host on which the gateway server runs on (default: "127.0.0.1") +PRSYM_CLI_GRPC_GATEWAY_HOST= + +# The port on which the gateway server runs on (default: 3500) +PRSYM_CLI_GRPC_GATEWAY_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Comma-separated list of API module names. Possible values: prysm,eth. (default: "prysm,eth") +PRSYM_CLI_HTTP_MODULES=eth \ No newline at end of file diff --git a/network/sepolia/cl/teku/teku-sepolia.conf b/network/sepolia/cl/teku/teku-sepolia.conf index 214a07c..39e53c0 100644 --- a/network/sepolia/cl/teku/teku-sepolia.conf +++ b/network/sepolia/cl/teku/teku-sepolia.conf @@ -11,4 +11,23 @@ TEKU_CLI_CHECKPOINT_SYNC_URL=$BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL TEKU_CLI_DATA_BASE_PATH=$BASE_CONFIG_DATA_DIR # Represents which network to use. Default: mainnet -TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK \ No newline at end of file +TEKU_CLI_NETWORK=$BASE_CONFIG_NETWORK + +# THIS optiosn will be modular only for TESTS +# Comma separated list of origins to allow, or * to allow any origin. Default: [] +TEKU_CLI_REST_API_CORS_ORIGINS= + +# Enable swagger-docs and swagger-ui endpoints. Default: false +TEKU_CLI_REST_API_DOCS_ENABLED= + +# Enables Beacon Rest API. Default: null +TEKU_CLI_REST_API_ENABLED=true + +# Comma-separated list of hostnames to allow, or * to allow any host. Default: [127.0.0.1, localhost] +TEKU_CLI_REST_API_HOST_ALLOWLIST= + +# Interface of Beacon Rest API. Default: 127.0.0.1 +TEKU_CLI_REST_API_INTERFACE= + +# Port number of Beacon Rest API. +TEKU_CLI_REST_API_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/sepolia/el/besu/besu-sepolia.conf b/network/sepolia/el/besu/besu-sepolia.conf index a5cfe0d..82e3170 100644 --- a/network/sepolia/el/besu/besu-sepolia.conf +++ b/network/sepolia/el/besu/besu-sepolia.conf @@ -5,4 +5,10 @@ BESU_CLI_DATA_PATH=$BASE_CONFIG_DATA_DIR BESU_CLI_ENGINE_JWT_SECRET=$BASE_CONFIG_SECRETS_FILE # Synchronize against the indicated network: MAINNET, SEPOLIA, GOERLI, HOLESKY, DEV, FUTURE_EIPS, EXPERIMENTAL_EIPS, CLASSIC, MORDOR. (default: MAINNET) -BESU_CLI_NETWORK=SEPOLIA \ No newline at end of file +BESU_CLI_NETWORK=SEPOLIA + +BESU_CLI_RPC_HTTP_API=ETH + +BESU_CLI_RPC_HTTP_ENABLED=true + +BESU_CLI_RPC_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT \ No newline at end of file diff --git a/network/sepolia/el/erigon/erigon-sepolia.conf b/network/sepolia/el/erigon/erigon-sepolia.conf index 958b964..894fdc1 100644 --- a/network/sepolia/el/erigon/erigon-sepolia.conf +++ b/network/sepolia/el/erigon/erigon-sepolia.conf @@ -14,7 +14,7 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_HTTP_VHOSTS=* +ERIGON_CLI_HTTP_VHOSTS=localhost # Enable the WS-RPC server ERIGON_CLI_WS=true @@ -29,11 +29,10 @@ ERIGON_CLI_HTTP=true ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of domains from which to accept cross-origin requests (browser enforced) -ERIGON_CLI_HTTP_CORSDOMAIN=* +ERIGON_CLI_HTTP_CORSDOMAIN=localhost # HTTP-RPC server listening interface for the Engine API ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_AUTHRPC_VHOSTS=* - +ERIGON_CLI_AUTHRPC_VHOSTS=localhost diff --git a/network/sepolia/el/reth/reth-sepolia.conf b/network/sepolia/el/reth/reth-sepolia.conf index 7ea4dbd..1a4b31a 100644 --- a/network/sepolia/el/reth/reth-sepolia.conf +++ b/network/sepolia/el/reth/reth-sepolia.conf @@ -7,3 +7,21 @@ RETH_CLI_NODE_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE RETH_CLI_NODE_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP RETH_CLI_NODE_AUTHRPC_PORT=$BASE_CONFIG_ENGINE_API_PORT + +# Enable the HTTP-RPC server +RETH_CLI_NODE_HTTP=true + +# Http server address to listen on +# Default: 127.0.0.1 +RETH_CLI_NODE_HTTP_ADDR= + +# Http server port to listen on +# Default: 8545 +RETH_CLI_NODE_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT + +# Rpc Modules to be configured for the HTTP server +# Possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle +RETH_CLI_NODE_HTTP_API=eth + +# Http Corsdomain to allow request from +RETH_CLI_NODE_HTTP_CORSDOMAIN=localhost \ No newline at end of file diff --git a/network/sepolia/sepolia.conf b/network/sepolia/sepolia.conf index 290a4be..f1e9e52 100644 --- a/network/sepolia/sepolia.conf +++ b/network/sepolia/sepolia.conf @@ -29,19 +29,20 @@ BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID= # execution_client only options BASE_CONFIG_EL_METRICS_PORT= BASE_CONFIG_EL_WS_PORT= -BASE_CONFIG_EL_RPC_PORT= +BASE_CONFIG_EL_RPC_PORT=8545 BASE_CONFIG_EL_P2P_PORT= # consensus_client only options BASE_CONFIG_CL_BEACON_API_URL=https://beaconstate.info -BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://checkpoint-sync.sepolia.ethpandaops.io +BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://beaconstate-sepolia.chainsafe.io +#BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL=https://checkpoint-sync.sepolia.ethpandaops.io BASE_CONFIG_CL_METRICS_PORT= -BASE_CONFIG_CL_RPC_PORT= +BASE_CONFIG_CL_RPC_PORT=5052 BASE_CONFIG_CL_P2P_PORT= # validator related options shared between consensus client & validator BASE_CONFIG_VALIDATOR_DATADIR=$BASE_CONFIG_DATA_DIR/validator -BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=BASE_CONFIG_ENGINE_HOST:4000 +BASE_CONFIG_VALIDATOR_BEACON_RPC_PROVIDER=$BASE_CONFIG_ENGINE_HOST:4000 BASE_CONFIG_VALIDATOR_NUM_VALIDATORS=64 BASE_CONFIG_VALIDATOR_SHARED_FEE_RECEIPENT_ADDRESS=0x123463a4b065722e99115d6c222f267d9cabb524 \ No newline at end of file diff --git a/network/testnet/cl/lighthouse/lighthouse-testnet.conf b/network/testnet/cl/lighthouse/lighthouse-testnet.conf index 143582b..f1e48c5 100644 --- a/network/testnet/cl/lighthouse/lighthouse-testnet.conf +++ b/network/testnet/cl/lighthouse/lighthouse-testnet.conf @@ -53,4 +53,12 @@ LIGHTHOUSE_CLI_BN_SUGGESTED_FEE_RECIPIENT=$BASE_CONFIG_VALIDATOR_SHARED_FEE_RECE LIGHTHOUSE_CLI_BN_SUBSCRIBE_ALL_SUBNETS=true # Lighthouse by default does not discover private IP addresses. Set this flag to enable connection attempts to local addresses. -LIGHTHOUSE_CLI_BN_ENABLE_PRIVATE_DISCOVERY=true \ No newline at end of file +LIGHTHOUSE_CLI_BN_ENABLE_PRIVATE_DISCOVERY=true + + +LIGHTHOUSE_CLI_BN_HTTP=true + +LIGHTHOUSE_CLI_BN_HTTP_PORT=$BASE_CONFIG_CL_RPC_PORT + +# TODO remove +LIGHTHOUSE_CLI_BN_HTTP_ALLOW_ORIGIN=* \ No newline at end of file diff --git a/network/testnet/cl/lodestar/lodestar-testnet.conf b/network/testnet/cl/lodestar/lodestar-testnet.conf index 064c9c8..f9be741 100644 --- a/network/testnet/cl/lodestar/lodestar-testnet.conf +++ b/network/testnet/cl/lodestar/lodestar-testnet.conf @@ -25,7 +25,7 @@ LODESTAR_CLI_DEV_REST_PORT=9597 LODESTAR_CLI_DEV_PORT=9000 # Pick namespaces to expose for HTTP API -LODESTAR_CLI_BN_REST_NAMESPACE=* +LODESTAR_CLI_BN_REST_NAMESPACE=localhost # Set host for HTTP API LODESTAR_CLI_BN_REST_ADDRESS=127.0.0.1 @@ -45,4 +45,14 @@ LODESTAR_CLI_BN_PARAMS_FILE=$BASE_CONFIG_CUSTOM_NETWORK_CHAINCONFIG LODESTAR_CLI_BN_GENSIS_STATE_FILE=$BASE_CONFIG_CUSTOM_NETWORK_GENESIS_STATE # Bootnodes for discv5 discovery -LODESTAR_CLI_DEV_BOOTNODES= \ No newline at end of file +LODESTAR_CLI_DEV_BOOTNODES= + + +# Enable/disable HTTP API +LODESTAR_CLI_BN_REST=true + +# Pick namespaces to expose for HTTP API +LODESTAR_CLI_BN_REST_NAMESPACE=eth + +# Set port for HTTP API +LODESTAR_CLI_BN_REST_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/testnet/cl/nimbus-eth2/nimbus-eth2-testnet.conf b/network/testnet/cl/nimbus-eth2/nimbus-eth2-testnet.conf index fe7ac00..a3353c5 100644 --- a/network/testnet/cl/nimbus-eth2/nimbus-eth2-testnet.conf +++ b/network/testnet/cl/nimbus-eth2/nimbus-eth2-testnet.conf @@ -19,20 +19,21 @@ NIMBUS_ETH2_NAT= # Discovery can automatically update its ENR with the IP address and UDP port as seen by other nodes it communicates with. This option allows to enable/disable this functionality [=false]. NIMBUS_ETH2_ENR_AUTO_UPDATE=false +# If enabled, the beacon node prudently listens for 2 epochs for attestations from a validator with the same index (a doppelganger), before sending an attestation itself. This protects against slashing (due to double-voting) but means you will miss two attestations when restarting. [=true]. +NIMBUS_ETH2_DOPPELGANGER_DETECTION=false + +# Subscribe to all subnet topics when gossiping [=false]. +NIMBUS_ETH2_SUBSCRIBE_ALL_SUBNETS=true + + # Enable the REST server [=false]. NIMBUS_ETH2_REST=true # Port for the REST server [=5052]. -NIMBUS_ETH2_REST_PORT= +NIMBUS_ETH2_REST_PORT=$BASE_CONFIG_CL_RPC_PORT # Listening address of the REST server [=127.0.0.1]. NIMBUS_ETH2_REST_ADDRESS= # Limit the access to the REST API to a particular hostname (for CORS-enabled clients such as browsers). -NIMBUS_ETH2_REST_ALLOW_ORIGIN=* - -# If enabled, the beacon node prudently listens for 2 epochs for attestations from a validator with the same index (a doppelganger), before sending an attestation itself. This protects against slashing (due to double-voting) but means you will miss two attestations when restarting. [=true]. -NIMBUS_ETH2_DOPPELGANGER_DETECTION=false - -# Subscribe to all subnet topics when gossiping [=false]. -NIMBUS_ETH2_SUBSCRIBE_ALL_SUBNETS=true +NIMBUS_ETH2_REST_ALLOW_ORIGIN= \ No newline at end of file diff --git a/network/testnet/cl/prysm/prysm-testnet.conf b/network/testnet/cl/prysm/prysm-testnet.conf index b857902..407e185 100644 --- a/network/testnet/cl/prysm/prysm-testnet.conf +++ b/network/testnet/cl/prysm/prysm-testnet.conf @@ -48,4 +48,21 @@ PRSYM_CLI_CONTRACT_DEPLOYMENT_BLOCK=0 PRSYM_CLI_MIN_SYNC_PEERS=0 # Path to a YAML file with chain config values -PRSYM_CLI_CHAIN_CONFIG_FILE=$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/config.yaml \ No newline at end of file +PRSYM_CLI_CHAIN_CONFIG_FILE=$BASE_CONFIG_CUSTOM_NETWORK_TESTNET_DIR/config.yaml + + + +# Disable the gRPC gateway for JSON-HTTP requests (default: false) +PRSYM_CLI_DISABLE_GRPC_GATEWAY=false + +# Comma separated list of domains from which to accept cross origin requests (browser enforced). This flag has no effect if not used with --grpc-gateway-port. (default: "http://localhost:4200,http://localhost:7500,http://127.0.0.1:4200,http://127.0.0.1:7500,http://0.0.0.0:4200,http://0.0.0.0:7500,http://localhost:3000,http://0.0.0.0:3000,http://127.0.0.1:3000") +PRSYM_CLI_GRPC_GATEWAY_CORSDOMAIN= + +# The host on which the gateway server runs on (default: "127.0.0.1") +PRSYM_CLI_GRPC_GATEWAY_HOST= + +# The port on which the gateway server runs on (default: 3500) +PRSYM_CLI_GRPC_GATEWAY_PORT=$BASE_CONFIG_CL_RPC_PORT + +# Comma-separated list of API module names. Possible values: prysm,eth. (default: "prysm,eth") +PRSYM_CLI_HTTP_MODULES=eth \ No newline at end of file diff --git a/network/testnet/cl/teku/teku-testnet.conf b/network/testnet/cl/teku/teku-testnet.conf index 0c035a8..9b18e81 100644 --- a/network/testnet/cl/teku/teku-testnet.conf +++ b/network/testnet/cl/teku/teku-testnet.conf @@ -20,4 +20,24 @@ TEKU_CLI_P2P_DISCOVERY_BOOTNODES=$BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR TEKU_CLI_GENESIS_STATE=$BASE_CONFIG_CUSTOM_NETWORK_GENESIS_STATE # Allows syncing outside of the weak subjectivity period. Default: false -TEKU_CLI_IGNORE_WEAK_SUBJECTIVITY_PERIOD_ENABLED=true \ No newline at end of file +TEKU_CLI_IGNORE_WEAK_SUBJECTIVITY_PERIOD_ENABLED=true + + +# THIS optiosn will be modular only for TESTS +# Comma separated list of origins to allow, or * to allow any origin. Default: [] +TEKU_CLI_REST_API_CORS_ORIGINS= + +# Enable swagger-docs and swagger-ui endpoints. Default: false +TEKU_CLI_REST_API_DOCS_ENABLED= + +# Enables Beacon Rest API. Default: null +TEKU_CLI_REST_API_ENABLED=true + +# Comma-separated list of hostnames to allow, or * to allow any host. Default: [127.0.0.1, localhost] +TEKU_CLI_REST_API_HOST_ALLOWLIST= + +# Interface of Beacon Rest API. Default: 127.0.0.1 +TEKU_CLI_REST_API_INTERFACE= + +# Port number of Beacon Rest API. +TEKU_CLI_REST_API_PORT=$BASE_CONFIG_CL_RPC_PORT \ No newline at end of file diff --git a/network/testnet/el/besu/besu-testnet.conf b/network/testnet/el/besu/besu-testnet.conf index f3312c8..2ed76b9 100644 --- a/network/testnet/el/besu/besu-testnet.conf +++ b/network/testnet/el/besu/besu-testnet.conf @@ -29,3 +29,9 @@ BESU_CLI_BONSAI_LIMIT_TRIE_LOGS_ENABLED=false # Enable P2P functionality (default: true) # Only running one EL client on testnet BESU_CLI_P2P_ENABLED=false + +BESU_CLI_RPC_HTTP_API=ETH + +BESU_CLI_RPC_HTTP_ENABLED=true + +BESU_CLI_RPC_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT \ No newline at end of file diff --git a/network/testnet/el/erigon/erigon-testnet.conf b/network/testnet/el/erigon/erigon-testnet.conf index d70f2c8..3babef5 100644 --- a/network/testnet/el/erigon/erigon-testnet.conf +++ b/network/testnet/el/erigon/erigon-testnet.conf @@ -8,29 +8,17 @@ ERIGON_CLI_DATADIR=$BASE_CONFIG_DATA_DIR ERIGON_CLI_HTTP_API=eth,erigon,engine,web3,net,debug,trace,txpool,admin # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_HTTP_VHOSTS=* +ERIGON_CLI_HTTP_VHOSTS=localhost # Enable the WS-RPC server ERIGON_CLI_WS=true -# Allow insecure account unlocking when account-related RPCs are exposed by http -ERIGON_CLI_ALLOW_INSECURE_UNLOCK=true - -# JSON-RPC server (enabled by default). Use HTTP=false to disable it. -ERIGON_CLI_HTTP=true - -# HTTP-RPC server listening interface -ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP - -# Comma separated list of domains from which to accept cross-origin requests (browser enforced) -ERIGON_CLI_HTTP_CORSDOMAIN=* - # HTTP-RPC server listening interface for the Engine API ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP # Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. -ERIGON_CLI_AUTHRPC_VHOSTS=* +ERIGON_CLI_AUTHRPC_VHOSTS=localhost # Path to the token that ensures safe connection between CL and EL ERIGON_CLI_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE @@ -41,3 +29,18 @@ ERIGON_CLI_HTTP=true # Comma separated enode URLs for P2P discovery bootstrap ERIGON_CLI_BOOTNODES=$BASE_CONFIG_CUSTOM_NETWORK_BOOTNODES_ENR + +# JSON-RPC server (enabled by default). Use HTTP=false to disable it. +ERIGON_CLI_HTTP=true + +# HTTP-RPC server listening interface +ERIGON_CLI_HTTP_ADDR=$BASE_CONFIG_ENGINE_IP + +# Comma separated list of domains from which to accept cross-origin requests (browser enforced) +ERIGON_CLI_HTTP_CORSDOMAIN=localhost + +# HTTP-RPC server listening interface for the Engine API +ERIGON_CLI_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP + +# Comma separated list of virtual hostnames from which to accept Engine API requests (server enforced). Accepts 'any' or '*' as wildcard. +ERIGON_CLI_AUTHRPC_VHOSTS=localhost diff --git a/network/testnet/el/geth/geth-testnet.conf b/network/testnet/el/geth/geth-testnet.conf index c1ac858..3ee68be 100644 --- a/network/testnet/el/geth/geth-testnet.conf +++ b/network/testnet/el/geth/geth-testnet.conf @@ -20,7 +20,7 @@ GETH_CLI_AUTHRPC_ADDR=127.0.0.1 GETH_CLI_HTTP_ADDR=127.0.0.1 # Comma separated list of domains from which to accept cross origin requests (browser enforced) -GETH_CLI_GRAPHQL_CORSDOMAIN=* +GETH_CLI_GRAPHQL_CORSDOMAIN=localhost # Enable the WS-RPC server GETH_CLI_WS=true @@ -32,10 +32,10 @@ GETH_CLI_WS_API=eth,net,web3 GETH_CLI_WS_ADDR=127.0.0.1 # Origins from which to accept websockets requests -GETH_CLI_WS_ORIGINS=* +GETH_CLI_WS_ORIGINS=localhost # Comma separated list of virtual hostnames from which to accept requests (server enforced). Accepts '*' wildcard. -GETH_CLI_AUTHRPC_VHOSTS=* +GETH_CLI_AUTHRPC_VHOSTS=localhost # Allow insecure account unlocking when account-related RPCs are exposed by http GETH_CLI_ALLOW_INSECURE_UNLOCK=true @@ -47,4 +47,11 @@ GETH_CLI_PASSWORD=$BASE_CONFIG_DATA_DIR/geth_password.txt GETH_CLI_UNLOCK=$BASE_CONFIG_VALIDATOR_SHARED_FEE_RECEIPENT_ADDRESS # Disables the peer discovery mechanism (manual peer addition) -GETH_CLI_NODISCOVER=true \ No newline at end of file +GETH_CLI_NODISCOVER=true + + +# Enable the HTTP-RPC server +GETH_CLI_HTTP=true + +# APIs offered over the HTTP-RPC interface +GETH_CLI_HTTP_API=eth,net \ No newline at end of file diff --git a/network/testnet/el/reth/reth-testnet.conf b/network/testnet/el/reth/reth-testnet.conf index 5f21fbb..ab7b35c 100644 --- a/network/testnet/el/reth/reth-testnet.conf +++ b/network/testnet/el/reth/reth-testnet.conf @@ -7,3 +7,21 @@ RETH_CLI_NODE_AUTHRPC_JWTSECRET=$BASE_CONFIG_SECRETS_FILE RETH_CLI_NODE_AUTHRPC_ADDR=$BASE_CONFIG_ENGINE_IP RETH_CLI_NODE_AUTHRPC_PORT=$BASE_CONFIG_ENGINE_API_PORT + +# Enable the HTTP-RPC server +RETH_CLI_NODE_HTTP=true + +# Http server address to listen on +# Default: 127.0.0.1 +RETH_CLI_NODE_HTTP_ADDR= + +# Http server port to listen on +# Default: 8545 +RETH_CLI_NODE_HTTP_PORT=$BASE_CONFIG_EL_RPC_PORT + +# Rpc Modules to be configured for the HTTP server +# Possible values: admin, debug, eth, net, trace, txpool, web3, rpc, reth, ots, eth-call-bundle +RETH_CLI_NODE_HTTP_API=eth + +# Http Corsdomain to allow request from +RETH_CLI_NODE_HTTP_CORSDOMAIN=localhost \ No newline at end of file diff --git a/network/testnet/testnet.conf b/network/testnet/testnet.conf index 1d74b08..2128160 100644 --- a/network/testnet/testnet.conf +++ b/network/testnet/testnet.conf @@ -29,7 +29,7 @@ BASE_CONFIG_CUSTOM_NETWORK_NETWORK_ID= # execution_client only options BASE_CONFIG_EL_METRICS_PORT= BASE_CONFIG_EL_WS_PORT= -BASE_CONFIG_EL_RPC_PORT= +BASE_CONFIG_EL_RPC_PORT=8545 BASE_CONFIG_EL_P2P_PORT= # consensus_client only options @@ -37,7 +37,7 @@ BASE_CONFIG_CL_BEACON_API_URL= BASE_CONFIG_CL_CHECKPPOINT_SYNC_URL= BASE_CONFIG_CL_METRICS_PORT= -BASE_CONFIG_CL_RPC_PORT= +BASE_CONFIG_CL_RPC_PORT=5052 BASE_CONFIG_CL_P2P_PORT= # validator related options shared between consensus client & validator diff --git a/node-test/action.yml b/node-test/action.yml new file mode 100644 index 0000000..26b9f8b --- /dev/null +++ b/node-test/action.yml @@ -0,0 +1,56 @@ +name: 'Run Ethereum Node Tests' +description: 'Composite action to run Ethereum Node Tests for selected client pairs for selected networks' +inputs: + cl_name: + description: 'cl name' + required: true + el_name: + description: 'el name' + required: true + network: + description: 'Ethereum network name' + required: true +runs: + using: 'composite' + steps: + - name: Add eth-nodes repository + run: | + sudo curl -fsSL https://packages.eth-pkg.com/keys/ethpkg-archive-keyring.asc -o /usr/share/keyrings/ethpkg-archive-keyring.asc + echo "deb [arch=amd64 signed-by=/usr/share/keyrings/ethpkg-archive-keyring.asc] http://packages.eth-pkg.com/noble-main noble main" | sudo tee -a /etc/apt/sources.list.d/ethpkg.list + sudo apt update + shell: bash + + + # caches packages not to hit the repository in each CI run + - name: Cache apt packages + uses: eth-pkg/apt-deb-cache@v0.2.4 + with: + packages: | + eth-node-besu eth-node-erigon eth-node-geth eth-node-nethermind eth-node-reth \ + eth-node-lighthouse eth-node-lodestar eth-node-nimbus-eth2 eth-node-prysm eth-node-teku \ + bats + + - name: Setup Java + uses: actions/setup-java@v4 + with: + distribution: 'oracle' + java-version: '21' + + - name: Install dotnet + run: | + sudo apt update + sudo apt install -y aspnetcore-runtime-8.0 + shell: bash + + - name: Install node.js dep + run: | + curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - + sudo apt install -y nodejs + shell: bash + + - name: Run test + run: | + # timeout in 10m if client is offline, the tests is stuck, this is a workaround of that + timeout 11m bats --show-output-of-passing-tests tests/test_${{inputs.network}}.bats --filter ${{ inputs.el_name }}-${{ inputs.cl_name }} + shell: bash + diff --git a/node-test/ephemery_tests.yml b/node-test/ephemery_tests.yml new file mode 100644 index 0000000..136586c --- /dev/null +++ b/node-test/ephemery_tests.yml @@ -0,0 +1,112 @@ +name: ephemery tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + besu: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: ephemery + el_name: besu + cl_name: ${{matrix.cl_name}} + erigon: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: ephemery + el_name: erigon + cl_name: ${{matrix.cl_name}} + geth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: ephemery + el_name: geth + cl_name: ${{matrix.cl_name}} + + nethermind: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: ephemery + el_name: nethermind + cl_name: ${{matrix.cl_name}} + reth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + networK: ephemery + el_name: reth + cl_name: ${{matrix.cl_name}} diff --git a/node-test/holesky_tests.yml b/node-test/holesky_tests.yml new file mode 100644 index 0000000..f6fc130 --- /dev/null +++ b/node-test/holesky_tests.yml @@ -0,0 +1,112 @@ +name: holesky tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + besu: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: holesky + el_name: besu + cl_name: ${{matrix.cl_name}} + erigon: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: holesky + el_name: erigon + cl_name: ${{matrix.cl_name}} + geth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: holesky + el_name: geth + cl_name: ${{matrix.cl_name}} + + nethermind: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: holesky + el_name: nethermind + cl_name: ${{matrix.cl_name}} + reth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + networK: holesky + el_name: reth + cl_name: ${{matrix.cl_name}} diff --git a/node-test/mainnet_tests.yml b/node-test/mainnet_tests.yml new file mode 100644 index 0000000..369c279 --- /dev/null +++ b/node-test/mainnet_tests.yml @@ -0,0 +1,112 @@ +name: mainnet tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + besu: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: mainnet + el_name: besu + cl_name: ${{matrix.cl_name}} + erigon: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: mainnet + el_name: erigon + cl_name: ${{matrix.cl_name}} + geth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: mainnet + el_name: geth + cl_name: ${{matrix.cl_name}} + + nethermind: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: mainnet + el_name: nethermind + cl_name: ${{matrix.cl_name}} + reth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + networK: mainnet + el_name: reth + cl_name: ${{matrix.cl_name}} diff --git a/node-test/sepolia_tests.yml b/node-test/sepolia_tests.yml new file mode 100644 index 0000000..0ed618c --- /dev/null +++ b/node-test/sepolia_tests.yml @@ -0,0 +1,112 @@ +name: sepolia tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + besu: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: sepolia + el_name: besu + cl_name: ${{matrix.cl_name}} + erigon: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: sepolia + el_name: erigon + cl_name: ${{matrix.cl_name}} + geth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: sepolia + el_name: geth + cl_name: ${{matrix.cl_name}} + + nethermind: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + network: sepolia + el_name: nethermind + cl_name: ${{matrix.cl_name}} + reth: + runs-on: ubuntu-24.04 + strategy: + matrix: + cl_name: + - lighthouse + - lodestar + - nimbus-eth2 + - prysm + - teku + fail-fast: false + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - uses: ./node-test + with: + networK: sepolia + el_name: reth + cl_name: ${{matrix.cl_name}} diff --git a/run-a-client.sh b/run-a-client.sh old mode 100644 new mode 100755 index b594a2e..eb89e52 --- a/run-a-client.sh +++ b/run-a-client.sh @@ -30,7 +30,7 @@ create_data_dir_if_not_exists() { create_secrets_file_if_not_exists() { local file="$1" if [ ! -f "$file" ]; then - openssl rand -hex 32 | tr -d "\n" | sudo tee "$file" > /dev/null + openssl rand -hex 32 | tr -d "\n" | tee "$file" > /dev/null fi } @@ -182,11 +182,11 @@ export shared_run if [ -n "$client_name" ]; then script="$script_dir/clients/$client_name/$latest_client_version/run-$client_name.sh" chmod +x "$script" - "$script" --conf-file "$script_dir/network/$network/$sub_dir/$client_name/$client_name-$network.conf" $additional_confs + exec "$script" --conf-file "$script_dir/network/$network/$sub_dir/$client_name/$client_name-$network.conf" $additional_confs elif [ "$run" == "validator" ]; then script="$script_dir/clients/$consensus_client/$latest_consensus_client_version/run-validator.sh" chmod +x "$script" - "$script" --env-file "$script_dir/network/$network/$execution_client-$consensus_client/validator.conf" + exec "$script" --env-file "$script_dir/network/$network/$execution_client-$consensus_client/validator.conf" else echo "Unsupported option" exit 1 diff --git a/tests/helper/test_helper.bash b/tests/helper/test_helper.bash new file mode 100644 index 0000000..eec78c0 --- /dev/null +++ b/tests/helper/test_helper.bash @@ -0,0 +1,311 @@ +#!/usr/bin/env bash + +el_pid= +cl_pid= + +kill_process() { + local pid="$1" + local output + local attempt=1 + local killed=false + + until [ $attempt -gt 9 ]; do + if ! ps -p "$pid" >/dev/null 2>&1; then + killed=true + break + fi + + output=$(kill "$pid" 2>&1) + if [ "$?" == 0 ]; then + killed=true + break + fi + + attempt=$((attempt + 1)) + done + + if [ "$killed" = false ]; then + output=$(kill -9 "$pid" 2>&1) + fi +} + +helper_cleanup() { + echo "Cleaning up background processes and logs..." + kill_process "$el_pid" + kill_process "$cl_pid" +} + +kill_process_on_port() { + local port="$1" + local pid + + pid=$(lsof -ti :$port 2>&1 || true) + + if ! [ -z "$pid"]; then + echo "killing pid: $pid" >&2 + + kill -9 $pid + fi +} + +trap helper_cleanup EXIT INT SIGINT SIGTERM + +call_rpc_api() { + local url=$1 + local payload=$2 + local response + + echo "curl -s -X POST --data '"$payload"' -H "Content-Type: application/json" $url" >&2 + response=$(curl -s -X POST --data "$payload" -H "Content-Type: application/json" $url || true) + + if echo "$response" | grep -q '"result"'; then + echo "$response" + else + echo "execution client is offline or unreachable." >&2 + exit 1 + fi +} + +call_json_api() { + local url=$1 + local response + + echo "curl -s -X GET -H "Content-Type: application/json" $url" >&2 + response=$(curl -s -X GET -H "Content-Type: application/json" $url || true) + + if echo "$response" | grep -q '"data"'; then + echo "$response" + else + echo "client is offline or unreachable." >&2 + exit 1 + fi +} + +get_chain_id_on_eth1() { + local url=$1 + local payload='{"jsonrpc":"2.0","method":"eth_chainId","params":[],"id":0}' + local response=$(call_rpc_api $url $payload) + local status=$? + if [ $status -ne 0 ]; then + exit $status + fi + echo "response: $response" >&2 + local chain_id=$(echo $response | jq '.result' | sed 's/"//g') + printf "%d" $chain_id +} + +get_chain_id_on_beacon_chain() { + local url=$1 + local response=$(call_json_api "$url/eth/v1/config/deposit_contract") + local status=$? + if [ $status -ne 0 ]; then + exit $status + fi + echo "response: $response" >&2 + local chain_id=$(echo $response | jq '.data.chain_id' | sed 's/"//g') + echo $chain_id +} + +get_el_syncing() { + local url=$1 + local payload='{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":0}' + local response=$(call_rpc_api $url $payload) + local status=$? + if [ $status -ne 0 ]; then + exit $status + fi + echo "$response" >&2 + local result=$(echo $response | jq '.result') + echo $result +} + +get_chain_id_for_network() { + local network="$1" + + if [ "mainnet" = "$network" ]; then + echo 1 + elif [ "sepolia" = "$network" ]; then + echo 11155111 # use hex stripped id, TODO fix it later on + elif [ "holesky" = "$network" ]; then + echo 17000 + elif [ "ephemery" = "$network" ]; then + local network_id=$(cat $HOME/.run-a-node/ephemery/ephemery/genesis.json | grep chainId | tr -d ',' | sed 's/"chainId"://g' | tr -d '[:space:]') + echo $network_id + elif [ "testnet" = "$network" ]; then + echo 1337 + else + echo "Unsupported $network" >&2 + exit 1 + fi +} + +check_network() { + local url="$1" + local network="$2" + local expected_chain_id=$(get_chain_id_for_network $network) + local chain_id=$(get_chain_id $url) + local status=$? + if [ $status -ne 0 ]; then + exit $status + fi + + [ "$expected_chain_id" == "$chain_id" ] +} + +error_not_network() { + local network="$1" + local client="$2" + echo "Error: Network is not $network for $client" + exit 1 +} + +test_sync() { + local cl_sync_status=$1 + local el_sync_status=$2 + local cl=$3 + local el=$4 + local network=$5 + local el_offline=$(echo $cl_sync_status | jq .data.el_offline) + local cl_is_syncing=$(echo $cl_sync_status | jq .data.is_syncing) + local cl_is_optimistic=$(echo $cl_sync_status | jq .data.is_optimistic) + + # strange on mainnet sync is quicker than on sepolia + if [ "$cl_is_syncing" = "false" ] && [ "$cl_is_optimistic" = "true" ]; then + : # it means we are synced with CL, but EL is still syncing + elif [ "$cl_is_syncing" = "false" ] && [ "$cl_is_optimistic" = "false" ] && [ "$cl" = "lighthouse" ]; then + : # when lighthouse is stalled, it returns false, meaning it started to sync, but there is no peer + : # TODO bettter test for this + : # this happens mostly on sepolia network + : # ephmerey is always syncing + # elif [ "$cl_is_syncing" = "true" ] && [ "$network" = "ephemery" ]; then + # : # still syncing on some networks + elif [ "$cl_is_syncing" = "true" ] && [ "$cl_is_optimistic" = "true" ]; then + : # still syncing on some networks + else + echo "Consensus client is not syncing" # we are testing for checkpoint sync in this case + exit 1 + fi + + if [ "prysm" = "$cl" ]; then + # BUG with prysm until version 5.0.4 + [ "true" = "$el_offline" ] || { + echo "$el is offline" + exit 1 + } + else + [ "false" = "$el_offline" ] || { + echo "$el is offline" + exit 1 + } + fi + + # on mainnet after CL sync (checkpoint sync), the client should be syncing (mainnet, sepolia, holesky) + if [ "false" = "$el_sync_status" ]; then + if [ "sepolia" = "$network" ] && [ "besu" == "$el" ] && [ "lodestar" == "$cl" ]; then + : # besu reports wrong status + elif [ "sepolia" = "$network" ] && [ "besu" == "$el" ] && [ "nimbus-eth2" == "$cl" ]; then + : # besu reports wrong status + elif [ "sepolia" = "$network" ] && [ "besu" == "$el" ] && [ "teku" == "$cl" ]; then + : # besu reports wrong status + elif [ "sepolia" = "$network" ] && [ "reth" == "$el" ] && [ "lodestar" == "$cl" ]; then + : # reth reports wrong status + elif [ "sepolia" = "$network" ] && [ "reth" == "$el" ] && [ "nimbus-eth2" == "$cl" ]; then + : # reth reports wrong status + # elif [ "ephemery" = "$network" ] && [ "besu" == "$el" ]; then + # : # besu returns false on ephemery + else + echo "el is not syncing" + exit 1 + fi + fi + +} + +run_test() { + # Arrange + local network="$1" + local el="$2" + local cl="$3" + local wait_time="$4" + local output_log_el output_log_cl + local expected_chain_id + local chain_id_cl chain_id_el + local cl_sync_status el_offline cl_is_syncing el_sync_status cl_is_optimistic + + output_log_cl=$(mktemp) + output_log_el=$(mktemp) + + # TODO shared data dir, this will need to be fixed + # tests should use a random dir + rm -rf "$HOME/.run-a-node" + + # kill hanging processes on ports, from previous tests, if exists + # TODO should be coming from the config shared_port, el_discovery_port and cl_discovery_port + kill_process_on_port "8551" + kill_process_on_port "30303" + kill_process_on_port "9000" + kill_process_on_port "8545" + kill_process_on_port "5052" + + # Act + bash run-a-client.sh --network "$network" --el "$el" >"$output_log_el" 2>&1 & + el_pid=$! + + if [ "ephemery" = "$network" ]; then + sleep 30 # wait until ephemery state downloads + fi + + nohup ./run-a-client.sh --network "$network" --cl "$cl" >"$output_log_cl" 2>&1 & + cl_pid=$! + + # echo "---------------- CL LOG ---------------------" + # cat $output_log_cl + + # echo "---------------- EL LOG ---------------------" + # cat $output_log_el + + # must run after starting one client, as ephemery network id is coming from file + expected_chain_id=$(get_chain_id_for_network $network) + + sleep "$wait_time" + + chain_id_el=$(get_chain_id_on_eth1 "http://localhost:8545" || true) + chain_id_cl=$(get_chain_id_on_beacon_chain "http://localhost:5052" || true) + cl_sync_status=$(call_json_api "http://localhost:5052/eth/v1/node/syncing" || true) + echo "response: $cl_sync_status" >&2 + + el_sync_status=$(get_el_syncing "http://localhost:8545" || true) + echo "response: $el_sync_status" >&2 + + kill_process "$el_pid" + + #cat "$output_log_el" + + # Cleanup first, otherwise test process will hang + # fix lodestar hanging issue, while running the tests + if [ "lodestar" = "$cl" ]; then + pkill -P "$cl_pid" >/dev/null 2>&1 + else + kill_process "$cl_pid" + fi + + # Assert + [ "$expected_chain_id" = "$chain_id_el" ] || { + if [ "ephemery" = "$network" ] && [ "geth" = "$el"]; then + : # geth returns wrong chain_id on ephemery + elif [ "ephemery" = "$network" ] && [ "erigon" = "$el"]; then + : # geth returns wrong chain_id on ephemery + else + echo "Execution client started on wrong network expected: $expected_chain_id, received: $chain_id_el" + cat $output_log_el + exit 1 + fi + } + [ "$expected_chain_id" = "$chain_id_cl" ] || { + echo "Consensus client started on wrong network expected: $expected_chain_id, received: $chain_id_cl" + cat $output_log_cl + exit 1 + } + + test_sync "$cl_sync_status" "$el_sync_status" "$cl" "$el" "$network" +} diff --git a/tests/test_ephemery.bats b/tests/test_ephemery.bats new file mode 100644 index 0000000..eee79a5 --- /dev/null +++ b/tests/test_ephemery.bats @@ -0,0 +1,264 @@ +#!/usr/bin/env bats + +set -euo pipefail + +chmod +x run-a-client.sh + +load helper/test_helper.bash + +network=ephemery +# wait time until cl endpoints are running (with slower internet) +lighthouse_wait_time=180 #requires initial checkpoint sync +lodestar_wait_time=180 # requires initial checkpoint sync +nimbus_eth2_wait_time=20 # starts before initial checkpoint sync +prysm_wait_time=60 # had to increase time as the el_offline takes time +teku_wait_time=30 + +besu_wait_time=120 # +erigon_wait_time=60 # +geth_wait_time=60 +nethermind_wait_time=60 +reth_wait_time=60 + +cleanup() { + helper_cleanup +} + +trap cleanup EXIT INT SIGINT SIGTERM + +get_wait_time() { + if [ "$1" -gt "$2" ]; then + echo $1 + else + echo $2 + fi +} + +# In theory it could be run through for loop, but then filter won't work with bats +# we need filter on CI and locally to only run client specific tests + +## Besu tests +@test "$network: besu-lighthouse" { + local el_name="besu" + local cl_name="lighthouse" + local wait_time=$(get_wait_time $besu_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-lodestar" { + local el_name="besu" + local cl_name="lodestar" + local wait_time=$(get_wait_time $besu_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-nimbus-eth2" { + local el_name="besu" + local cl_name="nimbus-eth2" + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-prysm" { + local el_name="besu" + local cl_name="prysm" + local wait_time=$(get_wait_time $besu_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-teku" { + local el_name="besu" + local cl_name="teku" + local wait_time=$(get_wait_time $besu_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# erigon tests +@test "$network: erigon-lighthouse" { + local el_name="erigon" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $erigon_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-lodestar" { + local el_name="erigon" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $erigon_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-nimbus-eth2" { + local el_name="erigon" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# TODO failing +@test "$network: erigon-prysm" { + local el_name="erigon" + local cl_name="prysm" + + local wait_time=$(get_wait_time $erigon_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} +# TODO failing +@test "$network: erigon-teku" { + local el_name="erigon" + local cl_name="teku" + + local wait_time=$(get_wait_time $erigon_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## geth +@test "$network: geth-lighthouse" { + local el_name="geth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $geth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-lodestar" { + local el_name="geth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $geth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-nimbus-eth2" { + local el_name="geth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $geth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-prysm" { + local el_name="geth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $geth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-teku" { + local el_name="geth" + local cl_name="teku" + + local wait_time=$(get_wait_time $geth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## nethermind +@test "$network: nethermind-lighthouse" { + local el_name="nethermind" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $nethermind_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-lodestar" { + local el_name="nethermind" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $nethermind_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-nimbus-eth2" { + local el_name="nethermind" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $nethermind_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-prysm" { + local el_name="nethermind" + local cl_name="prysm" + + local wait_time=$(get_wait_time $nethermind_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-teku" { + local el_name="nethermind" + local cl_name="teku" + + local wait_time=$(get_wait_time $nethermind_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## reth +@test "$network: reth-lighthouse" { + local el_name="reth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $reth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-lodestar" { + local el_name="reth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $reth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-nimbus-eth2" { + local el_name="reth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $reth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-prysm" { + local el_name="reth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $reth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-teku" { + local el_name="reth" + local cl_name="teku" + + local wait_time=$(get_wait_time $reth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} diff --git a/tests/test_holesky.bats b/tests/test_holesky.bats new file mode 100644 index 0000000..796197f --- /dev/null +++ b/tests/test_holesky.bats @@ -0,0 +1,263 @@ +#!/usr/bin/env bats + +set -euo pipefail + +chmod +x run-a-client.sh + +load helper/test_helper.bash + +network=holesky +# wait time until cl endpoints are running (with slower internet) +lighthouse_wait_time=180 #requires initial checkpoint sync +lodestar_wait_time=180 # requires initial checkpoint sync +nimbus_eth2_wait_time=20 # starts before initial checkpoint sync +prysm_wait_time=60 # had to increase time as the el_offline takes time +teku_wait_time=60 + +besu_wait_time=420 # for sync status, but besu api starts in 10s +erigon_wait_time=420 # yup, it is downloading snapshots on mainnet, which is very slow ... +geth_wait_time=420 +nethermind_wait_time=480 # nethermind-lighthouse needs more time to sync +reth_wait_time=420 + +cleanup() { + helper_cleanup +} + +trap cleanup EXIT INT SIGINT SIGTERM + +get_wait_time() { + if [ "$1" -gt "$2" ]; then + echo $1 + else + echo $2 + fi +} + +# In theory it could be run through for loop, but then filter won't work with bats +# we need filter on CI and locally to only run client specific tests + +## Besu tests +@test "$network: besu-lighthouse" { + local el_name="besu" + local cl_name="lighthouse" + local wait_time=$(get_wait_time $besu_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-lodestar" { + local el_name="besu" + local cl_name="lodestar" + local wait_time=$(get_wait_time $besu_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-nimbus-eth2" { + local el_name="besu" + local cl_name="nimbus-eth2" + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + # this actually finishes in 2 minutes, kept for consistency with other tests + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-prysm" { + local el_name="besu" + local cl_name="prysm" + local wait_time=$(get_wait_time $besu_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-teku" { + local el_name="besu" + local cl_name="teku" + local wait_time=$(get_wait_time $besu_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# erigon tests +@test "$network: erigon-lighthouse" { + local el_name="erigon" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $erigon_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-lodestar" { + local el_name="erigon" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $erigon_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-nimbus-eth2" { + local el_name="erigon" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-prysm" { + local el_name="erigon" + local cl_name="prysm" + + local wait_time=$(get_wait_time $erigon_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} +@test "$network: erigon-teku" { + local el_name="erigon" + local cl_name="teku" + + local wait_time=$(get_wait_time $erigon_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## geth +@test "$network: geth-lighthouse" { + local el_name="geth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $geth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-lodestar" { + local el_name="geth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $geth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-nimbus-eth2" { + local el_name="geth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $geth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-prysm" { + local el_name="geth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $geth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-teku" { + local el_name="geth" + local cl_name="teku" + + local wait_time=$(get_wait_time $geth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## nethermind +@test "$network: nethermind-lighthouse" { + local el_name="nethermind" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $nethermind_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-lodestar" { + local el_name="nethermind" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $nethermind_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-nimbus-eth2" { + local el_name="nethermind" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $nethermind_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-prysm" { + local el_name="nethermind" + local cl_name="prysm" + + local wait_time=$(get_wait_time $nethermind_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-teku" { + local el_name="nethermind" + local cl_name="teku" + + local wait_time=$(get_wait_time $nethermind_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## reth +@test "$network: reth-lighthouse" { + local el_name="reth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $reth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-lodestar" { + local el_name="reth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $reth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-nimbus-eth2" { + local el_name="reth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $reth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-prysm" { + local el_name="reth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $reth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-teku" { + local el_name="reth" + local cl_name="teku" + + local wait_time=$(get_wait_time $reth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} diff --git a/tests/test_mainnet.bats b/tests/test_mainnet.bats new file mode 100755 index 0000000..103d315 --- /dev/null +++ b/tests/test_mainnet.bats @@ -0,0 +1,263 @@ +#!/usr/bin/env bats + +set -euo pipefail + +chmod +x run-a-client.sh + +load helper/test_helper.bash + +network=mainnet +# wait time until cl endpoints are running (with slower internet) +lighthouse_wait_time=180 #requires initial checkpoint sync +lodestar_wait_time=180 # requires initial checkpoint sync +nimbus_eth2_wait_time=20 # starts before initial checkpoint sync +prysm_wait_time=60 # had to increase time as the el_offline takes time +teku_wait_time=60 + +besu_wait_time=420 # for sync status, but besu api starts in 10s +erigon_wait_time=420 # yup, it is downloading snapshots on mainnet, which is very slow ... +geth_wait_time=420 +nethermind_wait_time=480 # nethermind-lighthouse needs more time to sync +reth_wait_time=420 + +cleanup() { + helper_cleanup +} + +trap cleanup EXIT INT SIGINT SIGTERM + +get_wait_time() { + if [ "$1" -gt "$2" ]; then + echo $1 + else + echo $2 + fi +} + +# In theory it could be run through for loop, but then filter won't work with bats +# we need filter on CI and locally to only run client specific tests + +## Besu tests +@test "$network: besu-lighthouse" { + local el_name="besu" + local cl_name="lighthouse" + local wait_time=$(get_wait_time $besu_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-lodestar" { + local el_name="besu" + local cl_name="lodestar" + local wait_time=$(get_wait_time $besu_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-nimbus-eth2" { + local el_name="besu" + local cl_name="nimbus-eth2" + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + # this actually finishes in 2 minutes, kept for consistency with other tests + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-prysm" { + local el_name="besu" + local cl_name="prysm" + local wait_time=$(get_wait_time $besu_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-teku" { + local el_name="besu" + local cl_name="teku" + local wait_time=$(get_wait_time $besu_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# erigon tests +@test "$network: erigon-lighthouse" { + local el_name="erigon" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $erigon_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-lodestar" { + local el_name="erigon" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $erigon_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-nimbus-eth2" { + local el_name="erigon" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-prysm" { + local el_name="erigon" + local cl_name="prysm" + + local wait_time=$(get_wait_time $erigon_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} +@test "$network: erigon-teku" { + local el_name="erigon" + local cl_name="teku" + + local wait_time=$(get_wait_time $erigon_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## geth +@test "$network: geth-lighthouse" { + local el_name="geth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $geth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-lodestar" { + local el_name="geth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $geth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-nimbus-eth2" { + local el_name="geth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $geth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-prysm" { + local el_name="geth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $geth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-teku" { + local el_name="geth" + local cl_name="teku" + + local wait_time=$(get_wait_time $geth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## nethermind +@test "$network: nethermind-lighthouse" { + local el_name="nethermind" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $nethermind_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-lodestar" { + local el_name="nethermind" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $nethermind_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-nimbus-eth2" { + local el_name="nethermind" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $nethermind_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-prysm" { + local el_name="nethermind" + local cl_name="prysm" + + local wait_time=$(get_wait_time $nethermind_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-teku" { + local el_name="nethermind" + local cl_name="teku" + + local wait_time=$(get_wait_time $nethermind_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## reth +@test "$network: reth-lighthouse" { + local el_name="reth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $reth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-lodestar" { + local el_name="reth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $reth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-nimbus-eth2" { + local el_name="reth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $reth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-prysm" { + local el_name="reth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $reth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-teku" { + local el_name="reth" + local cl_name="teku" + + local wait_time=$(get_wait_time $reth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} diff --git a/tests/test_sepolia.bats b/tests/test_sepolia.bats new file mode 100644 index 0000000..cab9eeb --- /dev/null +++ b/tests/test_sepolia.bats @@ -0,0 +1,263 @@ +#!/usr/bin/env bats + +set -euo pipefail + +chmod +x run-a-client.sh + +load helper/test_helper.bash + +network=sepolia +# wait time until cl endpoints are running (with slower internet) +lighthouse_wait_time=180 #requires initial checkpoint sync +lodestar_wait_time=180 # requires initial checkpoint sync +nimbus_eth2_wait_time=20 # starts before initial checkpoint sync +prysm_wait_time=60 # had to increase time as the el_offline takes time +teku_wait_time=60 + +besu_wait_time=420 # for sync status, but besu api starts in 10s +erigon_wait_time=420 # yup, it is downloading snapshots on mainnet, which is very slow ... +geth_wait_time=420 +nethermind_wait_time=480 # nethermind-lighthouse needs more time to sync +reth_wait_time=420 + +cleanup() { + helper_cleanup +} + +trap cleanup EXIT INT SIGINT SIGTERM + +get_wait_time() { + if [ "$1" -gt "$2" ]; then + echo $1 + else + echo $2 + fi +} + +# In theory it could be run through for loop, but then filter won't work with bats +# we need filter on CI and locally to only run client specific tests + +## Besu tests +@test "$network: besu-lighthouse" { + local el_name="besu" + local cl_name="lighthouse" + local wait_time=$(get_wait_time $besu_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-lodestar" { + local el_name="besu" + local cl_name="lodestar" + local wait_time=$(get_wait_time $besu_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-nimbus-eth2" { + local el_name="besu" + local cl_name="nimbus-eth2" + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + # this actually finishes in 2 minutes, kept for consistency with other tests + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-prysm" { + local el_name="besu" + local cl_name="prysm" + local wait_time=$(get_wait_time $besu_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-teku" { + local el_name="besu" + local cl_name="teku" + local wait_time=$(get_wait_time $besu_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# erigon tests +@test "$network: erigon-lighthouse" { + local el_name="erigon" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $erigon_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-lodestar" { + local el_name="erigon" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $erigon_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-nimbus-eth2" { + local el_name="erigon" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-prysm" { + local el_name="erigon" + local cl_name="prysm" + + local wait_time=$(get_wait_time $erigon_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} +@test "$network: erigon-teku" { + local el_name="erigon" + local cl_name="teku" + + local wait_time=$(get_wait_time $erigon_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## geth +@test "$network: geth-lighthouse" { + local el_name="geth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $geth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-lodestar" { + local el_name="geth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $geth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-nimbus-eth2" { + local el_name="geth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $geth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-prysm" { + local el_name="geth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $geth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-teku" { + local el_name="geth" + local cl_name="teku" + + local wait_time=$(get_wait_time $geth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## nethermind +@test "$network: nethermind-lighthouse" { + local el_name="nethermind" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $nethermind_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-lodestar" { + local el_name="nethermind" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $nethermind_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-nimbus-eth2" { + local el_name="nethermind" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $nethermind_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-prysm" { + local el_name="nethermind" + local cl_name="prysm" + + local wait_time=$(get_wait_time $nethermind_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-teku" { + local el_name="nethermind" + local cl_name="teku" + + local wait_time=$(get_wait_time $nethermind_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## reth +@test "$network: reth-lighthouse" { + local el_name="reth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $reth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-lodestar" { + local el_name="reth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $reth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-nimbus-eth2" { + local el_name="reth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $reth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-prysm" { + local el_name="reth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $reth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-teku" { + local el_name="reth" + local cl_name="teku" + + local wait_time=$(get_wait_time $reth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} diff --git a/tests/test_testnet.bats b/tests/test_testnet.bats new file mode 100644 index 0000000..f14938d --- /dev/null +++ b/tests/test_testnet.bats @@ -0,0 +1,264 @@ +#!/usr/bin/env bats + +set -euo pipefail + +chmod +x run-a-client.sh + +load helper/test_helper.bash + +network=testnet +# wait time until cl endpoints are running (with slower internet) +lighthouse_wait_time=180 #requires initial checkpoint sync +lodestar_wait_time=180 # requires initial checkpoint sync +nimbus_eth2_wait_time=20 # starts before initial checkpoint sync +prysm_wait_time=60 # had to increase time as the el_offline takes time +teku_wait_time=30 + +besu_wait_time=420 # +erigon_wait_time=420 # +geth_wait_time=420 +nethermind_wait_time=420 +reth_wait_time=420 + +cleanup() { + helper_cleanup +} + +trap cleanup EXIT INT SIGINT SIGTERM + +get_wait_time() { + if [ "$1" -gt "$2" ]; then + echo $1 + else + echo $2 + fi +} + +# In theory it could be run through for loop, but then filter won't work with bats +# we need filter on CI and locally to only run client specific tests + +## Besu tests +@test "$network: besu-lighthouse" { + local el_name="besu" + local cl_name="lighthouse" + local wait_time=$(get_wait_time $besu_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-lodestar" { + local el_name="besu" + local cl_name="lodestar" + local wait_time=$(get_wait_time $besu_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-nimbus-eth2" { + local el_name="besu" + local cl_name="nimbus-eth2" + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-prysm" { + local el_name="besu" + local cl_name="prysm" + local wait_time=$(get_wait_time $besu_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: besu-teku" { + local el_name="besu" + local cl_name="teku" + local wait_time=$(get_wait_time $besu_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# erigon tests +@test "$network: erigon-lighthouse" { + local el_name="erigon" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $erigon_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-lodestar" { + local el_name="erigon" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $erigon_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: erigon-nimbus-eth2" { + local el_name="erigon" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $besu_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +# TODO failing +@test "$network: erigon-prysm" { + local el_name="erigon" + local cl_name="prysm" + + local wait_time=$(get_wait_time $erigon_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} +# TODO failing +@test "$network: erigon-teku" { + local el_name="erigon" + local cl_name="teku" + + local wait_time=$(get_wait_time $erigon_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## geth +@test "$network: geth-lighthouse" { + local el_name="geth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $geth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-lodestar" { + local el_name="geth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $geth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-nimbus-eth2" { + local el_name="geth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $geth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-prysm" { + local el_name="geth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $geth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: geth-teku" { + local el_name="geth" + local cl_name="teku" + + local wait_time=$(get_wait_time $geth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## nethermind +@test "$network: nethermind-lighthouse" { + local el_name="nethermind" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $nethermind_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-lodestar" { + local el_name="nethermind" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $nethermind_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-nimbus-eth2" { + local el_name="nethermind" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $nethermind_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-prysm" { + local el_name="nethermind" + local cl_name="prysm" + + local wait_time=$(get_wait_time $nethermind_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: nethermind-teku" { + local el_name="nethermind" + local cl_name="teku" + + local wait_time=$(get_wait_time $nethermind_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +## reth +@test "$network: reth-lighthouse" { + local el_name="reth" + local cl_name="lighthouse" + + local wait_time=$(get_wait_time $reth_wait_time $lighthouse_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-lodestar" { + local el_name="reth" + local cl_name="lodestar" + + local wait_time=$(get_wait_time $reth_wait_time $lodestar_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-nimbus-eth2" { + local el_name="reth" + local cl_name="nimbus-eth2" + + local wait_time=$(get_wait_time $reth_wait_time $nimbus_eth2_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-prysm" { + local el_name="reth" + local cl_name="prysm" + + local wait_time=$(get_wait_time $reth_wait_time $prysm_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +} + +@test "$network: reth-teku" { + local el_name="reth" + local cl_name="teku" + + local wait_time=$(get_wait_time $reth_wait_time $teku_wait_time) + + run_test "$network" "$el_name" "$cl_name" "$wait_time" +}