<p>Because regtest is supposed to be test network, it has to be pretty similar to mainnet. Thus there really isn't separate code for regtest only, most of the code is shared between the two networks. The differences are really only defined by a few parameter changes which can be found in <a href="https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L281" rel="nofollow noreferrer">chainparams.cpp</a>.</p>

CC BY-SA 4.0
2018-05-27T12:51:05.970Z
Thanks Andrew. What I really want to know is the miner part for Regtest. I believe what original Satoshi Nakamoto told. So, how to reduce the system cost, specially the mining cost is the biggest issue. I think the two basic functions of mining can be separated into two parts;  one for find the data recorder, another for system safety. I think the getwork is better than getblocktemplate for unti-concentrated, maybe only internal miner is ever better.
yrm23
CC BY-SA 4.0
2018-05-27T14:53:46.150Z
There's no mining in regtest. Regtest was also made half a decade after Satoshi left.
Claris
CC BY-SA 4.0
2018-05-27T04:52:11.620Z
2018-05-27T04:52:11.620Z
Ava Chow
<p>I try to compare the source codes between main net and regtest net of bitcoin. I am not sure where the source codes of regtest located. Would someone help me, please?</p>

<source-code>
Which file is the source codes of regtest net located?
yrm23
# Which file is the source codes of regtest net located?

(Asked by: username_0 on 2018-05-27)

I try to compare the source codes between main net and regtest net of bitcoin. I am not sure where the source codes of regtest located. Would someone help me, please?

**Tags:** source-code


---

## 1 answers

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

Because regtest is supposed to be test network, it has to be pretty similar to mainnet. Thus there really isn't separate code for regtest only, most of the code is shared between the two networks. The differences are really only defined by a few parameter changes which can be found in [chainparams.cpp](https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L281).

> **Comments:**
> **username_0**: Thanks Andrew. What I really want to know is the miner part for Regtest. I believe what original Satoshi Nakamoto told. So, how to reduce the system cost, specially the mining cost is the biggest issue. I think the two basic functions of mining can be separated into two parts;  one for find the data recorder, another for system safety. I think the getwork is better than getblocktemplate for unti-concentrated, maybe only internal miner is ever better.  
> **username_2**: There's no mining in regtest. Regtest was also made half a decade after Satoshi left.  

---

