From 3d27b1832057473af311430362c4d9f4878c8c67 Mon Sep 17 00:00:00 2001 From: Yorick Downe Date: Fri, 24 Jul 2026 14:20:32 +0000 Subject: [PATCH] Besu same port IPv6 --- besu.yml | 2 +- besu/docker-entrypoint.sh | 20 +++++++++++++++----- default.env | 2 -- 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/besu.yml b/besu.yml index 781e1a2b..a52cf628 100644 --- a/besu.yml +++ b/besu.yml @@ -28,7 +28,7 @@ services: - NODE_TYPE=${EL_NODE_TYPE:-pre-merge-expiry} - NETWORK=${NETWORK} - IPV6=${IPV6:-false} - - EL_P2P_PORT_2=${EL_P2P_PORT_2:-30304} + - EL_P2P_PORT=${EL_P2P_PORT:-30303} - COMPOSE_FILE=${COMPOSE_FILE} volumes: - besu-el-data:/var/lib/besu diff --git a/besu/docker-entrypoint.sh b/besu/docker-entrypoint.sh index 219f9d90..6d24ed39 100755 --- a/besu/docker-entrypoint.sh +++ b/besu/docker-entrypoint.sh @@ -55,12 +55,22 @@ if [[ "${NETWORK}" =~ ^https?:// ]]; then git pull origin "${branch}" fi config_dir_path="/var/lib/besu/testnet/${config_dir}" - if [[ -f "${config_dir_path}/enodes.yaml" ]]; then + if [[ -f "${config_dir_path}/enodes.txt" ]]; then + bootnodes="$(paste -sd, "${config_dir_path}/enodes.txt")" + else bootnodes="$(awk -F'- ' '!/^#/ && NF>1 { split($2, a, /[ \t#]/); if (a[1] != "") printf (first++ ? "," : "") a[1] } END { print "" }' "${config_dir_path}/enodes.yaml")" + fi + if [[ -f "${config_dir_path}/bootstrap_nodes.txt" ]]; then + v5_bootnodes="$(paste -sd, "${config_dir_path}/bootstrap_nodes.txt")" else - bootnodes="$(paste -sd, "${config_dir_path}/enodes.txt")" + v5_bootnodes="$(awk -F'- ' '!/^#/ && NF>1 { split($2, a, /[ \t#]/); if (a[1] != "") printf (first++ ? "," : "") a[1] } END { print "" }' "${config_dir_path}/bootstrap_nodes.yaml")" + fi + if [[ -n "${bootnodes}" && -n "${v5_bootnodes}" ]]; then + bootnodes+=",${v5_bootnodes}" + elif [[ -n "${v5_bootnodes}" ]]; then + bootnodes="${v5_bootnodes}" fi - __network="--genesis-file=${config_dir_path}/besu.json --bootnodes=${bootnodes}" + __network="--genesis-file=${config_dir_path}/besu.json --bootnodes=${bootnodes} --bonsai-limit-trie-logs-enabled=false" else __network="--network ${NETWORK}" fi @@ -116,9 +126,9 @@ else fi # DiscV5 for IPV6 -if [[ "${IPV6:-false}" = "true" ]]; then +if [[ "${IPV6}" = "true" ]]; then echo "Configuring Besu for discv5 for IPv6 advertisements" - __ipv6="--Xv5-discovery-enabled --p2p-interface-ipv6=:: --p2p-port-ipv6=${EL_P2P_PORT_2} --p2p-ipv6-outbound-enabled" + __ipv6="--p2p-interface-ipv6=:: --p2p-port-ipv6=${EL_P2P_PORT} --p2p-ipv6-outbound-enabled" # Address discovery on v6 is not implemented ipv6_pattern="^[0-9A-Fa-f]{1,4}:" # Sufficient to check the start set +e diff --git a/default.env b/default.env index ae1ea71e..6ce04ec2 100644 --- a/default.env +++ b/default.env @@ -158,8 +158,6 @@ DOCKER_EXT_NETWORK=rocketpool_net # P2P ports you will forward to your staking node. Adjust here if you are # going to use something other than defaults. EL_P2P_PORT=30303 -# second EL P2P port used by Besu IPv6 -EL_P2P_PORT_2=30304 CL_P2P_PORT=9000 PRYSM_PORT=9000 PRYSM_UDP_PORT=9000