3

I'm running a private bitcoin network and would like to reset the bitcoin blockchain data back to the genesis block.

I've tried deleting all the files in ~/.bitcoin/blocks and ~/.bitcoin/wallets but bitcoin-cli -testnet getblockchaininfo still shows existing blocks.

$ 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"
}
3

The testnet data directory is not ~/.bitcoin but rather ~/.bitcoin/testnet3. ~/.bitcoin holds the data for the main Bitcoin blockchain.

1
  • 1
    So you'll want to wipe out ~/.bitcoin/testnet3/blocks and ~/.bitcoin/testnet3/chainstate. Maybe also mempool.dat. – Nate Eldredge May 21 '18 at 17:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.