From 9ec53892bccdf5c0595b98a9e63d60cc2569469c Mon Sep 17 00:00:00 2001 From: aitbc Date: Tue, 26 May 2026 16:20:16 +0200 Subject: [PATCH] Fix load-keystore-secrets.sh to prevent duplicate entries - Clear env file at start to avoid appending duplicates when script runs multiple times - Fixes issue where proposer_id was repeated many times in /run/aitbc/secrets/.env - This was causing unwanted block production on follower nodes --- scripts/utils/load-keystore-secrets.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/utils/load-keystore-secrets.sh b/scripts/utils/load-keystore-secrets.sh index f7b78308..d95fadb2 100755 --- a/scripts/utils/load-keystore-secrets.sh +++ b/scripts/utils/load-keystore-secrets.sh @@ -14,6 +14,9 @@ chmod 700 "$RUN_DIR" # Create .env file from credentials ENV_FILE="$RUN_DIR/.env" +# Clear existing file to avoid duplicate entries +> "$ENV_FILE" + if [ -f "$CREDENTIALS_DIR/api_hash_secret" ]; then echo "API_KEY_HASH_SECRET=$(cat $CREDENTIALS_DIR/api_hash_secret)" >> "$ENV_FILE" fi