Skip to Content
Mastering Blockchain - Second Edition
book

Mastering Blockchain - Second Edition

by Ankur Daharwal, Imran Bashir, Pranav Burnwal
March 2018
Beginner to intermediate
656 pages
20h 9m
English
Packt Publishing
Content preview from Mastering Blockchain - Second Edition

Starting up a node in regtest

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:

Messages in Bitcoin debug log

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Blockchain - Third Edition

Mastering Blockchain - Third Edition

Imran Bashir
Mastering Blockchain

Mastering Blockchain

Lorne Lantz, Daniel Cawrey
Mastering Ethereum

Mastering Ethereum

Andreas M. Antonopoulos, Gavin Wood

Publisher Resources

ISBN: 9781788839044Supplemental Content