Is there an RPC command which would allow me to generate blocks under a given difficulty? For instance, I would like to do something like this:
bitcoind -daemon -regtest
bitcoin-cli -regtest setdifficulty 100
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
bitcoin-cli -regtest setdifficulty 1
bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u
I am aware that it would result in an invalid blockchain, since it would not match the expected target recalculation of the Bitcoin protocol. This "detail" aside, is there any way to use bitcoind/bitcoin-cli to perform something like this?