To know the useful checks, I feel it is necessary 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 necessary messages are printed there — many checks even test to ensure a sure message was printed.

In a second window, get an inventory 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 tackle for receiving funds.
If 'label' is specified, it's added to the tackle e book 
so funds acquired with the tackle will likely be related to 'label'.

1. label           (string, non-obligatory, default="") The label title for the tackle to be linked to. It will also be set to the empty string "" to signify the default label. The label doesn't must exist, it is going to be created if there isn't any label by the given title.
2. address_type    (string, non-obligatory, default=set by -addresstype) The tackle kind to make use of. Choices are "legacy", "p2sh-segwit", and "bech32".

"str"    (string) The brand new bitcoin tackle

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

Give it a strive!

$ bitcoin-cli -regtest getnewaddress

Now go check out a easy take a look at like and be aware 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 take a look at framework launches and configures particular person nodes, learn You will discover lots of the useful checks 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 info is a useful useful resource. By going via useful checks and looking out up the rpc instructions and launch arguments, you will ultimately get an intuition for the way the extra difficult checks work.

Source link


Please enter your comment!
Please enter your name here