Skip to content
Open
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
23 changes: 18 additions & 5 deletions scripts/devnet/restart_devnet.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/bash
#!/usr/bin/env bash
set -euo pipefail

ENCLAVE="devnet"
Expand All @@ -21,10 +21,23 @@ NETWORK_SUBNET=$(docker network inspect "kt-${ENCLAVE}" --format '{{range .IPAM.
sudo ufw allow from "$NETWORK_SUBNET" to any port 4040
sudo ufw allow from "$NETWORK_SUBNET" to any port 9060

# Get proxy container IP
PROXY_IP=$(docker inspect \
"$(docker ps --filter "name=helix-relay" --format '{{.ID}}' | head -1)" \
--format '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}')
# Get helix-relay proxy container ID
PROXY_CONTAINER=$(docker ps --filter "name=helix-relay" --format '{{.ID}}' | head -n 1)

if [ -z "$PROXY_CONTAINER" ]; then
echo "ERROR: helix-relay proxy container not found or not running" >&2
exit 1
fi

# Get IP in the kurtosis enclave network.
# Avoids IP concatenation when container is attached to multiple networks.
PROXY_IP=$(docker inspect "$PROXY_CONTAINER" \
--format "{{(index .NetworkSettings.Networks \"kt-${ENCLAVE}\").IPAddress}}" 2>/dev/null || true)

if [ -z "$PROXY_IP" ]; then
echo "ERROR: could not resolve IP for container $PROXY_CONTAINER" >&2
exit 1
fi

# Extract env vars from the service
RELAY_KEY=$(kurtosis service inspect "$ENCLAVE" helix-relay 2>&1 | awk '/RELAY_KEY:/{print $2}')
Expand Down
Loading