Excerpt;
== Generating ==
generate nblocks ( maxtries )
generatetoaddress nblocks address (maxtries)
getgenerate
getwork ( "data" )
setgenerate generate ( genproclimit ) ( sievesize ) ( sieveprimes ) ( shift )
I debated with myself whether to mention
generatetoaddress in my response. Although I haven't checked, because I haven't interfered with any of that particular code, I have no reason to doubt its flawless functioning. The trouble is that in-wallet mining of BTC on mainnet was (correctly) considered futile by the Bitcoin devs as far back as 0.13, nearly five years ago - at which point
the code for the internal miner was removed from Bitcoin.
One of the key implications of this is that
the remaining generator code in the Bitcoin codebase is intended solely for use with testnet/regtest.
The practical consequences are that
generatetoaddress isn't suitable for use as a general-purpose, run-until-stopped miner. The call takes three arguments: the target number of blocks to generate, the address to which they should be credited and, importantly, the maximum number of tries to attempt before returning -
generatetoaddress nblocks "address" ( maxtries ) - and then it stops and you need to call it again. It's not that it
can't be driven from a bash/Powershell script, it's just that this additional technical demand imposes a higher barrier to entry.
However, the Bitcoin code that implements the address-handling for the
generatetoaddress function is obviously a candidate for copying and pasting. If it's perceived as highly-desirable to integrate this functionality into the in-wallet miner, one approach would be to store a mining address in the gapcoin.conf file and pick up the value from that.
Be advised though, having all the mined blocks going to one address compromises anonymity but if there's a compelling use case, I would be prepared to consider putting in the time and effort to get it to work.
Cheers
Graham