Mining

By default, geth doesn't start mining. To instruct geth to start mining, you just need to provide the --mine option. There are a few other options related to mining:

    geth --mine --minerthreads 16 --minergpus '0,1,2' --etherbase '489b4e22aab35053ecd393b9f9c35f4f1de7b194' --unlock '489b4e22aab35053ecd393b9f9c35f4f1de7b194'

Here, along with the --mine option, we have provided various other options. The --minerthreads option specifies the total number of threads to use while hashing. By default, eight threads are used. Etherbase is the address to which the reward earned by mining is deposited. By default, accounts are encrypted. So to access the ether in the account, we need to unlock it, that is, decrypt the account. Decryption is used to decrypt the private key associated with the account. To start mining, we don't need to unlock it because only the address is required to deposit the mining rewards. One or more accounts can be unlocked using the -unlock option. Multiple addresses can be provided by separating the addresses using comma.

--minergpus is used to specify the GPUs to use for mining. To get the list of GPUs, use the geth gpuinfo command. For each GPU, you need to have 1-2 GB of RAM. By default, it doesn't use GPUs, instead only CPU.