<p>The <code>setgenerate</code> RPC has been removed in version Bitcoin Core v0.13, in 2016.</p>
<p>Use the <a href="https://bitcoincore.org/en/doc/0.21.0/rpc/generating/generateblock/" rel="nofollow noreferrer"><code>generateblock</code></a> or <a href="https://bitcoincore.org/en/doc/0.21.0/rpc/generating/generatetoaddress/" rel="nofollow noreferrer"><code>generatetoaddress</code></a> RPCs instead.</p>

CC BY-SA 4.0
2021-10-12T11:55:54.140Z
thanks for your reply | can you explain exactly what the mining command is going to be with generateblock? and do i put this like this bitcoin-cli blockgenerate or in the console from the qt blockgenerate? and will this solo mine non stop or isn't this the same mining as set generate true 1.
BG media
CC BY-SA 4.0
2021-10-12T11:57:39.367Z
I've added links to the documentation.
Pieter Wuille
CC BY-SA 4.0
2021-10-12T11:59:49.060Z
and pieter is there a possibilty to add an code snipped to again activate the old set generate true in the code ? an setgenerate rpc code snipped ? and in wich folder should i change/activate this if i have such an snipped .
BG media
CC BY-SA 4.0
2021-10-12T12:01:41.737Z
You can make any changes you want in your own copy of the source code to add such an RPC back if you want, but you're on your own then. The software does not support it.
Pieter Wuille
CC BY-SA 4.0
2021-10-12T10:02:51.590Z
2021-10-12T11:57:30.250Z
2021-10-12T11:57:30.250Z
Pieter Wuille
<p>can somebody help me to point out where and in wich file the setgenerate true testnet function is located and controlled is it in chainparams.ccp or somewhere else ? and where to change the bitcoin testnet block memory to reset it .and to be able to test starting with zero blocks in testnet ?and i dont need to know regtest is the thing for you im learning the code and not testing .
so i really like to know how the setgenerate true is turned of and on in the code and where the block memory is located . because i removed block data in .bitcoin and deleted seeds but still my testnet is saying 3 years loading where is this comming from ?</p>
<p>al help is welcome
thanks in advance</p>

<wallet><source-code>
bitcoin file function folder location testnet setgenerate true
BG media
# bitcoin file function folder location testnet setgenerate true

(Asked by: username_0 on 2021-10-12)

can somebody help me to point out where and in wich file the setgenerate true testnet function is located and controlled is it in chainparams.ccp or somewhere else ? and where to change the bitcoin testnet block memory to reset it .and to be able to test starting with zero blocks in testnet ?and i dont need to know regtest is the thing for you im learning the code and not testing .
so i really like to know how the setgenerate true is turned of and on in the code and where the block memory is located . because i removed block data in .bitcoin and deleted seeds but still my testnet is saying 3 years loading where is this comming from ?

al help is welcome
thanks in advance

**Tags:** wallet, source-code


---

## 1 answers

### Answer by username_1 on 2021-10-12. Score: 0 | Accepted answer

The `setgenerate` RPC has been removed in version Bitcoin Core v0.13, in 2016.

Use the [`generateblock`](https://bitcoincore.org/en/doc/0.21.0/rpc/generating/generateblock/) or [`generatetoaddress`](https://bitcoincore.org/en/doc/0.21.0/rpc/generating/generatetoaddress/) RPCs instead.

> **Comments:**
> **username_0**: thanks for your reply | can you explain exactly what the mining command is going to be with generateblock? and do i put this like this bitcoin-cli blockgenerate or in the console from the qt blockgenerate? and will this solo mine non stop or isn't this the same mining as set generate true 1.  
> **username_1**: I've added links to the documentation.  
> **username_0**: and username_1 is there a possibilty to add an code snipped to again activate the old set generate true in the code ? an setgenerate rpc code snipped ? and in wich folder should i change/activate this if i have such an snipped .  
> **username_1**: You can make any changes you want in your own copy of the source code to add such an RPC back if you want, but you're on your own then. The software does not support it.  

---

