diff --git a/nethermind/docker-entrypoint.sh b/nethermind/docker-entrypoint.sh index 7ba6c40f..4fe38024 100755 --- a/nethermind/docker-entrypoint.sh +++ b/nethermind/docker-entrypoint.sh @@ -68,10 +68,20 @@ if [[ "${NETWORK}" =~ ^https?:// ]]; then git pull origin "${branch}" fi config_dir_path="/var/lib/nethermind/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="--config none.cfg --Init.ChainSpecPath=${config_dir_path}/chainspec.json --Discovery.Bootnodes=${bootnodes}" if [[ ! "${NODE_TYPE}" = "archive" ]]; then