
Some checks failed
CI - 4NK_node / Code Quality (push) Failing after 38s
CI - 4NK_node / Unit Tests (push) Failing after 36s
CI - 4NK_node / Integration Tests (push) Successful in 33s
CI - 4NK_node / Security Tests (push) Failing after 33s
CI - 4NK_node / Docker Build & Test (push) Failing after 15s
CI - 4NK_node / Documentation Tests (push) Successful in 12s
CI - 4NK_node / Release Guard (push) Has been skipped
CI - 4NK_node / Performance Tests (push) Successful in 35s
CI - 4NK_node / Notify (push) Failing after 2s
30 lines
977 B
Bash
Executable File
30 lines
977 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
LOG_DIR="tests/logs"
|
|
mkdir -p "$LOG_DIR"
|
|
TS=$(date +%Y%m%d_%H%M%S)
|
|
LOG_FILE="$LOG_DIR/retry_signet_sync_$TS.log"
|
|
|
|
echo "[retry] Démarrage $(date -Is)" | tee -a "$LOG_FILE"
|
|
ONION=$(awk -F= '/^addnode=/{print $2}' bitcoin/bitcoin.conf | head -n1 || true)
|
|
echo "[retry] onion=$ONION" | tee -a "$LOG_FILE"
|
|
|
|
for i in $(seq 1 30); do
|
|
CNT=$(sudo docker exec bitcoin-signet bitcoin-cli -signet getconnectioncount 2>/dev/null || echo 0)
|
|
echo "[$(date -Is)] iter=$i connections=$CNT" | tee -a "$LOG_FILE"
|
|
if [ "$CNT" -gt 0 ]; then
|
|
echo "[retry] Connexions établies, arrêt de la boucle." | tee -a "$LOG_FILE"
|
|
exit 0
|
|
fi
|
|
if [ -n "$ONION" ]; then
|
|
sudo docker exec bitcoin-signet bitcoin-cli -signet addnode ${ONION}:38333 onetry >/dev/null 2>&1 || true
|
|
echo "[$(date -Is)] onetry envoyé" | tee -a "$LOG_FILE"
|
|
fi
|
|
sleep 10
|
|
done
|
|
|
|
echo "[retry] Connexions non établies après 30 tentatives." | tee -a "$LOG_FILE"
|
|
exit 1
|
|
|