If you have been keeping up to date with the news you may have heard that Monero has become the drug dealers cryptocurrency of choice for its superior anonymity over popular cryptocurrencies like bitcoin.
Recently I have also been spending most of my time working on cloud applications so I thought what better way to combine the two then a tutorial on how to use AWS free tier to mine Monero.
To access AWS free-tier you simply have to register for an AWS account and provide a credit card, just incase you provision something or go over your allocated free limit.
Once you have done this spin up a free tier eligible Ubuntu 14.04 LTS instance and give it a name like I have below:
Once complete setup your ssh key and tinker with your AWS security groups if you are so inclined but thats not necessary for this tutorial.
Navigate over to mymonero.com and create a wallet the entire process is extremely simple and can be done in < 60 seconds so I'm not going to document the setup here. just be sure to record your:
- Wallet address
- Public key
- Private key
So you can log into it later for future use.
In order to be able to start cryptocurrency mining you need to install the following prerequisites:
$ sudo apt-get install git $ sudo apt-get install aptitude $ sudo aptitude update $ sudo aptitude install –with-recommends build-essential autotools-dev autoconf automake libcurl3 libcurl4-gnutls-dev git make cmake libssl-dev pkg-config libevent-dev libunbound-dev libminiupnpc-dev doxygen supervisor jq libboost-all-dev htop
Now you will need to make sure you are using gcc v5:
$ sudo apt-get update $ sudo apt-get install gcc-5 g++-5 $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5 $ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 1
Now you need to clone the git repo which has the mining tools that we need:
$ git clone https://github.com/wolf9466/cpuminer-multi
Now you can begin the process of setting up your mining client:
$ cd cpuminer-multi $ ./autogen.sh $ ./configure $ make
Now you can run the commands to start mining Monero or follow on and use the custom mining script below to make your operation a little more resilient.
Custom mining script
I was able to piece together the following custom mining script
#!/bin/bash ~/cpuminer-multi/minerd -a cryptonight -o stratum+tcp://xmr.prohash.net:7777 -u <wallet address> -p x &
to run it simply type ./monero at the command prompt (Please not that the wallet address needs to be replace with your actual Monero wallet address).
This script also uses the mining pool at xmr.prohash.net.
In order to ensure that your system can survive a restart setup a cron entry as root on reboot so that you will resume mining:
#cron entry @reboot /home/ubuntu/cpuminer-multi/monero
Once the script is complete and running you should see output like the following indicating that you are now mining Monero coins:
[2017-01-28 04:39:41] Stratum detected new block [2017-01-28 04:39:52] accepted: 99/99 (100.00%), 44.06 H/s at diff 2500 (yay!!!) [2017-01-28 04:40:13] accepted: 100/100 (100.00%), 44.29 H/s at diff 2500 (yay!!!) [2017-01-28 04:41:47] accepted: 101/101 (100.00%), 43.96 H/s at diff 2500 (yay!!!) [2017-01-28 04:42:13] accepted: 102/102 (100.00%), 43.88 H/s at diff 2500 (yay!!!) [2017-01-28 04:42:16] Stratum detected new block [2017-01-28 04:42:25] accepted: 103/103 (100.00%), 43.94 H/s at diff 2500 (yay!!!) [2017-01-28 04:42:56] accepted: 104/104 (100.00%), 46.23 H/s at diff 2500 (yay!!!) [2017-01-28 04:43:29] Stratum detected new block [2017-01-28 04:44:13] accepted: 105/105 (100.00%), 45.72 H/s at diff 2500 (yay!!!) [2017-01-28 04:45:31] accepted: 106/106 (100.00%), 45.82 H/s at diff 2500 (yay!!!)
And thats it now you are mining the drug dealers cryptocurrency of choice Monero.
As always I hope you found this tutorial useful. Please let me know if you would like to see more cloud or cryptocurrency tutorials and if you want to send some Montero coins my way you can send them to:
Also special thanks to Dennis Gesker who was able to put enough steps of the Montero mining process together that I could get going.