From c598bae92535959f882d6c8e76c1a38ad6f11e04 Mon Sep 17 00:00:00 2001 From: just-mitch <68168980+just-mitch@users.noreply.github.com> Date: Wed, 18 Dec 2024 18:10:33 -0500 Subject: [PATCH] chore: use `troll-turtle` image in aztec-spartan (#10856) also disregard ethereum_host from the host. --- spartan/releases/rough-rhino/Earthfile | 32 +++++++++++++++++-- spartan/releases/rough-rhino/aztec-spartan.sh | 7 +++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/spartan/releases/rough-rhino/Earthfile b/spartan/releases/rough-rhino/Earthfile index ad88113d4f7..3e0da23adfc 100644 --- a/spartan/releases/rough-rhino/Earthfile +++ b/spartan/releases/rough-rhino/Earthfile @@ -123,13 +123,41 @@ test-p2p-key: echo "✅ P2P private key test passed" || \ (echo "❌ P2P private key test failed" && exit 1) +test-ethereum-host: + FROM +test-setup + RUN echo -e "\n\n" | ./aztec-spartan.sh config \ + -n "troll-turtle" \ + -e http://foobar:8545 \ + -p 8080 \ + -p2p 40400 \ + -ip 1.2.3.4 \ + -k 0x00 \ + -pk 00000 + RUN test -f .env && \ + grep -q "ETHEREUM_HOST=http://foobar:8545" .env && \ + echo "✅ Ethereum host cli test passed" || \ + (echo "❌ Ethereum host cli test failed" && exit 1) + + # We don't respect the env var here + RUN echo -e "\n\n" | ETHEREUM_HOST=http://foobar:8545 ./aztec-spartan.sh config \ + -n "troll-turtle" \ + -p 8080 \ + -p2p 40400 \ + -ip 1.2.3.4 \ + -k 0x00 \ + -pk 00000 + RUN test -f .env && \ + grep -q "ETHEREUM_HOST=http://34.19.127.9:8545" .env && \ + echo "✅ Ethereum host override test passed" || \ + (echo "❌ Ethereum host override test failed" && exit 1) + + test-all: BUILD +test-help - BUILD +test-no-config BUILD +test-install BUILD +test-docker-check BUILD +test-start-stop BUILD +test-update BUILD +test-data-dir BUILD +test-p2p-key - + BUILD +test-ethereum-host diff --git a/spartan/releases/rough-rhino/aztec-spartan.sh b/spartan/releases/rough-rhino/aztec-spartan.sh index c7cbe772395..283aeaed7cd 100755 --- a/spartan/releases/rough-rhino/aztec-spartan.sh +++ b/spartan/releases/rough-rhino/aztec-spartan.sh @@ -17,6 +17,11 @@ DEFAULT_KEY="0x0000000000000000000000000000000000000000000000000000000000000001" DEFAULT_IP=$(curl -s --connect-timeout 5 https://api.ipify.org?format=json | grep -o '"ip":"[^"]*' | cut -d'"' -f4 || echo "") DEFAULT_BIND_MOUNT_DIR="$HOME/aztec-data" +# unset these to avoid conflicts with the host's environment +ETHEREUM_HOST= +IMAGE= +BOOTNODE_URL= + # Parse command line arguments parse_args() { @@ -168,7 +173,7 @@ configure_environment() { if [ "$NETWORK" = "troll-turtle" ]; then BOOTNODE_URL="${BOOTNODE_URL:-http://34.82.213.6:8080}" ETHEREUM_HOST="${ETHEREUM_HOST:-http://34.19.127.9:8545}" - IMAGE="${IMAGE:-aztecprotocol/aztec:0.67.1}" + IMAGE="${IMAGE:-aztecprotocol/aztec:troll-turtle}" else # unknown network echo -e "${RED}Unknown network: $NETWORK${NC}"