<p>No there isn't. Regtest is not designed to test mining ASICs and the motivation for such a RPC seems limited given regtest is for local testing.</p>
<p>However, if you want to experiment with mining on a network with limited network hash rate you could either try mining on the default <a href="https://bitcoin.stackexchange.com/questions/98553/how-do-i-get-set-up-on-signet">Signet</a> administered by Kalle Alm and AJ Towns or you could set up your own custom Signet network and then use the Signet mining utility in this <a href="https://github.com/bitcoin/bitcoin/pull/19937" rel="nofollow noreferrer">PR</a> (19937) to mine blocks. AJ Towns lays out some examples in a <a href="https://github.com/bitcoin/bitcoin/pull/19937#issuecomment-696419619" rel="nofollow noreferrer">PR comment</a>.</p>
<p>e.g.</p>
<blockquote>
<p>Generate blocks indefinitely, at 10 minute intervals, paying block
reward to the given address, using bitcoin-util to do multi-threaded
proof-of-work:</p>
<p><code> ./contrib/signet/generate.py --cli='./bitcoin-cli' generate 10 --block-time=600 --address=&quot;tb1...&quot; --grind-cmd='./bitcoin-util grind'</code></p>
</blockquote>

CC BY-SA 4.0
2020-10-24T16:59:06.960Z
2020-10-24T17:05:30.273Z
2020-10-24T17:05:30.273Z
Michael Folkson
<p>Is there an RPC command which would allow me to generate blocks under a given difficulty? For instance, I would like to do something like this:</p>
<pre><code>bitcoind -daemon -regtest
bitcoin-cli -regtest setdifficulty 100
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
bitcoin-cli -regtest setdifficulty 1
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
</code></pre>
<p>I am aware that it would result in an invalid blockchain, since it would not match the expected target recalculation of the Bitcoin protocol. This &quot;detail&quot; aside, is there any way to use bitcoind/bitcoin-cli to perform something like this?</p>

<bitcoind><bitcoin-cli><regtest><signet>
Change difficulty using bitcoin-cli/bitcoind in regtest mode
Tristan Nemoz
# Change difficulty using bitcoin-cli/bitcoind in regtest mode

(Asked by: username_0 on 2020-09-10)

Is there an RPC command which would allow me to generate blocks under a given difficulty? For instance, I would like to do something like this:

```
bitcoind -daemon -regtest
bitcoin-cli -regtest setdifficulty 100
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
bitcoin-cli -regtest setdifficulty 1
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u

```

I am aware that it would result in an invalid blockchain, since it would not match the expected target recalculation of the Bitcoin protocol. This "detail" aside, is there any way to use bitcoind/bitcoin-cli to perform something like this?

**Tags:** bitcoind, bitcoin-cli, regtest, signet


---

## 1 answers

### Answer by username_1 on 2020-10-24. Score: 1 | Accepted answer

No there isn't. Regtest is not designed to test mining ASICs and the motivation for such a RPC seems limited given regtest is for local testing.

However, if you want to experiment with mining on a network with limited network hash rate you could either try mining on the default [Signet](https://bitcoin.stackexchange.com/questions/98553/how-do-i-get-set-up-on-signet) administered by Kalle Alm and AJ Towns or you could set up your own custom Signet network and then use the Signet mining utility in this [PR](https://github.com/bitcoin/bitcoin/pull/19937) (19937) to mine blocks. AJ Towns lays out some examples in a [PR comment](https://github.com/bitcoin/bitcoin/pull/19937#issuecomment-696419619).

e.g.

> Generate blocks indefinitely, at 10 minute intervals, paying block
> reward to the given address, using bitcoin-util to do multi-threaded
> proof-of-work:
>
> `./contrib/signet/generate.py --cli='./bitcoin-cli' generate 10 --block-time=600 --address="tb1..." --grind-cmd='./bitcoin-util grind'`


---

