generateblock
generating dangerous since 0.21.0mines a set of ordered transactions to a specified address or descriptor and return the block hash.
↑ shares the docs page. Use Share this query below for a link with your current arg values.
Not executable from the web. Would harm the node, the network, or expose secrets. Documentation only, never executable from the web.
Call from your own code
Replace $BITCOIN_RPC_USER / $BITCOIN_RPC_PASSWORD with credentials from your bitcoind's bitcoin.conf,
and replace localhost:8332 with your node's RPC address.
You can't run this RPC against our node, but you can run it against your own bitcoind.
Help
generateblock "output" ["rawtx/txid",...]
Mine a set of ordered transactions to a specified address or descriptor and return the block hash.
Arguments:
1. output (string, required) The address or descriptor to send the newly generated bitcoin to.
2. transactions (json array, required) An array of hex strings which are either txids or raw transactions.
Txids must reference transactions currently in the mempool.
All transactions must be valid and in valid order, otherwise the block will be rejected.
[
"rawtx/txid", (string)
...
]
Result:
{ (json object)
"hash" : "hex" (string) hash of generated block
}
Examples:
Generate a block to myaddress, with txs rawtx and mempool_txid
> bitcoin-cli generateblock "myaddress" '["rawtx", "mempool_txid"]'