fix-bitcoin

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

/fix-bitcoin

/fix-bitcoin

Fix the highest priority Bitcoin issue.
修复优先级最高的Bitcoin问题。

What This Does

功能说明

  1. Invoke
    /check-bitcoin
    to audit Bitcoin setup
  2. Identify highest priority issue
  3. Fix that one issue
  4. Verify the fix
  5. Report what was done
This is a fixer. It fixes one issue at a time. Run again for next issue. Use
/bitcoin
for full lifecycle.
  1. 调用
    /check-bitcoin
    来审计Bitcoin配置
  2. 识别优先级最高的问题
  3. 修复该问题
  4. 验证修复效果
  5. 报告处理内容
这是一个修复工具,每次仅修复一个问题。如需处理下一个问题,请再次运行。使用
/bitcoin
进行全生命周期管理。

Process

操作流程

1. Run Primitive

1. 运行基础工具

Invoke
/check-bitcoin
skill to get prioritized findings.
调用
/check-bitcoin
技能获取按优先级排序的问题列表。

2. Fix Priority Order

2. 修复优先级顺序

Fix in this order:
  1. P0: Node not synced, wallet not encrypted
  2. P1: Missing testnet/mainnet separation
  3. P2: UTXO consolidation needed
  4. P3: Advanced features
按照以下顺序修复:
  1. P0:节点未同步、钱包未加密
  2. P1:缺少测试网/主网分离配置
  3. P2:需要合并UTXO
  4. P3:高级功能配置

3. Execute Fix

3. 执行修复

Node not synced (P0): Check sync status:
bash
bitcoin-cli getblockchaininfo
If
headers
>
blocks
, wait or restart:
bash
bitcoin-cli stop
bitcoind -daemon
Wallet not encrypted (P0): Encrypt wallet:
bash
bitcoin-cli encryptwallet "strong-passphrase"
Back up:
bash
bitcoin-cli backupwallet /path/to/backup.dat
Missing testnet/mainnet separation (P1): Split configs:
ini
undefined
节点未同步(P0): 检查同步状态:
bash
bitcoin-cli getblockchaininfo
如果
headers
数量大于
blocks
,等待或重启节点:
bash
bitcoin-cli stop
bitcoind -daemon
钱包未加密(P0): 加密钱包:
bash
bitcoin-cli encryptwallet "strong-passphrase"
备份钱包:
bash
bitcoin-cli backupwallet /path/to/backup.dat
缺少测试网/主网分离配置(P1): 拆分配置文件:
ini
undefined

bitcoin.conf

bitcoin.conf

mainnet=1
[test] testnet=1 walletdir=/var/lib/bitcoin/testnet-wallets
Use explicit network flags in tooling:
```bash
bitcoin-cli -testnet getblockchaininfo
UTXO consolidation needed (P2): List small UTXOs:
bash
bitcoin-cli listunspent 1 9999999
Create consolidation tx:
bash
bitcoin-cli createrawtransaction '[{"txid":"...","vout":0}]' '{"bc1q...":0.999}'
Sign and send:
bash
bitcoin-cli signrawtransactionwithwallet <hex>
bitcoin-cli sendrawtransaction <hex>
mainnet=1
[test] testnet=1 walletdir=/var/lib/bitcoin/testnet-wallets
在工具中使用明确的网络标识:
```bash
bitcoin-cli -testnet getblockchaininfo
需要合并UTXO(P2): 列出小额UTXO:
bash
bitcoin-cli listunspent 1 9999999
创建合并交易:
bash
bitcoin-cli createrawtransaction '[{"txid":"...","vout":0}]' '{"bc1q...":0.999}'
签名并发送交易:
bash
bitcoin-cli signrawtransactionwithwallet <hex>
bitcoin-cli sendrawtransaction <hex>

4. Verify

4. 验证修复

After fix:
bash
bitcoin-cli getblockchaininfo
bitcoin-cli getwalletinfo
修复完成后执行:
bash
bitcoin-cli getblockchaininfo
bitcoin-cli getwalletinfo

5. Report

5. 生成报告

Fixed: [P0] Wallet not encrypted

Updated: bitcoin.conf
- Added wallet encryption requirement
- Added backup path

Verified: bitcoin-cli getwalletinfo → encrypted

Next highest priority: [P0] Node not synced
Run /fix-bitcoin again to continue.
已修复:[P0] 钱包未加密

更新内容:bitcoin.conf
- 添加了钱包加密要求
- 配置了备份路径

验证结果:bitcoin-cli getwalletinfo → 已加密

下一个最高优先级问题:[P0] 节点未同步
请再次运行 /fix-bitcoin 继续处理。

Branching

分支管理

Before making changes:
bash
git checkout -b fix/bitcoin-$(date +%Y%m%d)
在进行修改前:
bash
git checkout -b fix/bitcoin-$(date +%Y%m%d)

Single-Issue Focus

单问题聚焦

Bitcoin ops are high risk. Fix one thing at a time:
  • Test each change thoroughly
  • Easy to roll back specific fixes
  • Clear audit trail for keys and funds
Run
/fix-bitcoin
repeatedly to work through the backlog.
Bitcoin运维风险较高,每次仅修复一个问题:
  • 彻底测试每一项变更
  • 便于回滚特定修复
  • 为密钥和资金保留清晰的审计轨迹
重复运行
/fix-bitcoin
来逐步处理所有问题。

Related

相关工具

  • /check-bitcoin
    - The primitive (audit only)
  • /log-bitcoin-issues
    - Create issues without fixing
  • /bitcoin
    - Full Bitcoin lifecycle
  • /bitcoin-health
    - Node diagnostics
  • /check-bitcoin
    - 基础审计工具(仅审计)
  • /log-bitcoin-issues
    - 仅记录问题不修复
  • /bitcoin
    - Bitcoin全生命周期管理
  • /bitcoin-health
    - 节点诊断