**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)
95 lines
3.3 KiB
Markdown
95 lines
3.3 KiB
Markdown
# Dépannage du Mining - Bitcoin Signet
|
|
|
|
**Auteur** : Équipe 4NK
|
|
**Date** : 2026-01-23
|
|
**Version** : 1.0
|
|
|
|
## Problème : Aucun bloc n'est miné - "PSBT signing failed"
|
|
|
|
### Symptômes
|
|
|
|
- Les logs affichent : `PSBT signing failed`
|
|
- Aucun bloc n'est miné malgré `MINERENABLED=1`
|
|
- Le processus `mine.sh` est actif mais échoue à chaque tentative
|
|
|
|
### Cause
|
|
|
|
Le miner Bitcoin Signet utilise `walletprocesspsbt` pour signer des transactions spéciales vers le SIGNETCHALLENGE. Ces transactions utilisent un script P2PK (Pay-to-Public-Key), pas P2WPKH (Pay-to-Witness-Public-Key-Hash).
|
|
|
|
**Problème** : Si la clé privée est importée uniquement comme `wpkh()` (P2WPKH), le wallet ne peut pas signer les transactions P2PK nécessaires pour le signet.
|
|
|
|
### Solution
|
|
|
|
La clé privée doit être importée comme `pk()` (P2PK) dans le wallet descriptor pour permettre la signature des transactions signet.
|
|
|
|
**Fichier modifié** : `run.sh`
|
|
|
|
**Avant** (incorrect) :
|
|
```bash
|
|
DESCRIPTOR_INFO=$(bitcoin-cli -datadir=$DATADIR getdescriptorinfo "wpkh($PRIVKEY)")
|
|
IMPORT_RESULT=$(bitcoin-cli -datadir=$DATADIR importdescriptors "[{\"desc\":\"wpkh($PRIVKEY)#$CHECKSUM\",...}]")
|
|
```
|
|
|
|
**Après** (correct) :
|
|
```bash
|
|
DESCRIPTOR_INFO=$(bitcoin-cli -datadir=$DATADIR getdescriptorinfo "pk($PRIVKEY)")
|
|
IMPORT_RESULT=$(bitcoin-cli -datadir=$DATADIR importdescriptors "[{\"desc\":\"pk($PRIVKEY)#$CHECKSUM\",...}]")
|
|
```
|
|
|
|
### Vérification
|
|
|
|
1. **Vérifier que le descriptor pk() est importé** :
|
|
```bash
|
|
sudo docker exec bitcoin-signet-instance bitcoin-cli -datadir=/root/.bitcoin listdescriptors | grep "pk("
|
|
```
|
|
|
|
2. **Vérifier que la clé correspond au SIGNETCHALLENGE** :
|
|
```bash
|
|
PRIVKEY=$(grep PRIVKEY .env | cut -d'=' -f2)
|
|
sudo docker exec bitcoin-signet-instance bitcoin-cli -datadir=/root/.bitcoin getdescriptorinfo "pk($PRIVKEY)" | jq -r '.descriptor'
|
|
# Doit contenir la clé publique du SIGNETCHALLENGE
|
|
```
|
|
|
|
3. **Vérifier les logs** :
|
|
```bash
|
|
sudo docker logs bitcoin-signet-instance | grep -E "(PSBT|signing|Mine)"
|
|
```
|
|
|
|
### Correction Manuelle (si nécessaire)
|
|
|
|
Si le problème persiste après la modification de `run.sh`, importer manuellement :
|
|
|
|
```bash
|
|
PRIVKEY=$(grep PRIVKEY .env | cut -d'=' -f2)
|
|
DESCRIPTOR_INFO=$(sudo docker exec bitcoin-signet-instance bitcoin-cli -datadir=/root/.bitcoin getdescriptorinfo "pk($PRIVKEY)")
|
|
CHECKSUM=$(echo "$DESCRIPTOR_INFO" | jq -r '.checksum')
|
|
sudo docker exec bitcoin-signet-instance bitcoin-cli -datadir=/root/.bitcoin \
|
|
importdescriptors "[{\"desc\":\"pk($PRIVKEY)#$CHECKSUM\",\"timestamp\":0,\"internal\":false}]"
|
|
```
|
|
|
|
### Redémarrage
|
|
|
|
Après modification de `run.sh`, reconstruire l'image et redémarrer :
|
|
|
|
```bash
|
|
sudo docker stop bitcoin-signet-instance
|
|
sudo docker rm bitcoin-signet-instance
|
|
sudo docker build -t bitcoin-signet .
|
|
sudo docker run --env-file .env -d \
|
|
--name bitcoin-signet-instance \
|
|
-p 38332:38332 -p 38333:38333 \
|
|
-p 28332:28332 -p 28333:28333 -p 28334:28334 \
|
|
bitcoin-signet
|
|
```
|
|
|
|
### Notes Techniques
|
|
|
|
- **SIGNETCHALLENGE** : Contient un script P2PK avec la clé publique du signet
|
|
- **Miner** : Crée une transaction `to_spend` vers ce script P2PK qui doit être signée
|
|
- **walletprocesspsbt** : Nécessite que le wallet ait la clé privée correspondante au script P2PK
|
|
- **Descriptor pk()** : Permet au wallet de signer pour les scripts P2PK
|
|
|
|
---
|
|
|
|
**Dernière mise à jour** : 2026-01-23
|