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

0
36


To grasp the practical assessments, I feel it is essential to begin 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 (an area take a look at community that doesn’t connect with any friends by default):

$ bitcoind -regtest

Keep watch over the output! That is your debug log, and essential messages are printed there — many assessments even verify to ensure a sure message was printed.

In a second window, get an inventory of instructions:

$ bitcoin-cli -regtest assist

You may get assist for any particular command:

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

Returns a brand new Bitcoin tackle for receiving funds.
If 'label' is specified, it's added to the tackle guide 
so funds acquired with the tackle can be related to 'label'.

Arguments:
1. label           (string, non-obligatory, default="") The label identify for the tackle to be linked to. It may also be set to the empty string "" to symbolize the default label. The label doesn't must exist, will probably be created if there isn't a label by the given identify.
2. address_type    (string, non-obligatory, default=set by -addresstype) The tackle kind to make use of. Choices are "legacy", "p2sh-segwit", and "bech32".

End result:
"str"    (string) The brand new bitcoin tackle

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

Give it a attempt!

$ bitcoin-cli -regtest getnewaddress
bcrt1qua6ku8kkx4m57tg6q44wh00h58vpk7lm8h82sy

Now go check out a easy take a look at like wallet_resendwallettransactions.py and notice the syntax node.getnewaddress() — by this level you most likely know precisely what that does and what the return worth can be.

To go deeper and perceive how the take a look at framework launches and configures particular person nodes, learn test_framework.py. You may discover most of the practical assessments cross configuration parameters to the start_nodes() perform.

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

$ bitcoind -help

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



Supply hyperlink

Leave a reply