ncantu 20d115a31c feat: Add APIs, dashboard, documentation and improve scripts
**Motivations:**
- Add API services for anchorage and faucet functionality
- Add dashboard interface for signet monitoring
- Improve documentation and maintenance guides
- Enhance existing scripts for better functionality

**Root causes:**
- Need for API services to interact with Bitcoin Signet
- Need for user-friendly dashboard interface
- Need for comprehensive documentation
- Scripts required improvements for better reliability

**Correctifs:**
- Updated Dockerfile with better configuration
- Improved gen-bitcoind-conf.sh and gen-signet-keys.sh scripts
- Enhanced mine.sh, miner, run.sh, and setup-signet.sh scripts
- Updated env.example with new configuration options

**Evolutions:**
- Added api-anchorage service with anchor functionality
- Added api-faucet service for testnet coin distribution
- Added signet-dashboard for monitoring and management
- Added comprehensive documentation in docs/ directory
- Added configure-nginx-proxy.sh for proxy configuration
- Added update-signet.sh for signet updates
- Added ETAT_SYSTEME.md and START_DASHBOARD_AND_FAUCET.md guides
- Added .bitcoin-version file for version tracking

**Pages affectées:**
- Dockerfile
- env.example
- gen-bitcoind-conf.sh
- gen-signet-keys.sh
- mine.sh
- miner
- run.sh
- setup-signet.sh
- api-anchorage/ (new)
- api-faucet/ (new)
- signet-dashboard/ (new)
- docs/ (new)
- configure-nginx-proxy.sh (new)
- update-signet.sh (new)
- ETAT_SYSTEME.md (new)
- START_DASHBOARD_AND_FAUCET.md (new)
- .bitcoin-version (new)
- .env (modified)
- mempool/ (added)
2026-01-24 02:40:25 +01:00

23 lines
1.1 KiB
Bash

#!/bin/bash
NBITS=${NBITS:-"1e0377ae"} #minimum difficulty in signet
while true; do
ADDR=${MINETO:-$(bitcoin-cli getnewaddress)}
if [[ -f "${BITCOIN_DIR}/BLOCKPRODUCTIONDELAY.txt" ]]; then
BLOCKPRODUCTIONDELAY_OVERRIDE=$(cat ~/.bitcoin/BLOCKPRODUCTIONDELAY.txt)
echo "Delay OVERRIDE before next block" $BLOCKPRODUCTIONDELAY_OVERRIDE "seconds."
sleep $BLOCKPRODUCTIONDELAY_OVERRIDE
else
BLOCKPRODUCTIONDELAY=${BLOCKPRODUCTIONDELAY:="0"}
if [[ BLOCKPRODUCTIONDELAY -gt 0 ]]; then
echo "Delay before next block" $BLOCKPRODUCTIONDELAY "seconds."
sleep $BLOCKPRODUCTIONDELAY
fi
fi
echo "Mine To:" $ADDR
# PRIVKEY should be available from .env via run.sh environment
# The miner will automatically use PRIVKEY from environment for descriptorprocesspsbt
# Export PRIVKEY to ensure it's available to the miner process
export PRIVKEY=${PRIVKEY:-$(cat ~/.bitcoin/PRIVKEY.txt 2>/dev/null || echo "")}
miner --cli="bitcoin-cli" generate --grind-cmd="bitcoin-util grind" --address=$ADDR --nbits=$NBITS --set-block-time=$(date +%s)
done