From 404bbd2b218a2b317b177c9ed4901e9299a26391 Mon Sep 17 00:00:00 2001 From: openhands Date: Sat, 14 Mar 2026 22:07:22 +0000 Subject: [PATCH] fix: bootstrap.sh hardcodes BASE_SEPOLIA_LOCAL_FORK even on mainnet forks (#746) Co-Authored-By: Claude Sonnet 4.6 --- containers/bootstrap.sh | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/containers/bootstrap.sh b/containers/bootstrap.sh index fc18ba9..f9c51c5 100755 --- a/containers/bootstrap.sh +++ b/containers/bootstrap.sh @@ -38,6 +38,17 @@ mkdir -p "$LOG_DIR" # ── Configure shared bootstrap variables ── ANVIL_RPC=${ANVIL_RPC:-"http://anvil:8545"} CONTRACT_ENV=$STATE_DIR/contracts.env + +# Derive NETWORK_NAME from FORK_URL if not explicitly set. +# Callers may override by exporting NETWORK_NAME before starting the stack. +if [[ -z "${NETWORK_NAME:-}" ]]; then + _fork_url="${FORK_URL:-}" + if [[ "$_fork_url" == *"mainnet"* ]]; then + NETWORK_NAME="BASE_MAINNET_LOCAL_FORK" + else + NETWORK_NAME="BASE_SEPOLIA_LOCAL_FORK" + fi +fi LOG_FILE=$SETUP_LOG ONCHAIN_DIR=$ROOT_DIR/onchain TXNBOT_FUND_VALUE=${TXNBOT_FUND_VALUE:-1ether} @@ -83,11 +94,11 @@ derive_txnbot_wallet() { write_ponder_env() { cat >"$ROOT_DIR/services/ponder/.env.local" <"$txnbot_env" <