<p>Previous versions of bitcoin core included a miner, and you could use the RPC call <code>setgenerate</code> to activate it. However, this functionallity <a href="https://bitcoin.org/en/release/v0.13.0#removal-of-internal-miner" rel="nofollow noreferrer">was removed on Bitcoin Core v0.13.0</a>. In any case, this does does not seem to work on regtest (I have tried it with v0.11.1 and it returns a message saying to use <code>generate</code> instead).</p>

<p>Whenever I need to "simulate" nodes competing to mine in a regtest network, I define their mining power and randomly select which one of them is going to mine taking into account their defined mining power. Then, I send a <code>generate 1</code> RPC call to the miner that has been selected.</p>

CC BY-SA 3.0
2018-03-05T08:25:43.443Z
Yes but how would I define mining power of a node in the software bitcoin core? And how would send generate 1 RPC call to selected miner?
DOLLY PATWA
CC BY-SA 4.0
2018-10-14T16:31:09.170Z
@DOLLYPATWA you answered your own question, you would use the rpc interface and send a generate 1 block call to it.
PW Kad
CC BY-SA 3.0
2018-02-05T17:42:32.007Z
2018-02-05T17:42:32.007Z
cpsola
<p>As we know ,  Bitcoin core-Regtest is used to set up our own blockchain starting from Genesis Block. I have created Two nodes on my localhost running on different ports (I am using Windows 8.1). They are connected to each other. Now I want to increase the difficulty level and create mining competition between two nodes. </p>

<p>I can manually use <strong><em>generate Number_of_blocks</em></strong> to mine that many <strong><em>Number_of_blocks</em></strong> on any node and It also includes my recent transactions which are not yet included in the blockchain while mining. </p>

<p>But how can have such an arrangement in which I will increase difficulty and start mining on both the nodes, and whoever comes first will broadcast the block and win the race.??</p>

<p>Any reference or step by step explanation would be much appreciated</p>

<bitcoin-core><miner-configuration><difficulty><testnet><regtest>
Creating Mining Competition on regtest
DOLLY PATWA
# Creating Mining Competition on regtest

(Asked by: username_0 on 2017-07-13)

As we know , Bitcoin core-Regtest is used to set up our own blockchain starting from Genesis Block. I have created Two nodes on my localhost running on different ports (I am using Windows 8.1). They are connected to each other. Now I want to increase the difficulty level and create mining competition between two nodes.

I can manually use ***generate Number\_of\_blocks*** to mine that many ***Number\_of\_blocks*** on any node and It also includes my recent transactions which are not yet included in the blockchain while mining.

But how can have such an arrangement in which I will increase difficulty and start mining on both the nodes, and whoever comes first will broadcast the block and win the race.??

Any reference or step by step explanation would be much appreciated

**Tags:** bitcoin-core, miner-configuration, difficulty, testnet, regtest


---

## 1 answers

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

Previous versions of bitcoin core included a miner, and you could use the RPC call `setgenerate` to activate it. However, this functionallity [was removed on Bitcoin Core v0.13.0](https://bitcoin.org/en/release/v0.13.0#removal-of-internal-miner). In any case, this does does not seem to work on regtest (I have tried it with v0.11.1 and it returns a message saying to use `generate` instead).

Whenever I need to "simulate" nodes competing to mine in a regtest network, I define their mining power and randomly select which one of them is going to mine taking into account their defined mining power. Then, I send a `generate 1` RPC call to the miner that has been selected.

> **Comments:**
> **username_0**: Yes but how would I define mining power of a node in the software bitcoin core? And how would send generate 1 RPC call to selected miner?  
> **username_2**: @username_0 you answered your own question, you would use the rpc interface and send a generate 1 block call to it.  

---

