<p>No, you cannot access <code>-generate</code> from the Qt console. It's a feature inside <code>bitcoin-cli</code> only.</p>
<p>Note however that all <code>-generate</code> does is invoke the <code>getnewaddress</code> RPC to get a new address, and then invoke <code>generatetoaddress</code> to generate coins to it. You can do that directly by hand from the RPC console just fine.</p>

CC BY-SA 4.0
2023-09-01T21:19:25.407Z
thanks for the quick answer
Michael Tidwell
CC BY-SA 4.0
2023-09-01T21:52:31.777Z
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.
Michael Tidwell
CC BY-SA 4.0
2023-09-01T22:28:03.013Z
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.
Pieter Wuille
CC BY-SA 4.0
2023-09-01T22:40:40.870Z
Can you convert this to the answer^?
Michael Tidwell
CC BY-SA 4.0
2023-09-01T21:18:48.960Z
2023-09-01T22:24:48.927Z
2023-09-01T22:24:48.927Z
Pieter Wuille
<p>I'm prepping for a tabconf workshop and trying to make the simplest uX for workshop attendees.</p>
<p>Using bitcoincore.org for binaries: The Mac dmg doesn't come with a <code>bitcoin-cli</code> like with Linux. It does come with Bitcoin-Qt + console though which I'm guessing is good enough.</p>
<p>Is it possible to generate regtest blocks through the Bitcoin-Qt console GUI?
When I try to run <code>generate</code> I'll see:</p>
<pre><code>has been replaced by the -generate cli option. Refer to -help for more information.
 (code -1)
</code></pre>
<p>It's not clear to me if I can utilize <code>-generate</code> through the gui console.</p>

<bitcoin-cli><regtest><bitcoin-qt-setup>
Generate regtest blocks with Bitcoin-Qt
Michael Tidwell
# Generate regtest blocks with Bitcoin-Qt

(Asked by: username_0 on 2023-09-01)

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.

**Tags:** bitcoin-cli, regtest, bitcoin-qt-setup


---

## 1 answers

### Answer by username_1 on 2023-09-01. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_0**: thanks for the quick answer  
> **username_0**: 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.  
> **username_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.  
> **username_0**: Can you convert this to the answer^?  

---

