I am currently working on reward halving changes for a test coin and i have added all the necessary changes but my question is how do i safely test this new halving without affecting production. I understand bitcoin has testnet but is there a way to test the altcoin halving. May be connecting two daemons with each other to create a closed network? Thank you in advance.
If your test coin source code has the same regtest mode as bitcoin, you can use that, it allows you to mine blocks instantly and it's a completely separate chain to the testnet or mainnet so it won't affect anyone else. You can run your coin with the
-regtest argument, and then use the
generate RPC to mine blocks and see how much reward you get. Note that in the source code, the regtest reward halving may be (and probably is) a different number of blocks to mainnet, this can be changed in