This guide outlines my first (and failed) attempt at mining Ether on AWS. I will first show how I set up a GPU instance to mine Ether. Then I will conclude on the profitability of the whole endeavour in a simple way, i.e. profit = [value of generated Ether] - [AWS cost].
The guide is based on this, this, this and this.
|Machine||p2.xlarge (spot instance)|
Log into AWS in us-east-1.
Launch an p2.xlarge EC2 machine. Set the bid price to $0.9. Use the image ami-2cbf3e44, which comes with the NVIDIA drivers etc. The instance should have 100gb disk space to hold the blockchain.
(SSH into the machine)
sudo apt-get install software-properties-common sudo add-apt-repository -y ppa:ethereum/ethereum-qt sudo add-apt-repository -y ppa:ethereum/ethereum sudo add-apt-repository -y ppa:ethereum/ethereum-dev sudo apt-get update sudo apt-get install ethereum
Start a screen session:
Run geth in the screen session, which begins to download the blockchain:
You can now detach from the screen session by hitting ctrl a and d and disconnect from the machine. Periodically check back on the progress of geth downloading the blockchain.
(After a while)
Reattach to the screen session and check the process:
You will see an output that looks like the output below. When geth has caught up with the block chain, you will see messages with 1 block per line.
(When block chain has caught up)
Now we will mine Ether using the default ethminer. This is not recommended according to etherminer.org, but we will see how bad it is.
Install the cpp-ethminer:
sudo apt-get update sudo apt-get install cpp-ethereum
Benchmark the miner to measure its hash rate. You will need to run it twice. The first time it runs it builds a DAG. The second time it runs it will run the actual benchmark:
# Run twice ethminer -G -M
I got about 19 MH/s (i.e. 19 million hashes per second) on the p2.xlarge instance.
Create a new screen window by hitting ctrl-a and c.
Now, mine some Ether in the new window. Use the -F option to send it to your account via ethermine.org:
ethminer -F http://eu1.ethermine.org:5555/0x7B194c41B9B5325ae4225Af86Ba4a3a2cdc6Bf4D.rig1 -G
The long string that begins with '0x7B...' and ends right before '.' is my Ether wallet. You should obviously use your own.
Now, you can detach from the screen session with ctrl-a and d and check back once in a while to see if it is still running. Also check if Ether accumulates in your wallet. Finally, you can check the dash board (mine) to see the progress.
Now, let's tally the Ether that was generated and subtract the cost for the AWS instance.
The AWS spot price for one p2.xlarge is about $0.2/hour. According to ethermine, my rig generates about $0.01 worth of Ether per hour. That gives a negative result of $0.01 - $0.2 = -$0.19/hour.
The AWS p2.xlarge instance would need to be 20 x more effective to break even. Ethermine reports my effective hashrate as 19 MH/s. In conclusion, we need to squeeze at least 380 MH/s out of the p2.xlarge or find something else to do.