generatetoaddress
Generatetoaddress is a Bitcoin Core RPC call used to generate a specified number of new blocks and pay the coinbase rewards to a specified address. It is primarily a testing and development utility, providing deterministic block generation without external mining pressure. The command is available on regtest and, in some configurations, on testnet, but it is not exposed on the mainnet to prevent misuse and wasteful mining.
Syntax and parameters: generatetoaddress nblocks address (maxtries). nblocks is the number of blocks to create, address
Return value: The call returns an array of block hashes, one for each generated block, allowing tests
Usage notes: Blocks generated with generatetoaddress are added to the node’s current best chain in regtest
See also: generate, a legacy RPC formerly used for mining on older setups; other testnet/regtest tooling and