From 7cc39035317d40afafb600025d29116c0af52b20 Mon Sep 17 00:00:00 2001 From: Robert Mordzon Date: Fri, 6 Dec 2024 10:28:45 +0100 Subject: [PATCH 1/2] Eth testnets support --- distros/raspberry_pi/config-consensus.txt | 7 +++---- distros/raspberry_pi/config-exec.txt | 7 +++---- distros/raspberry_pi/config.txt | 7 +++---- distros/raspberry_pi/geth/geth.sh | 8 +++++++- distros/raspberry_pi/lighthouse/lighthouse.sh | 7 ++++--- distros/raspberry_pi/nimbus/nimbus.sh | 14 ++++++++------ 6 files changed, 28 insertions(+), 22 deletions(-) diff --git a/distros/raspberry_pi/config-consensus.txt b/distros/raspberry_pi/config-consensus.txt index 8b32d77..f94b610 100644 --- a/distros/raspberry_pi/config-consensus.txt +++ b/distros/raspberry_pi/config-consensus.txt @@ -13,18 +13,17 @@ bnm=false # Execution endpoint address exec_url=http://eop-exec.local:8551 +# Ethereum network: mainnet/holesky/sepolia +eth_network=mainnet + [geth] geth_port=30303 [nimbus] nimbus_port=9000 -# Ethereum network: mainnet/holesky/sepolia -nimbus_network=mainnet [lighthouse] lighthouse_port=9000 -# Ethereum network: mainnet/holesky/sepolia -lighthouse_network=mainnet # End of Web3 Pi config diff --git a/distros/raspberry_pi/config-exec.txt b/distros/raspberry_pi/config-exec.txt index aa22848..ba8b298 100644 --- a/distros/raspberry_pi/config-exec.txt +++ b/distros/raspberry_pi/config-exec.txt @@ -13,18 +13,17 @@ bnm=false # Execution endpoint address exec_url=http://localhost:8551 +# Ethereum network: mainnet/holesky/sepolia +eth_network=mainnet + [geth] geth_port=30303 [nimbus] nimbus_port=9000 -# Ethereum network: mainnet/holesky/sepolia -nimbus_network=mainnet [lighthouse] lighthouse_port=9000 -# Ethereum network: mainnet/holesky/sepolia -lighthouse_network=mainnet # End of Web3 Pi config diff --git a/distros/raspberry_pi/config.txt b/distros/raspberry_pi/config.txt index e6ff757..76fd848 100644 --- a/distros/raspberry_pi/config.txt +++ b/distros/raspberry_pi/config.txt @@ -15,18 +15,17 @@ bnm=true # Execution endpoint address exec_url=http://localhost:8551 +# Ethereum network: mainnet/holesky/sepolia +eth_network=mainnet + [geth] geth_port=30303 [nimbus] nimbus_port=9000 -# Ethereum network: mainnet/holesky/sepolia -nimbus_network=mainnet [lighthouse] lighthouse_port=9000 -# Ethereum network: mainnet/holesky/sepolia -lighthouse_network=mainnet # End of Web3 Pi config diff --git a/distros/raspberry_pi/geth/geth.sh b/distros/raspberry_pi/geth/geth.sh index a2e40eb..dd914c3 100644 --- a/distros/raspberry_pi/geth/geth.sh +++ b/distros/raspberry_pi/geth/geth.sh @@ -49,7 +49,10 @@ set_status() { echolog " " } +echolog "Geth run script (geth.sh)" + geth_port="$(config_get geth_port)"; +eth_network="$(config_get eth_network)"; # Checking internet connection echolog "Checking internet connection" @@ -67,9 +70,12 @@ while [ $? -ne 0 ]; do ping -c 1 $pingServerAdr > /dev/null 2>&1 done +echolog "$(date): Connected - ${pingServerAdr}" +echolog "geth_port = ${geth_port}" +echolog "eth_network = ${eth_network}" echolog "$(date): Connected - ${pingServerAdr}" echolog "geth_port = ${geth_port}" echolog "Run Geth" -geth --authrpc.port 8551 --authrpc.addr 0.0.0.0 --authrpc.vhosts '*' --discovery.port ${geth_port} --port ${geth_port} --authrpc.jwtsecret /home/ethereum/clients/secrets/jwt.hex --datadir /mnt/storage/.ethereum --ws --ws.port 8546 --ws.addr 0.0.0.0 --ws.origins '*' --http --http.port 8545 --http.addr 0.0.0.0 --http.vhosts '*' --http.corsdomain '*' --state.scheme=path \ No newline at end of file +geth --${eth_network} --authrpc.port 8551 --authrpc.addr 0.0.0.0 --authrpc.vhosts '*' --discovery.port ${geth_port} --port ${geth_port} --authrpc.jwtsecret /home/ethereum/clients/secrets/jwt.hex --datadir /mnt/storage/.ethereum --ws --ws.port 8546 --ws.addr 0.0.0.0 --ws.origins '*' --http --http.port 8545 --http.addr 0.0.0.0 --http.vhosts '*' --http.corsdomain '*' --http.api eth,net,web3 --state.scheme=path \ No newline at end of file diff --git a/distros/raspberry_pi/lighthouse/lighthouse.sh b/distros/raspberry_pi/lighthouse/lighthouse.sh index e4db761..9e2d78d 100644 --- a/distros/raspberry_pi/lighthouse/lighthouse.sh +++ b/distros/raspberry_pi/lighthouse/lighthouse.sh @@ -49,9 +49,10 @@ set_status() { echolog " " } +echolog "Lighthouse run script (lighthouse.sh)" lighthouse_port="$(config_get lighthouse_port)"; -lighthouse_network="$(config_get lighthouse_network)"; +eth_network="$(config_get eth_network)"; exec_url="$(config_get exec_url)"; @@ -77,8 +78,8 @@ source /opt/web3pi/Ethereum-On-Raspberry-Pi/distros/raspberry_pi/scripts/ping_se echolog "$(date): Connected - ${pingServerAdr}" echolog "exec_url = ${exec_url}" echolog "lighthouse_port = ${lighthouse_port}" -echolog "lighthouse_network = ${lighthouse_network}" +echolog "eth_network = ${eth_network}" echolog "best_server = ${best_server} ($best_ping ms)" echolog "Run Lighthouse beacon node" -lighthouse bn --network ${lighthouse_network} --execution-endpoint ${exec_url} --execution-jwt /home/ethereum/clients/secrets/jwt.hex --checkpoint-sync-url ${best_server} --datadir /mnt/storage/.lighthouse --disable-deposit-contract-sync --http --http-address 0.0.0.0 --http-port 5052 --port ${lighthouse_port} \ No newline at end of file +lighthouse bn --network ${eth_network} --execution-endpoint ${exec_url} --execution-jwt /home/ethereum/clients/secrets/jwt.hex --checkpoint-sync-url ${best_server} --datadir /mnt/storage/.lighthouse --disable-deposit-contract-sync --http --http-address 0.0.0.0 --http-port 5052 --port ${lighthouse_port} \ No newline at end of file diff --git a/distros/raspberry_pi/nimbus/nimbus.sh b/distros/raspberry_pi/nimbus/nimbus.sh index fd5d654..00cd3f1 100644 --- a/distros/raspberry_pi/nimbus/nimbus.sh +++ b/distros/raspberry_pi/nimbus/nimbus.sh @@ -57,9 +57,11 @@ calculate_average_ping() { echo "$avg_ping" } +echolog "Nimbus run script (nimbus.sh)" + nimbus_port="$(config_get nimbus_port)"; exec_url="$(config_get exec_url)"; -nimbus_network="$(config_get nimbus_network)"; +eth_network="$(config_get eth_network)"; # Checking internet connection echolog "Checking internet connection" @@ -79,16 +81,16 @@ done # Directory for Nimbus -nimbus_dir="/mnt/storage/.nimbus/data/shared_${nimbus_network}_0" +nimbus_dir="/mnt/storage/.nimbus/data/shared_${eth_network}_0" echolog "$(date): Connected - ${pingServerAdr}" echolog "exec_url = ${exec_url}" echolog "nimbus_port = ${nimbus_port}" -echolog "nimbus_network = ${nimbus_network}" +echolog "eth_network = ${eth_network}" echolog "nimbus_dir = ${nimbus_dir}" # File with the list of servers -SERVERS_FILE="/opt/web3pi/Ethereum-On-Raspberry-Pi/distros/raspberry_pi/scripts/servers_list_${nimbus_network}.txt" +SERVERS_FILE="/opt/web3pi/Ethereum-On-Raspberry-Pi/distros/raspberry_pi/scripts/servers_list_${eth_network}.txt" if [ -f "${SERVERS_FILE}" ]; then echolog "SERVERS_FILE = ${SERVERS_FILE}" @@ -110,7 +112,7 @@ while read -r server; do echolog "Average ping = $avg_ping ms" # Run the Nimbus beacon node command and display output in real time - output=$(nimbus_beacon_node trustedNodeSync --network=${nimbus_network} --data-dir="$nimbus_dir" --trusted-node-url="$server" --backfill=false 2>&1) + output=$(nimbus_beacon_node trustedNodeSync --network=${eth_network} --data-dir="$nimbus_dir" --trusted-node-url="$server" --backfill=false 2>&1) # output=$(nimbus_beacon_node trustedNodeSync --network=mainnet --data-dir="$nimbus_dir" --trusted-node-url="$server" --backfill=false 2>&1 | tee /dev/tty) # Searching for a line containing 'horizon' and extracting the value. @@ -134,7 +136,7 @@ done < "$SERVERS_FILE" # If the trustedNodeSync was successful if [ "$success" = true ]; then echolog "Run Nimbus beacon node" - nimbus_beacon_node --non-interactive --tcp-port=${nimbus_port} --udp-port=${nimbus_port} --el=${exec_url} --network=${nimbus_network} --data-dir=${nimbus_dir} --jwt-secret=/home/ethereum/clients/secrets/jwt.hex --rest=true --rest-port=5052 --rest-address=0.0.0.0 --rest-allow-origin='*' --enr-auto-update + nimbus_beacon_node --non-interactive --tcp-port=${nimbus_port} --udp-port=${nimbus_port} --el=${exec_url} --network=${eth_network} --data-dir=${nimbus_dir} --jwt-secret=/home/ethereum/clients/secrets/jwt.hex --rest=true --rest-port=5052 --rest-address=0.0.0.0 --rest-allow-origin='*' --enr-auto-update else # If no server was successful echolog "All servers failed to complete the trustedNodeSync." From 27b9151341457dc1f16e959123116695c7f9c5c2 Mon Sep 17 00:00:00 2001 From: Robert Mordzon Date: Fri, 6 Dec 2024 10:31:43 +0100 Subject: [PATCH 2/2] set BRANCH="v0.7.4" --- distros/raspberry_pi/rc.local | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distros/raspberry_pi/rc.local b/distros/raspberry_pi/rc.local index fe23f27..d6b5f68 100644 --- a/distros/raspberry_pi/rc.local +++ b/distros/raspberry_pi/rc.local @@ -3,7 +3,7 @@ # Web3 Pi - rc.local # -BRANCH="main" +BRANCH="v0.7.4" # Function: echolog # Description: Logs messages with a timestamp prefix. If no arguments are provided,