bitcoind.app
CommandsGuidesContact ↗
Home/Generating/generatetoaddress
Generating

generatetoaddress

Mine blocks immediately to a specified address (for regtest mode).

Parameters

nblocksnumberREQUIRED
How many blocks to generate
addressstringREQUIRED
The address to send new coins to
maxtriesnumberoptional
Max iterations to try. Default: 1000000

Returns

arrayArray of block hashes

Code Examples

curl --user myuser --data-binary '{"jsonrpc":"1.0","id":"1","method":"generatetoaddress","params":[1,"bcrt1q..."]}' -H 'content-type:text/plain;' http://127.0.0.1:8332/

Example Response

["0000000036d51f27d..."]
← Previous
generateblock
Next →
generatetodescriptor

More Generating Commands

generateblockgeneratetodescriptor

bitcoind.app — Bitcoin Core RPC Reference

GuidesContact ↗