How can I do CPU mining on testnet?

2

I'm trying to do cpu mining on testnet to debug coinbase transactions in my application.

Tried running GUI miner, I get the below output:

2014-07-31 11:31:51: Running command: poclbm.exe testnetuser:test123456@localhost:18332 --device=0 --platform=0 --verbose -r1
2014-07-31 11:31:51: Listener for "Default" started
2014-07-31 11:31:53: Listener for "Default": No PyOpenCL
2014-07-31 11:31:53: Listener for "Default": Not using OpenCL
2014-07-31 11:31:53: Listener for "Default": Nothing to mine on, exiting

I tried UFASoft miner, set the listening port to 18332 but nothing happens.

What is the easiest way to do cpu mining on testnet?

Is there another way of getting coinbase transactions in my testnet wallet?

Emre Kenci

Posted 2014-07-31T08:36:21.850

Reputation: 3 008

Answers

3

Even on testnet the difficulty is sufficiently high that it will take you a long time to mine anything using cpu. (Lots of people testing ASICs, presumably.)

Your best bet is probably Testnet in a box. Then you can cpu mine just by using ´setgenerate true´ in Bitcoin Core.

Nate Eldredge

Posted 2014-07-31T08:36:21.850

Reputation: 21 420

I thought setgenerate true option was removed. Thanks.Emre Kenci 2014-08-01T06:44:59.360

This worked for me.Emre Kenci 2014-08-01T08:51:11.823

2There is now regtest mode in plain bitcoind, you don't need any additional dependency. Using regtest you have a private blockchain and using generate method you mine instantly.jangorecki 2015-08-28T18:04:51.480

1@jangorecki: That comment should rather be an answer. :)Murch 2016-04-25T18:38:57.433