bitcoincore improvement – How do I get began debugging Bitcoin Core practical checks?


To know the practical checks, I believe it is necessary to start out with an understanding of how bitcoind works and the way the RPC interface is used.

Begin Bitcoin Core in a terminal window in regtest mode (a neighborhood check community that doesn’t connect with any friends by default):

$ bitcoind -regtest

Regulate the output! That is your debug log, and necessary messages are printed there — many checks even examine to verify a sure message was printed.

In a second window, get a listing of instructions:

$ bitcoin-cli -regtest assist

You will get assist for any particular command:

$  bitcoin-cli -regtest assist getnewaddress
getnewaddress ( "label" "address_type" )

Returns a brand new Bitcoin deal with for receiving funds.
If 'label' is specified, it's added to the deal with e-book 
so funds acquired with the deal with will likely be related to 'label'.

1. label           (string, non-compulsory, default="") The label identify for the deal with to be linked to. It can be set to the empty string "" to symbolize the default label. The label doesn't have to exist, it will likely be created if there isn't any label by the given identify.
2. address_type    (string, non-compulsory, default=set by -addresstype) The deal with kind to make use of. Choices are "legacy", "p2sh-segwit", and "bech32".

"str"    (string) The brand new bitcoin deal with

> bitcoin-cli getnewaddress 
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "technique": "getnewaddress", "params": []}' -H 'content-type: textual content/plain;'

Give it a strive!

$ bitcoin-cli -regtest getnewaddress

Now go check out a easy check like and notice the syntax node.getnewaddress() — by this level you in all probability know precisely what that does and what the return worth will likely be.

To go deeper and perceive how the check framework launches and configures particular person nodes, learn You will discover most of the practical checks go configuration parameters to the start_nodes() operate.

To get a dictionary of these command line parameters, execute:

$ bitcoind -help

These are the important thing instruments I believe and the in-program assist data is a useful useful resource. By going by means of practical checks and looking out up the rpc instructions and launch arguments, you will finally get an intuition for the way the extra sophisticated checks work.

Supply hyperlink

Leave a reply