I'm searching for a way to mine 60 blocks without the waiting time (or at least significantly reduce the time) on a testnet. Can it be done or will it affect other operations in the blockchain?
Asked
Active
Viewed 213 times
2 Answers
0
If you're using a local testnet (that is, you don't need to accept blocks from other peers, nor get peers to accept your blocks), then you can hardcode a fixed difficulty in src/cryptonote_basic/difficulty.cpp, returning a small value in next_difficulty. A value equal to your hash rate will get you a block every 2 minutes on average. A value equal to your hash rate divided by 20 will get you a block every 6 second on average, etc.
user36303
- 34,928
- 2
- 58
- 123
0
No code changes needed:
$ monerod --help | grep fixed
--fixed-difficulty arg (=0) Fixed difficulty used for testing.
jtgrassie
- 19,601
- 4
- 17
- 54