Mining Ethereum

Had a go at mining Ethereum the other day. It took a bit of time to get setup, but I eventually got everything working.

That said, I only ran it for a few hours and then decided to go buy some instead. At a hashrate of 22MH I would stand to make $2.99 a week. Not exactly worth taxing my machine for.

Anyhow, since it took a while to figure out, here’s what worked for me on Ubuntu.

1. Install ethereum, etherminer and geth

1
2
3
4
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt-get install ethereum ethminer geth

Geth, or go-ethereum is a command line tool implemented in Go.
You can use Geth to setup a wallet, it also has a console where you can check wallet details etc.

2. If you don’t have a wallet already, go create one

1
geth account new

You should get an output something like this

1
2
3
4
Your new account is locked with a password. Please give a password. Do not forget this password.
Passphrase:
Repeat passphrase:
Address: {0c53e2075ba1e07bf30dec43915ddabf93412f47}

This creates a private key at ~/.ethereum/keystore/, so don’t forget your password or you loose all your Ether.

3. Run the etherminer benchmark

This will calculate your hashrate. The -G flag is for GPU mining. CPU is too slow.

1
ethminer -M -G

The first time I ran this it came back and told me I had a hashrate of 0. Running it a second or subsequent times said 22MH.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
[OPENCL]:Found suitable OpenCL device [GeForce GTX 980 Ti] with 6372589568 bytes of GPU memory
◇ 18:54:12.457|ethminer #00004000…
Benchmarking on platform: { "platform": "NVIDIA CUDA", "device": "GeForce GTX 980 Ti", "version": "OpenCL 1.2 CUDA" }
Preparing DAG...
Warming up...
ℹ 18:54:12.457|gpuminer0 workLoop 0 #00000000… #00000000…
ℹ 18:54:12.457|gpuminer0 Initialising miner...
Trial 1... [OPENCL]:Using platform: NVIDIA CUDA
[OPENCL]:Using device: GeForce GTX 980 Ti(OpenCL 1.2 CUDA)
[OPENCL]:Printing program log
[OPENCL]:
[OPENCL]:Creating one big buffer for the DAG
[OPENCL]:Loading single big chunk kernels
[OPENCL]:Mapping one big chunk.
[OPENCL]:Creating buffer for header.
[OPENCL]:Creating mining buffer 0
[OPENCL]:Creating mining buffer 1
11883861
Trial 2... 21495808
Trial 3... 22631765
Trial 4... 22457002
Trial 5... 22457002
min/mean/max: 11883861/20185087/22631765 H/s
inner mean: 22194858 H/s
Phoning home to find world ranking...

4. Find a pool

Apparently solo mining isn’t very rewarding. So your best bet is to find a mining pool. There is a list at https://forum.ethereum.org/discussion/3659/list-of-pools. They all have different rules, rewards and fees.

5. Start mining

Once you pick a pool you can start mining. The pool you use should tell you how to mine with them. Here is what I used.

1
ethminer -G -F http://ethereumpool.co/?miner=22@0x0c53e2075ba1e07bf30dec43915ddabf93412f47@aar

As you can see from the above command, it has my hashrate, my wallet address and the pool I’m mining.

6. Check your account balance

Start the geth console and run web3.fromWei(eth.getBalance(eth.coinbase), "ether")

1
2
geth console
web3.fromWei(eth.getBalance(eth.coinbase), "ether")

eth will log out a JSON object with more details