CPU mining

Even though not profitable on the mainnet, CPU mining is still valuable on the test network or even a private network to experiment with mining and contract deployment. Private and test networks will be discussed with practical examples in the next chapter, Chapter 12, Ethereum Development Environment. A Geth example is shown on how to start CPU mining here. Geth can be started with mine switch in order to start mining:

geth --mine --minerthreads <n> 

CPU mining can also be started using the Web3 Geth console. Geth console can be started by issuing the following command:

$ geth attach 

After this, the miner can be started by issuing the following command, which will return True if successful, or False otherwise. Take a look at ...

Get Mastering Blockchain - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.