比特币核心未连接!尝试运行脱机节点

时间:2020-05-07 08:47:16

标签: testing offline bitcoin

尝试在主网配置(需要真实地址结构)上运行本地比特币测试节点,发送交易,并在我的本地内存池中列出,但不输入下一个区块。

重要提示:我必须从Internet上的其他节点禁用该节点的更新,所以我只能创建自己的块!

我是怎么做到的:

  • 我开采了101个区块并获得了bitcoin-cli二进制文件
  • 拒绝所有传出流量。
  • 运行比特币节点:

./bitcoind -conf=/home/ubuntu/.bitcoin/bitcoin.conf

  • 创建交易并获得交易哈希:

./bitcoin-cli -rpcwallet="" settxfee 0.1

./bitcoin-cli -rpcwallet="" sendtoaddress "<address>" 1

  • 挖出新块:

./bitcoin-cli generatetoaddress 1 <......> 20000000

  • 等待被开采的地块。甚至等了10个街区。

  • 通过哈希检查交易状态:

./bitcoin-cli -rpcwallet="" gettransaction <hash>

  • 输出为以下内容,显示0条确认信息:
  "amount": -0.10000000,
  "fee": -0.01430000,
  "confirmations": 0,
  "trusted": true,
  "txid": "..................",
  "walletconflicts": [
  ],
  "time": 1231408815,
  "timereceived": 1231408815,
  "bip125-replaceable": "no",
  "details": [
    {
      "address": "..........",
      "category": "send",
      "amount": -0.10000000,
      "vout": 0,
      "fee": -0.01430000,
      "abandoned": false
    }
  ],
  "hex": ".........."
}
  • 检查了内存池,发现事务仍在等待中:

./bitcoin-cli getrawmempool

  • 检查了阻止模板:

./bitcoin-cli getblocktemplate

  • 并获得以下输出:
error code: -9
error message:
Bitcoin Core is not connected!

状态:

Bitcoin Core RPC client version v0.19.1
Ubuntu 18.04 bionic

感谢您的投入。

0 个答案:

没有答案