0
1
I have some experience in Ethereum-related development and it was very easy to set up a private net with Ethereum that simulate the public main net, I just create a custom genesis block json config, then I can use it to set up half a dozen nodes to connect to a single bootnode, and voila I have a completely up and working private net which can perfectly mimic how the public main net works where I can mine ether and send transactions and wait for them to be mined in around 15 seconds, which is perfect for development and testing.
However when it comes to bitcoin it seems there's no easy way to setup a private net in a closed environment? I have searched around and the best I can find is use the regtest mode to connect multiple nodes, but there seems to be no way to simulate the real mining process, or do I really need to download the Bitcoin source and change some hardcoded settings and recompile my own version of (alt) bitcoin to just setup a private net?
What do you mean by "no way to simulate the real mining process"? You can mine on regtest. – Andrew Chow – 2018-06-13T06:09:13.420
@Andrew Chow, well from what I got from google results, it seems you just generate new blocks instantly in regtest mode, not really doing PoW mining to get a new block? Also the block confirmation is 100 blocks which is not the same as the public network. So are those info I see online incorrect? – hellopeach – 2018-06-13T10:50:57.953
It is still PoW mining, just the difficulty is extremely low. The difficulty also does not change. Otherwise, everything is the same as the mainnet. There is no such thing as "block confirmation". However there is coinbase maturity which is the number of confirmations for a coinbase transaction to be spendable from, and that is 100 blocks. This is the same for mainnet. – Andrew Chow – 2018-06-13T17:42:21.740
@Andrew Chow, okay I guess the online tutorials that I looked up messed up on the concepts of block maturity and transaction maturity, but still the mining mechanism seems different from mainnet, since it seems I'm not able to mine the regtest nodes with an older version of cgminer that still supports cpu mining? – hellopeach – 2018-06-14T04:28:32.720
cgminer relies on getblocktemplate which is not available unless your node is connected to another node. This behavior is the same for mainnet, testnet, and regtest. cgminer should work on regtest if you can connect another node. Of course it is going to mine blocks extremely quickly as the difficulty is extremely low and does not change. – Andrew Chow – 2018-06-14T06:30:32.103