regtest
is the test network best suited for this kind of testing. While it does still have a PoW requirement, the work required is basically negligible. It also does not do retargeting so the difficulty does not change. This allows you to create blocks at will. So you can use the regtest
network option in order to test that your code is creating blocks correctly.
Should I try to remine the genesis block, or should I try to create my own blocktemplate to be mined? And how could I do this?
As all of the alternate networks available have genesis blocks, there is no need (nor way) to remine the genesis block. You should be creating new blocks that build on top of the existing chain. Since regtest
is a local private network, all it has is the genesis block and you can add blocks on top.
You can either create your own blocks from scratch, or use the getblocktemplate
RPC to get block templates that you can use. This will still work on regtest. The only caveat is that you need to generate at least 1 block after you start the regtest node in order for getblocktemplate
to work. There is a generatetoaddress
RPC built into bitcoind so that you can do that. This RPC will mine a new regtest block with the coins from the coinbase going to an address of your choice.