generateblock (hidden command)

Bitcoin Core 25.0 RPC

generateblock "output" ["rawtx/txid",...] ( submit )

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)
       ...
     ]
3. submit               (boolean, optional, default=true) Whether to submit the block before the RPC call returns or to return it as hex.

Result

{                    (json object)
  "hash" : "hex",    (string) hash of generated block
  "hex" : "hex"      (string, optional) hex of generated block, only present when submit=false
}

Examples

Generate a block to myaddress, with txs rawtx and mempool_txid
> bitcoin-cli generateblock "myaddress" '["rawtx", "mempool_txid"]'