Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for better ext-network.yml #3

Merged
merged 2 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.env*
*.swp
*.bak
*.original
custom.yml
ext-network.yml
5 changes: 4 additions & 1 deletion default.env
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ WS_LB=opws-lb
OPNODE_HOST=opnode
OPNODE_LB=opnode-lb

# External Docker network if using ext-network.yml
DOCKER_EXT_NETWORK=traefik_default

RPC_PORT=8545
WS_PORT=8546
OPGETH_P2P_PORT=30303
Expand All @@ -77,4 +80,4 @@ OPNODE_P2P_PORT=9222
SCRIPT_TAG=

# Used by optd update - please do not adjust
ENV_VERSION=4
ENV_VERSION=5
14 changes: 12 additions & 2 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __env_migrate() {
L2GETH_DOCKER_TAG DOMAIN RPC_HOST RPC_LB OPNODE_HOST OPNODE_LB WS_HOST WS_LB RPC_PORT WS_PORT \
OPGETH_P2P_PORT OPNODE_RPC_PORT OPNODE_P2P_PORT L2_CONNECTION_KIND OPNODE_SYNC_MODE GENESIS_URL ROLLUP_URL \
OPGETH_P2P_BOOTNODES OPNODE_P2P_BOOTNODES OPNODE_P2P_STATIC_PEERS DISABLE_TXPOOL_GOSSIP SNAPSHOT_PART \
ROLLUP_HALT )
ROLLUP_HALT DOCKER_EXT_NETWORK )
__old_vars=( )
__new_vars=( )

Expand Down Expand Up @@ -558,7 +558,7 @@ __display_docker_volumes() {
echo
else
echo "Here are the Docker volumes used by this copy of ${__project_name} and their space usage:"
__dodocker system df -v | grep -A 50 "VOLUME NAME" | grep "^$(basename "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
__dodocker system df -v | grep -A 500 "VOLUME NAME" | grep "^$(basename "$(dirname "$(realpath "${BASH_SOURCE[0]}")")")"
echo
fi
echo "If there is some mystery space being taken up, try \"sudo ncdu /\"."
Expand Down Expand Up @@ -664,6 +664,15 @@ update() {
if [[ "${__branch}" =~ ^tag-* ]]; then
git checkout main
fi
# Handle legacy ext-network. A future update after a hardfork will bring in the changed ext-network
DOCKER_EXT_NETWORK=$(${__as_owner} sed -n 's/^\s*name:\s*\(.*\)/\1/p' ext-network.yml)
# I mean this literally
# shellcheck disable=SC2016
if [ ! "${DOCKER_EXT_NETWORK:-"traefik_default"}" = '${DOCKER_EXT_NETWORK}' ]; then
__var=DOCKER_EXT_NETWORK
__update_value_in_env "${__var}" "${!__var}" "${__env_file}"
fi
# End legacy handling
${__as_owner} git pull
else
export ETHDPINNED="${__value}"
Expand Down Expand Up @@ -733,6 +742,7 @@ find the original contents in ${__env_file}.bak."


__prep_conffiles() {
# Remove this after the next hardfork, when there's a new ext-network
# Create ext-network.yml if it doesn't exist
if [ ! -f "ext-network.yml" ]; then
${__as_owner} cp ext-network.yml.sample ext-network.yml
Expand Down