<p>I believe you can still use the <code>generate</code> and <code>generatetoaddress</code> commands to mine a certain number of blocks. <code>setgenerate</code> was removed in version 0.13 because mining with bitcoin core on mainnet is useless and has been for a number of years:
<a href="https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner</a></p>

CC BY-SA 3.0
2018-02-13T03:53:57.937Z
Interesting, I didn't know this worked outside regtest mode, but the code suggests that it does.  (Of course it will be very slow and one might wish to use an external cpu miner instead.)
Nate Eldredge
CC BY-SA 3.0
2018-02-13T04:49:39.233Z
@NateEldredge yeah I thought the same, but couldn't find any checks in the code and running it on mainnet didn't throw any errors, so unless someone knows something otherwise, I guess it works :)
meshcollider
CC BY-SA 3.0
2018-02-13T03:23:37.757Z
2018-02-13T04:48:30.293Z
2018-02-13T04:48:30.293Z
meshcollider
<p>I forked bitocin and created a altcoin.</p>

<p>Now I am running a node of it. There are currently 0 blocks because there are no miners. How can I enable mining on bitcoind?</p>

<p>I tried adding gen=1 with config, but it's not mining.</p>

<p>I believe there was a setgenerate true command, but I am not sure how to use it. How can I make my node mine coins?</p>

<bitcoind><mining-software><altcoin-development>
How to enable mining on daemon?
linux932
# How to enable mining on daemon?

(Asked by: username_0 on 2018-02-12)

I forked bitocin and created a altcoin.

Now I am running a node of it. There are currently 0 blocks because there are no miners. How can I enable mining on bitcoind?

I tried adding gen=1 with config, but it's not mining.

I believe there was a setgenerate true command, but I am not sure how to use it. How can I make my node mine coins?

**Tags:** bitcoind, mining-software, altcoin-development


---

## 1 answers

### Answer by username_1 on 2018-02-13. Score: 1

I believe you can still use the `generate` and `generatetoaddress` commands to mine a certain number of blocks. `setgenerate` was removed in version 0.13 because mining with bitcoin core on mainnet is useless and has been for a number of years:
<https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner>

> **Comments:**
> **username_2**: Interesting, I didn't know this worked outside regtest mode, but the code suggests that it does.  (Of course it will be very slow and one might wish to use an external cpu miner instead.)  
> **username_1**: @username_2 yeah I thought the same, but couldn't find any checks in the code and running it on mainnet didn't throw any errors, so unless someone knows something otherwise, I guess it works :)  

---

