anchorage_layer_simple/restart-bitcoind.sh
ncantu 3c212e56e9 api-anchorage: combine multiple UTXOs, api-relay: storage interface refactor
**Motivations:**
- Résoudre erreur "No UTXO large enough" en combinant plusieurs petits UTXOs
- Refactorer api-relay avec interface StorageServiceInterface pour meilleure abstraction
- Ajouter script restart-bitcoind.sh

**Root causes:**
- api-anchorage: logique cherchait uniquement un UTXO assez grand, ne combinait pas plusieurs petits UTXOs
- api-relay: code dupliqué entre StorageService et DatabaseStorageService

**Correctifs:**
- api-anchorage: combinaison automatique de plusieurs petits UTXOs si aucun assez grand, ajustement frais pour inputs multiples, limite 20 UTXOs, gestion cohérente verrouillage/déverrouillage

**Evolutions:**
- api-relay: StorageServiceInterface (abstraction commune), refactoring routes (keys, messages, signatures, metrics, bloom) pour utiliser interface, eslint config, package updates
- fixKnowledge: api-anchorage-combine-utxos.md (documentation correction)
- restart-bitcoind.sh: script redémarrage bitcoind

**Pages affectées:**
- api-anchorage: bitcoin-rpc.js
- api-relay: eslint.config.mjs, package.json, index.ts, middleware/auth.ts, routes (bloom, keys, messages, metrics, signatures), services (apiKeyService, database, relay, storageAdapter, storageInterface)
- fixKnowledge: api-anchorage-combine-utxos.md
- restart-bitcoind.sh
2026-01-28 07:50:56 +01:00

32 lines
936 B
Bash
Executable File

#!/bin/bash
# Restart bitcoind service on production server via SSH.
# Usage: ./restart-bitcoind.sh
# Requires: SSH access to prod server (ncantu@192.168.1.103).
set -e
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROD_HOST="192.168.1.103"
PROD_USER="ncantu"
SIGNET_DIR="/srv/4NK/signet.4nkweb.com"
echo "=== Redémarrage de bitcoind sur le serveur prod (${PROD_USER}@${PROD_HOST}) ==="
# Vérifier l'état du service avant redémarrage
echo "État du service avant redémarrage:"
ssh "${PROD_USER}@${PROD_HOST}" "cd ${SIGNET_DIR} && ./manage.sh status"
echo ""
echo "Redémarrage du service via manage.sh..."
ssh "${PROD_USER}@${PROD_HOST}" "cd ${SIGNET_DIR} && ./manage.sh restart"
# Attendre quelques secondes pour que le service démarre
sleep 3
echo ""
echo "État du service après redémarrage:"
ssh "${PROD_USER}@${PROD_HOST}" "cd ${SIGNET_DIR} && ./manage.sh status"
echo ""
echo "✅ Redémarrage de bitcoind terminé"