Skip to content

Commit bd6c015

Browse files
authored
fix: bootnode startup script (#19007)
This PR updates the bootnodes startup script
2 parents 67ad386 + 111ccd0 commit bd6c015

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

iac/network/scripts/bootnode_startup.sh

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,23 +115,21 @@ if [[ -n "$OTEL_COLLECTOR_URL" ]]; then
115115
export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT="$OTEL_COLLECTOR_URL/v1/metrics"
116116
fi
117117

118-
cat <<EOF > /home/$SSH_USER/start.sh
118+
cat <<'EOF' > /home/$SSH_USER/start.sh
119119
#!/usr/bin/env bash
120120
source ./tag.sh
121121
echo "Starting bootnode container..."
122122
123123
# Try primary URL first, fallback to metadata.aztec.network if unreachable
124-
JSON=$(curl -s --fail http://static.aztec.network/$NETWORK_NAME/bootnodes.json 2>/dev/null)
125-
if [ -z "$JSON" ]; then
124+
if ! curl -s --fail -O https://raw.githubusercontent.com/AztecProtocol/networks/refs/heads/main/network_config.json 2>/dev/null; then
126125
echo "Primary URL unreachable, trying fallback..."
127-
JSON=$(curl -s --fail https://metadata.aztec.network/network_config.json 2>/dev/null)
128-
if [ -z "$JSON" ]; then
126+
if ! curl -s --fail -O https://metadata.aztec.network/network_config.json 2>/dev/null; then
129127
echo "Error: Could not fetch bootnode data from any source"
130128
exit 1
131129
fi
132130
fi
133131
134-
export BOOTSTRAP_NODES=$(echo "$JSON" | jq -r '.bootnodes | join(",")')
132+
export BOOTSTRAP_NODES=$(cat network_config.json | jq -r ".$NETWORK_NAME.bootnodes | join(",")")
135133
echo "Bootnode enrs: $BOOTSTRAP_NODES"
136134
137135
docker system prune -f

0 commit comments

Comments
 (0)