13.06.2017 Views

Whitepaper - Ethereum Classic With Cover

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Ethereum</strong> <strong>Classic</strong> Documentation, Release 0.1<br />

1.6.3 CPU mining<br />

You can use your computer’s central processing unit (CPU) to mine ether. This is no longer profitable, since GPU<br />

miners are roughly two orders of magnitude more efficient. However, you can use CPU mining to mine on the<br />

Morden testnet or a private chain for the purposes of creating the ether you need to test contracts and transactions<br />

without spending your real ether on the live network.<br />

Note: The testnet ether has no value other than using it for testing purposes (see Test Networks).<br />

Using geth<br />

When you start up your ethereum node with geth it is not mining by default. To start it in CPU mining mode, you<br />

use the --mine command line option. The -minerthreads parameter can be used to set the number parallel<br />

mining threads (defaulting to the total number of processor cores).<br />

geth --mine --minerthreads=4<br />

You can also start and stop CPU mining at runtime using the console. miner.start takes an optional parameter<br />

for the number of miner threads.<br />

> miner.start(8)<br />

true<br />

> miner.stop()<br />

true<br />

Note that mining for real ether only makes sense if you are in sync with the network (since you mine on top of<br />

the consensus block). Therefore the eth blockchain downloader/synchroniser will delay mining until syncing is<br />

complete, and after that mining automatically starts unless you cancel your intention with miner.stop().<br />

In order to earn ether you must have your etherbase (or coinbase) address set. This etherbase defaults to your<br />

primary account. If you don’t have an etherbase address, then geth --mine will not start up.<br />

You can set your etherbase on the command line:<br />

geth --etherbase 1 --mine 2>> geth.log // 1 is index: second account by creation order OR<br />

geth --etherbase '0xa4d8e9cae4d04b093aac82e6cd355b6b963fb7ff' --mine 2>> geth.log<br />

You can reset your etherbase on the console too:<br />

miner.setEtherbase(eth.accounts[2])<br />

Note that your etherbase does not need to be an address of a local account, just an existing one.<br />

There is an option to add extra Data (32 bytes only) to your mined blocks. By convention this is interpreted as a<br />

unicode string, so you can set your short vanity tag.<br />

miner.setExtra("ΞTHΞSPHΞΞ")<br />

...<br />

debug.printBlock(131805)<br />

BLOCK(be465b020fdbedc4063756f0912b5a89bbb4735bd1d1df84363e05ade0195cb1): Size: 531.00 B TD: 643485<br />

NoNonce: ee48752c3a0bfe3d85339451a5f3f411c21c8170353e450985e1faab0a9ac4cc<br />

Header:<br />

[<br />

...<br />

...<br />

}<br />

Coinbase:<br />

Number: 131805<br />

Extra:<br />

ΞTHΞSPHΞΞ<br />

a4d8e9cae4d04b093aac82e6cd355b6b963fb7ff<br />

You can check your hashrate with miner.hashrate, the result is in H/s (Hash operations per second).<br />

1.6. Mining 67

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!