**Motivations:** - Resolve insufficient UTXO amount errors when wallet has many small UTXOs - Prevent race conditions when multiple anchor requests arrive simultaneously - Improve signet dashboard functionality and documentation **Root causes:** - API tried to find a single UTXO large enough instead of combining multiple UTXOs - No mutex mechanism to prevent concurrent transactions from using the same UTXOs - UTXOs in mempool still appear as available in listunspent before block confirmation **Correctifs:** - Implement coin selection algorithm to combine multiple UTXOs when needed - Add mutex-based locking mechanism to serialize UTXO access - Filter locked UTXOs during selection to prevent double spending - Properly handle change output when combining multiple UTXOs - Lock UTXOs during transaction creation and unlock after mempool broadcast **Evolutions:** - Enhance signet dashboard with improved Bitcoin RPC integration - Update mempool documentation - Add comprehensive fix documentation in fixKnowledge/ **Pages affectées:** - api-anchorage/src/bitcoin-rpc.js - signet-dashboard/src/bitcoin-rpc.js - signet-dashboard/src/server.js - signet-dashboard/public/app.js - signet-dashboard/public/index.html - signet-dashboard/public/styles.css - signet-dashboard/start.sh - docs/MEMPOOL.md - fixKnowledge/api-anchorage-insufficient-utxo.md (new) - fixKnowledge/api-anchorage-utxo-race-condition.md (new) - anchor_count.txt (new) - mempool (submodule update)
25 lines
952 B
Bash
Executable File
25 lines
952 B
Bash
Executable File
#!/bin/bash
|
|
cd "$(dirname "$0")"
|
|
export BITCOIN_RPC_HOST=${BITCOIN_RPC_HOST:-localhost}
|
|
export BITCOIN_RPC_PORT=${BITCOIN_RPC_PORT:-38332}
|
|
export BITCOIN_RPC_USER=${BITCOIN_RPC_USER:-bitcoin}
|
|
export BITCOIN_RPC_PASSWORD=${BITCOIN_RPC_PASSWORD:-bitcoin}
|
|
export DASHBOARD_PORT=${DASHBOARD_PORT:-3020}
|
|
export DASHBOARD_HOST=${DASHBOARD_HOST:-0.0.0.0}
|
|
# Utiliser localhost:3010 si l'URL n'est pas explicitement définie ou si c'est une URL HTTPS non accessible
|
|
if [ -z "$ANCHOR_API_URL" ] || [[ "$ANCHOR_API_URL" == https://* ]]; then
|
|
export ANCHOR_API_URL="http://localhost:3010"
|
|
fi
|
|
export ANCHOR_API_KEY=${ANCHOR_API_KEY:-}
|
|
export FAUCET_API_URL=${FAUCET_API_URL:-http://localhost:3021}
|
|
export LOG_LEVEL=${LOG_LEVEL:-info}
|
|
export NODE_ENV=${NODE_ENV:-production}
|
|
|
|
if [ ! -f node_modules/.bin/node ]; then
|
|
echo "Installation des dépendances..."
|
|
npm install
|
|
fi
|
|
|
|
echo "Démarrage du Dashboard sur le port $DASHBOARD_PORT..."
|
|
node src/server.js
|