Testnet

如何重置比特幣測試網

  • October 13, 2021

我正在執行一個私人比特幣網路,並希望將比特幣區塊鏈數據重置回創世塊。

我已經嘗試刪除所有文件~/.bitcoin/blocks~/.bitcoin/walletsbitcoin-cli -testnet getblockchaininfo仍然顯示現有塊。

$ bitcoin-cli -testnet getblockchaininfo
{
 "chain": "test",
 "blocks": 10,
 "headers": 10,
 "bestblockhash": "000000008668c111d16fd895919969836292a61919c6150a0f9a1dd5cc41aa55",
 "difficulty": 1,
 "mediantime": 1526598651,
 "verificationprogress": 6.116528714283428e-07,
 "initialblockdownload": false,
 "chainwork": "0000000000000000000000000000000000000000000000000000000b000b000b",
 "size_on_disk": 2573,
 "pruned": false,
 "softforks": [
   {
     "id": "bip34",
     "version": 2,
     "reject": {
       "status": false
     }
   },
   {
     "id": "bip66",
     "version": 3,
     "reject": {
       "status": false
     }
   },
   {
     "id": "bip65",
     "version": 4,
     "reject": {
       "status": false
     }
   }
 ],
 "bip9_softforks": {
   "csv": {
     "status": "defined",
     "startTime": 1456790400,
     "timeout": 1493596800,
     "since": 0
   },
   "segwit": {
     "status": "defined",
     "startTime": 1462060800,
     "timeout": 1493596800,
     "since": 0
   }
 },
 "warnings": "This is a pre-release test build - use at your own risk - do not use for mining or merchant applications"
}

測試網數據目錄不是~/.bitcoin,而是~/.bitcoin/testnet3. ~/.bitcoin保存主要比特幣區塊鏈的數據。

引用自:https://bitcoin.stackexchange.com/questions/75388