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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user