Skip to content

Commit

Permalink
2nd attempt at v6 (eth-educators#1319)
Browse files Browse the repository at this point in the history
* First step for v6 support (eth-educators#1315)

* IPv6 support that works with Compose V1

* Fix typo

* Clarify that the switch to docker-ce is merely recommended
  • Loading branch information
yorickdowne authored Apr 18, 2023
1 parent 4f8a1f1 commit 3e5811e
Show file tree
Hide file tree
Showing 27 changed files with 63 additions and 51 deletions.
4 changes: 2 additions & 2 deletions besu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/besu/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion cl-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: "3.9"
services:
consensus:
ports:
- ${HOST_IP:-0.0.0.0}:${CL_REST_PORT:-5052}:${CL_REST_PORT:-5052}/tcp
- ${HOST_IP:-}${CL_REST_PORT:-5052}:${CL_REST_PORT:-5052}/tcp
2 changes: 2 additions & 0 deletions default.env
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ BEACON_STATS_API=
BEACON_STATS_MACHINE=

# IP of the host you want to use in Docker (in case host has several IPs)
# Note if you set it, and only then, you MUST append a colon to the end, like 1.2.3.4: or [2001:1:2::3]:, to work around
# a limitation of compose V1, even when using compose V2
HOST_IP=

# P2P ports you will forward to your staking node. Adjust here if you are
Expand Down
2 changes: 1 addition & 1 deletion ee-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version: "3.9"
services:
execution:
ports:
- ${HOST_IP:-0.0.0.0}:${EE_PORT}:${EE_PORT:-8551}/tcp
- ${HOST_IP:-}${EE_PORT}:${EE_PORT:-8551}/tcp
4 changes: 2 additions & 2 deletions el-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ version: "3.9"
services:
execution:
ports:
- ${HOST_IP:-0.0.0.0}:${EL_RPC_PORT}:${EL_RPC_PORT:-8545}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_WS_PORT}:${EL_WS_PORT:-8546}/tcp
- ${HOST_IP:-}${EL_RPC_PORT}:${EL_RPC_PORT:-8545}/tcp
- ${HOST_IP:-}${EL_WS_PORT}:${EL_WS_PORT:-8546}/tcp
16 changes: 8 additions & 8 deletions erigon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/erigon/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-0.0.0.0}:${ERIGON_P2P_PORT_2:-30304}:${ERIGON_P2P_PORT_2:-30304}/tcp
- ${HOST_IP:-0.0.0.0}:${ERIGON_P2P_PORT_2:-30304}:${ERIGON_P2P_PORT_2:-30304}/udp
- ${HOST_IP:-0.0.0.0}:${ERIGON_P2P_PORT_3:-30305}:${ERIGON_P2P_PORT_3:-30305}/tcp
- ${HOST_IP:-0.0.0.0}:${ERIGON_P2P_PORT_3:-30305}:${ERIGON_P2P_PORT_3:-30305}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${ERIGON_P2P_PORT_2:-30304}:${ERIGON_P2P_PORT_2:-30304}/tcp
- ${HOST_IP:-}${ERIGON_P2P_PORT_2:-30304}:${ERIGON_P2P_PORT_2:-30304}/udp
- ${HOST_IP:-}${ERIGON_P2P_PORT_3:-30305}:${ERIGON_P2P_PORT_3:-30305}/tcp
- ${HOST_IP:-}${ERIGON_P2P_PORT_3:-30305}:${ERIGON_P2P_PORT_3:-30305}/udp
# torrent ports
- ${HOST_IP:-0.0.0.0}:${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/tcp
- ${HOST_IP:-0.0.0.0}:${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/udp
- ${HOST_IP:-}${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/tcp
- ${HOST_IP:-}${ERIGON_TORRENT_PORT:-42069}:${ERIGON_TORRENT_PORT:-42069}/udp
networks:
default:
aliases:
Expand Down
5 changes: 4 additions & 1 deletion ethd
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,9 @@ envmigrate() {
if [[ "${var}" = "NETWORK" && "${value}" =~ "prater" ]]; then
value="goerli"
fi
if [[ "${var}" = "HOST_IP" && "${value: -1}" != ":" ]]; then
value="${value}:" # ComposeV1 requires this so I can do v6
fi
sed -i'.original' -e "s~^\(${var}\s*=\s*\).*$~\1${value}~" "${ENV_FILE}"
fi
done
Expand Down Expand Up @@ -2299,7 +2302,7 @@ value=$(sed -n -e "s/^${var}=\(.*\)/\1/p" ".env" || true)
if [ "${value}" = true ] && [ "${__old_compose}" -eq 1 ]; then
echo
echo "You are using docker-compose ${__compose_version}, which is unsupported by Docker, Inc. from June 2023 on."
echo "A switch to docker-ce is recommended. This is unfortunately a manual step that eth-docker cannot do for you."
echo "A switch to docker-ce is recommended. It is *not* mandatory. This is unfortunately a manual step that eth-docker cannot do for you."
echo "Please see https://eth-docker.net/Usage/Prerequisites#switching-from-dockerio-to-docker-ce for instructions."
echo "You can turn this message off by adjusting COMPOSEV1_NAG in .env"
fi
4 changes: 2 additions & 2 deletions geth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/goethereum/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion grafana-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.9"
services:
grafana:
ports:
- ${HOST_IP:-0.0.0.0}:${GRAFANA_PORT}:${GRAFANA_PORT}/tcp
- ${HOST_IP:-}${GRAFANA_PORT}:${GRAFANA_PORT}/tcp
# prometheus:
# ports:
# - 9090:9090/tcp
4 changes: 2 additions & 2 deletions lighthouse-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions lighthouse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions lodestar-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions lodestar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
<<: *logging
entrypoint:
- docker-entrypoint.sh
Expand Down
4 changes: 2 additions & 2 deletions nethermind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nethermind/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions nimbus-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=true
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions nimbus-el.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/nimbus/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions nimbus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ services:
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions prysm-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-}${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-}${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
networks:
default:
aliases:
Expand Down
2 changes: 1 addition & 1 deletion prysm-web-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ version: "3.9"
services:
validator:
ports:
- ${HOST_IP:-0.0.0.0}:${KEY_API_PORT:-7500}:${KEY_API_PORT:-7500}/tcp
- ${HOST_IP:-}${KEY_API_PORT:-7500}:${KEY_API_PORT:-7500}/tcp
4 changes: 2 additions & 2 deletions prysm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ services:
- CL_EXTRAS=${CL_EXTRAS:-}
- ARCHIVE_NODE=${ARCHIVE_NODE:-}
ports:
- ${HOST_IP:-0.0.0.0}:${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
- ${HOST_IP:-}${PRYSM_PORT}:${PRYSM_PORT}/tcp
- ${HOST_IP:-}${PRYSM_UDP_PORT}:${PRYSM_UDP_PORT}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions reth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ services:
- /etc/localtime:/etc/localtime:ro
- jwtsecret:/var/lib/reth/ee-secret
ports:
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-0.0.0.0}:${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/tcp
- ${HOST_IP:-}${EL_P2P_PORT:-30303}:${EL_P2P_PORT:-30303}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions teku-cl-only.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ services:
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=true
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions teku.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ services:
- GRAFFITI=${GRAFFITI:-}
- DEFAULT_GRAFFITI=${DEFAULT_GRAFFITI:-false}
ports:
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-0.0.0.0}:${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/tcp
- ${HOST_IP:-}${CL_P2P_PORT:-9000}:${CL_P2P_PORT:-9000}/udp
networks:
default:
aliases:
Expand Down
4 changes: 2 additions & 2 deletions traefik-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ services:
- --metrics
- --metrics.prometheus
ports:
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- AWS_PROFILE=${AWS_PROFILE}
- AWS_HOSTED_ZONE_ID=${AWS_HOSTED_ZONE_ID}
Expand Down
4 changes: 2 additions & 2 deletions traefik-cf-v6.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ services:
- --metrics
- --metrics.prometheus
ports:
- ${HOST_IP:-}:${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-}:${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- CLOUDFLARE_EMAIL=${CF_EMAIL}
- CLOUDFLARE_DNS_API_TOKEN=${CF_API_TOKEN}
Expand Down
4 changes: 2 additions & 2 deletions traefik-cf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ services:
- --metrics.prometheus

ports:
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-0.0.0.0}:${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_PORT}:${TRAEFIK_WEB_PORT}/tcp
- ${HOST_IP:-}${TRAEFIK_WEB_HTTP_PORT}:${TRAEFIK_WEB_HTTP_PORT}/tcp
environment:
- CLOUDFLARE_EMAIL=${CF_EMAIL}
- CLOUDFLARE_DNS_API_TOKEN=${CF_API_TOKEN}
Expand Down
7 changes: 7 additions & 0 deletions v6-network.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Add this to COMPOSE_FILE in .env so docker compose assigns v6 addresses
# Docker will also need to be configured, please see http://eth-docker.net/Support/ipv6.md
version: "3.9"

networks:
default:
enable_ipv6: true

0 comments on commit 3e5811e

Please sign in to comment.