The regtest mode (regression testing mode) can be used to create a local blockchain for testing purposes.
The following commands can be used to start up a node in the regtest mode:
$ bitcoind -regtest -daemon Bitcoin server starting
Blocks can be generated using the following command:
$ bitcoin-cli -regtest generate 200
Relevant log messages can be viewed in the .bitcoin/regtest directory on a Linux system under debug.log:
![](/api/v2/epubs/9781788839044/files/assets/4fbcf3ee-5306-445a-b550-c6dc6c8d15cf.png)
After block generation, the balance can be viewed as follows:
$ bitcoin-cli -regtest getbalance 8750.00000000
The node can be stopped using this:
$ bitcoin-cli ...