<p>Mainnet and regtest have different rules for the difficulty.</p>

<p>As their consensus rules are different, the mainnet chain will not be valid according to regtest rules or vice versa.</p>

CC BY-SA 4.0
2018-08-14T17:54:04.267Z
2018-08-14T17:54:04.267Z
Pieter Wuille
<p>I want to verify that my updates to the bitcoind source code don't break anything. One way that I thought of doing that was through loading the mainnet data into a regtest instance. To do that I first copied the good data folder and then ran my newly-compiled server in regtest mode pointing to my copy. I.e:</p>

<p>./bitcoind -server -regtest -datadir=.../my_data_copy</p>

<p>When I query the server it does not return any data. The debug.log file shows a number of block rollbacks. Why doesn't that work? </p>

<p>Is it possible to run the daemon in a way that it verifies the current code against the data on disk, such that the the current code would generate the same data? Is it possible to copy data from main or test networks and load that in the regtest mode? </p>

<p>I was thinking I needed to use regtest to avoid connecting to the live network. I don't need to connect to the network at all to verify the data, and I certainly don't want to broadcast anything in my test scenario.</p>

<bitcoind><regtest><validation>
verifying my modifications to bitcoind w/o broadcasting anything
Brannon
# verifying my modifications to bitcoind w/o broadcasting anything

(Asked by: username_0 on 2018-08-14)

I want to verify that my updates to the bitcoind source code don't break anything. One way that I thought of doing that was through loading the mainnet data into a regtest instance. To do that I first copied the good data folder and then ran my newly-compiled server in regtest mode pointing to my copy. I.e:

./bitcoind -server -regtest -datadir=.../my\_data\_copy

When I query the server it does not return any data. The debug.log file shows a number of block rollbacks. Why doesn't that work?

Is it possible to run the daemon in a way that it verifies the current code against the data on disk, such that the the current code would generate the same data? Is it possible to copy data from main or test networks and load that in the regtest mode?

I was thinking I needed to use regtest to avoid connecting to the live network. I don't need to connect to the network at all to verify the data, and I certainly don't want to broadcast anything in my test scenario.

**Tags:** bitcoind, regtest, validation


---

## 1 answers

### Answer by username_1 on 2018-08-14. Score: 1 | Accepted answer

Mainnet and regtest have different rules for the difficulty.

As their consensus rules are different, the mainnet chain will not be valid according to regtest rules or vice versa.


---

