1
can anyone explain what are this rpc methods used for:
1.generate
https://bitcoincore.org/en/doc/0.16.3/rpc/generating/generate/
from the introduction of generate mehod:
Mine up to nblocks blocks immediately
but how? bitcoin is hard to mine, how can this method mine nblocks immediately?
generate nblocks ( maxtries )
Mine up to nblocks blocks immediately (before the RPC call returns) to an address in the wallet.
Arguments:
1. nblocks (numeric, required) How many blocks are generated immediately.
2. maxtries (numeric, optional) How many iterations to try (default = 1000000).
Result:
[ blockhashes ] (array) hashes of blocks generated
Examples:
Generate 11 blocks
> bitcoin-cli generate 11
2.generatetoaddress
https://bitcoincore.org/en/doc/0.16.3/rpc/generating/generatetoaddress/
the same question as generate method
generatetoaddress nblocks address (maxtries)
Mine blocks immediately to a specified address (before the RPC call returns)
Arguments:
1. nblocks (numeric, required) How many blocks are generated immediately.
2. address (string, required) The address to send the newly generated bitcoin to.
3. maxtries (numeric, optional) How many iterations to try (default = 1000000).
Result:
[ blockhashes ] (array) hashes of blocks generated
Examples:
Generate 11 blocks to myaddress
> bitcoin-cli generatetoaddress 11 "myaddress"
thank you, how about the maxtries param in input, what it is used for? – huahuayu – 2018-11-12T05:44:32.837
@huahuayu Maximum nonce perhaps? – KappaDev – 2018-11-12T06:16:20.593