Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions examples/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ Start ``bitcoind`` in regtest mode to create a private block chain.

Generate 101 blocks using a special `RPC <../reference/rpc/index.html>`__ which is only available in regtest mode. This takes less than a second on a generic PC. Because this is a new block chain using Bitcoin’s default rules, the first blocks pay a block reward of 50 bitcoins. Unlike mainnet, in regtest mode only the first 150 blocks pay a reward of 50 bitcoins. However, a block must have 100 confirmations before that reward can be spent, so we generate 101 blocks to get access to the coinbase transaction from block #1.

If block generation fails with an error such as ``CreateNewBlock:
TestBlockValidity failed: bad-fork-prior-to-checkpoint (code 67)``, make
sure that both ``bitcoind`` and ``bitcoin-cli`` are using ``-regtest`` and
that you are not reusing stale regtest chain data from an earlier test. Stop
``bitcoind``, delete only the ``regtest`` subdirectory of the Bitcoin Core
configuration directory, restart ``bitcoind -regtest -daemon``, and run the
matching generation command for your Bitcoin Core version again. Bitcoin Core
18.0 and later should use ``generatetoaddress`` as shown above.

.. highlight:: bash

::
Expand Down