Ethereum AWS Miner Node Installation and Setup
For more information on Ethereum, visit ethereum.org
Description:
Ethereum is a decentralized platform that runs smart contracts using a custom built blockchain. The platform uses a cryptocurrency also called Ethereum (Ether/ETH). This tutorial will walk through all of the necessary steps, required to get a mining rig set up to mine the Ethereum cryptocurrency.
Pre-Requisites:
These instructions are only compatible with Ubuntu 15.10 or newer
Although other OS's are supported, this tutorial is built on the Ubuntu platform. The reason that Ubuntu was chosen was simply due to the ease of finding the right ethereum PPA repositories.
1. Perform an update:
sudo apt-get -y update
sudo apt-get -y upgrade
2. Install the Build Essentials:
sudo apt-get -y install build-essential
3. Ensure we have wget, screen, git and we also need software-properties:
sudo apt-get -y install sudo wget vim screen git software-properties-common
4. Install the Nvidia Cuda Drivers:
cd /media
sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb
Install Ethereum:
1. Install the Ethereum repos:
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
2. Install Ethereum required dependancies:
sudo apt-get -y update
sudo apt-get -y install cmake libcryptopp-dev libleveldb-dev libjsoncpp-dev libjsonrpccpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev cuda
3. Install Ethereum:
sudo apt-get -y install ethereum
Install the C++ Ethereum miner:
1. Clone the repo:
cd /media
sudo git clone https://github.com/Genoil/cpp-ethereum/"
2. Compile the miner:
sudo mkdir /media/cpp-ethereum/build
sudo sh -c 'cd /media/cpp-ethereum/build; cmake -DBUNDLE=miner ..'
sudo sh -c 'cd /media/cpp-ethereum/build; make -j8'
3. Export GPU settings:
sudo echo 'export GPU_FORCE_64BIT_PTR=0' | sudo tee --append /media/set_env.sh
sudo echo 'export GPU_MAX_HEAP_SIZE=100' | sudo tee --append /media/set_env.sh
sudo echo 'export GPU_USE_SYNC_OBJECTS=1' | sudo tee --append /media/set_env.sh
sudo echo 'export GPU_SINGLE_ALLOC_PERCENT=100' | sudo tee --append /media/set_env.sh
sudo echo 'export GPU_MAX_ALLOC_PERCENT=100' | sudo tee --append /media/set_env.sh
Sync the blockchain:
The next few steps we will run in a screen session, so that they will continue to run even after we close the terminal.
1. Start a screen session:
screen
2. Allow the blockchain to sync:
cd ~
geth --rpc console
We can tell that the synchronization is complete when the number
field in the geth output, matches the LAST BLOCK value found on etherscan.io
3. Disconnect from the screen session:
Once the blockchain has completed it's initial syncronization, you can safely detach from the screen session by hitting ctl A
, ctl D
. This should put you back to your original shell.
4. Verify screen is still running:
screen -ls
root@localhost~ # screen -ls
There is a screen on:
2637.pts-0.ip-10-179-4-150 (06/01/2017 08:37:00 AM) (Detached)
Run the compiled miner:
1. Start another screen session:
screen
2. Run the miner:
cd /media/cpp-ethereum/build/ethminer
./ethminer -G
./ethminer -G
will start a solo mining process. It could take weeks/months to find a block on your own, especially if your MH/s rate isn't at least a few hundred. In order to make it more profitable, we will use an ethereum pool. With a pool such as nanopool, you generally don't have to register or pre-create an account, simply start a miner process, and once a single block has been confirmed and submitted, nanopool will create an account for your wallet address automatically. Other pools such as miningpoolhub.com do require a re-registration.Miningpoolhub:
1. Create a miningpoolhub.com account:
Go to https://ethereum.miningpoolhub.com, and in the left side menu choose Sign Up
Fill in your username (you will need this later), your password, email and choose a 4 digit pin. Once complete, click on the Register
button.
Once registered, you will see a flash message pop up that says Account created, please login
.
Login using the Login
link on the left menu.
2. Go to the Ethereum section:
Next we need to associate our wallet address with our account, we do this by clicking Ethereum, under the POOLS section on the left hand menu. |
3. Go to the Wallet section:
Next click on the Wallet link, under the MY ACCOUNT section again in the left hand menu. Clicking this link will show your wallet settings. Fill in the details in the POOL ACCOUNT DETAILS section.
Payment Address: | This is your ethereum wallet address |
Automatic Payout Threshold | This will be the minimum amount of ether that you will mine prior to receiving a payout. I usually set my threshold to 0.1 ether. |
4 Digit Pin | This is the same pin that was used to register the account. |
Once the details have been populated, click on Update Account
button. Once completed, your wallet should now be registered.
4. Connect miner to Miningpoolhub.com:
No flags are needed for individual GPUs, ethminer will collectivly use all GPUs on the node
./ethminer -G -S us-east.ethash-hub.miningpoolhub.com:20535 -O <UserName>.<Worker_Name>:<WorkerPassword>
UserName
with the username that was used to register your miningpoolhub account with. Replace Worker_Name
with a unique identifier for the node that your running the miner process on and finally replace WorkerPassword
with an arbitrary password. Workers do NOT need to be pre-registered with miningpoolhub, nor does the WorkerPassword value matter, miningpoolhub is not even checking the value of this, so I usually set my worker passwords to simply password. Once your mining worker helps to mine and submit a block, it will be auto-registered on miningpoolhub../ethminer -G -S us-east.ethash-hub.miningpoolhub.com:20535 -O clusterfrak.workerx:password
5. Disconnect from the screen session:
Once the miner has been started, you can safely detach from the screen session by hitting ctl A
, ctl D
. This should put you back to your original shell.
6. Verify screen is still running:
screen -ls
root@localhost~ # screen -ls
There are screens on:
2826.pts-0.ip-10-179-4-150 (06/01/2017 10:45:50 AM) (Detached)
2637.pts-0.ip-10-179-4-150 (06/01/2017 08:37:00 AM) (Detached)
7. Verify miningpoolhub worker:
Now that your node is successfully mining, wait about 15-20 minutes and check miningpoolhub to see your worker nodes hashrate and work performed. To see your stats, click on Dashboard under the My Account section on the Ethereum Pool page menu
The URL for the miningpoolhub dashboard will be:
https://ethereum.miningpoolhub.com/index.php?page=dashboard
Nanopool:
1. Connect to Nanopool.org:
No flags are needed for individual GPUs, ethminer will collectivly use all GPUs on the node
./ethminer -G -F http://eth1.nanopool.org:8888/<WALLET_ADDRESS>/<WORKER_NAME>/<EMAIL>
WALLET_ADDRESS
with a valid ethereum wallet address where nanopool can send your shared reward. Also replace WORKER_NAME
with a unique identifier for the node that your running the miner proccess on and finally replace EMAIL
with a valid email address. The email will be used by nanopool to send you notifications automatically if your worker node goes offline../ethminer -G -F http://eth1.nanopool.org:8888/0x1111222233334444555566667777888899990000/aws-node-1/[email protected]
2. Disconnect from the screen session:
Once the miner has been started, you can safely detach from the screen session by hitting ctl A
, ctl D
. This should put you back to your original shell.
3. Verify screen is still running:
screen -ls
root@localhost~ # screen -ls
There are screens on:
2826.pts-0.ip-10-179-4-150 (06/01/2017 10:45:50 AM) (Detached)
2637.pts-0.ip-10-179-4-150 (06/01/2017 08:37:00 AM) (Detached)
4. Verify nanopool registration:
Now that your node is successfully mining, wait about 15-20 minutes and check nanopool to see if you node is registered. Once the account is provisioned based on your worker nodes's work, you will be able to go to your nanopool dashboard, and see all of your running nodes, along with the amount of Ethereum that you made with your worker node.
The URL for nanopool will be:
https://eth.nanopool.org/account/<WALLET_ADDRESS>
So for our example the URL will be:
https://eth.nanopool.org/account/0x1111222233334444555566667777888899990000
Packer File:
The following packer config can be used with packer to automatically provision your own AWS Ethereum Miner Node
packer build -var-file filename.json ethereum-rig.json
command to run packer. In that example filename.json would be the buildvars file, and ethereum-rig.json would be a file with the code below.{
"variables": {
"aws_access_key": "",
"aws_secret_key": "",
"instance_type": "g2.8xlarge",
"region": "us-east-1",
"use1_ami": "ami-80861296",
"vpc_id": "",
"subnet_id": "",
"security_group_id": "",
"ssh_keypair_name": "",
"ssh_username": "ubuntu"
},
"builders": [{
"type": "amazon-ebs",
"access_key": "{{user `aws_access_key`}}",
"secret_key": "{{user `aws_secret_key`}}",
"region": "{{user `region`}}",
"source_ami": "{{user `use1_ami`}}",
"instance_type": "{{user `instance_type`}}",
"ami_name": "Ethereum-Mining-Rig-{{timestamp}}",
"ami_description": "Image with all of the tools required to mine Ethereum",
"availability_zone": "us-east-1a",
"vpc_id": "{{user `vpc_id`}}",
"subnet_id": "{{user `subnet_id`}}",
"security_group_id": "{{user `security_group_id`}}",
"ssh_keypair_name": "{{user `ssh_keypair_name`}}",
"ssh_agent_auth": true,
"ssh_username": "{{user `ssh_username`}}",
"associate_public_ip_address": true,
"ssh_private_ip": false,
"tags": {
"Name": "Ethereum Mining Rig",
"OS_Version": "Ubuntu 16.04"
}
}],
"provisioners": [
{
"type": "shell",
"inline": [
"sudo apt-get -y update",
"sudo apt-get -y upgrade",
"sudo apt-get -y install build-essential",
"sudo apt-get -y install sudo wget vim screen git",
"cd /media",
"sudo git clone https://github.com/Genoil/cpp-ethereum/",
"sudo wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1404/x86_64/cuda-repo-ubuntu1404_8.0.44-1_amd64.deb",
"sudo dpkg -i cuda-repo-ubuntu1404_8.0.44-1_amd64.deb",
"sudo apt-get -y 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 -y update",
"sudo apt-get -y install cmake libcryptopp-dev libleveldb-dev libjsoncpp-dev libjsonrpccpp-dev libboost-all-dev libgmp-dev libreadline-dev libcurl4-gnutls-dev ocl-icd-libopencl1 opencl-headers mesa-common-dev libmicrohttpd-dev cuda",
"sudo apt-get -y install ethereum",
"sudo mkdir /media/cpp-ethereum/build",
"sudo sh -c 'cd /media/cpp-ethereum/build; cmake -DBUNDLE=miner ..'",
"sudo sh -c 'cd /media/cpp-ethereum/build; make -j8'",
"sudo echo 'export GPU_FORCE_64BIT_PTR=0' | sudo tee --append /media/set_env.sh",
"sudo echo 'export GPU_MAX_HEAP_SIZE=100' | sudo tee --append /media/set_env.sh",
"sudo echo 'export GPU_USE_SYNC_OBJECTS=1' | sudo tee --append /media/set_env.sh",
"sudo echo 'export GPU_SINGLE_ALLOC_PERCENT=100' | sudo tee --append /media/set_env.sh",
"sudo echo 'export GPU_MAX_ALLOC_PERCENT=100' | sudo tee --append /media/set_env.sh",
"sudo echo 'source /media/set_env.sh' | sudo tee --append /root/.bashrc",
"sudo echo 'source /media/set_env.sh' | sudo tee --append /home/ubuntu/.bashrc",
"sudo echo 'source /media/set_env.sh' | sudo tee --append /etc/skel/.bashrc"
]
}
]}
Post Requisites:
None, You can sit back, relax, and collect some ETH !!
References:
clusterfrak.com
Angelomilan Ethereum Guide
Genoil Ethereum Miner Fork
Etherscan.io
Nanopool
Coin Gecko Currency Converter
Thanks for the very detailed guide mate.
What is the cost and benefit of using AWS to mine Ether at the moment?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
I have former co-workers who currently work for Amazon; during a happy-hour event last night, the subject of cryptocurrency mining came up, and he said that AWS has a considerable pool of resources for mining. Good luck, and happy mining :)
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
yea, I tested a few of the configurations, although it can be super expensive, you can get up to ~300 MH/S with a P2.16xlarge instance type... But not worth it at 10K a month for that instance class.. These instructions can be used on any box really, its not specific to AWS, which is why I wanted to post it.. I built this on Ubuntu 16.04 earlier this week.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Interesting thoughts
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit