0

I'm prepping for a tabconf workshop and trying to make the simplest uX for workshop attendees.

Using bitcoincore.org for binaries: The Mac dmg doesn't come with a bitcoin-cli like with Linux. It does come with Bitcoin-Qt + console though which I'm guessing is good enough.

Is it possible to generate regtest blocks through the Bitcoin-Qt console GUI? When I try to run generate I'll see:

has been replaced by the -generate cli option. Refer to -help for more information.
 (code -1)

It's not clear to me if I can utilize -generate through the gui console.

1 Answer 1

1

No, you cannot access -generate from the Qt console. It's a feature inside bitcoin-cli only.

Note however that all -generate does is invoke the getnewaddress RPC to get a new address, and then invoke generatetoaddress to generate coins to it. You can do that directly by hand from the RPC console just fine.

4
  • thanks for the quick answer Sep 1, 2023 at 21:19
  • Pieter, followup question. Is there a reason generate isn't available through Bitcoin-Qt or why it was taken out? I'm wondering if this would be an opportunity for me to look into enabling it or doing a feature request. Sep 1, 2023 at 21:52
  • 1
    The history is that the generate RPC was removed, because it was mixing subsystems that were being disentangled (the wallet, and the mining logic). Instead there is just a generatetoaddress which mines to a given address, and a thin wrapper -generate in the CLI that just calls getnewaddress + generatetoaddress, to avoid too much breakage of tests relying on generate. See my updated answer. Sep 1, 2023 at 22:28
  • Can you convert this to the answer^? Sep 1, 2023 at 22:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.