Mining STEEM on AWS (Free Tier)

in #steemhelp8 years ago (edited)

AWS

Setup AWS Instance.

  1. Establish Amazon AWS Account and log in (Credit card required)
  2. Under Amazon Web Services Choose EC2 under the Compute sub-category.
  3. Click Launch Instance
  4. Select Ubuntu Server 14.04 LTS (HVM), SSD Volume Type
  5. Click tickbox for the General Purpose t2.micro
  6. Click the Review and Launch button
  7. Finally, click Launch
  8. Create a new key pair unless you already have one setup and make sure you save the .pem file

Finding the EC2 Instance

  • Click the orange cube in top-left and then click EC2 under the Compute sub-category.
  • Choose Instances from the left side of the screen to see your new Linux AWS instance.

Connecting to the EC2 Instance

Right-click the instance and choose Connect for instructions on connecting.

Commands to Run

sudo apt-get update

sudo apt-get install git cmake g++ python-dev autotools-dev libicu-dev build-essential libbz2-dev libboost-all-dev libssl-dev libncurses5-dev doxygen libreadline-dev dh-autoreconf

sudo fallocate -l 4G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

wget -O boost_1_60_0.tar.gz http://sourceforge.net/projects/boost/files/boost/1.60.0/boost_1_60_0.tar.gz/download

tar xzvf boost_1_60_0.tar.gz

cd boost_1_60_0

./bootstrap.sh --prefix=/usr/local

sudo ./b2 install

cd

git clone https://github.com/bitcoin/secp256k1

cd secp256k1

./autogen.sh

./configure

make

./tests

cd

git clone https://github.com/steemit/steem

cd steem

git submodule update --init --recursive

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONTENT_PATCHING=OFF -DLOW_MEMORY_NODE=ON

make

cd programs/steemd

./steemd --rpc-endpoint --seed-node="seed.steemed.net:2001" --seed-node="52.74.152.79:2001"

cd steem/programs/cli_wallet

./cli_wallet

set_password "PASSWORD"

unlock "PASSWORD"

suggest_brain_key

  • Copy the JSON output and save it to secure locations
{
"brain_priv_key": "FULK DEBUG EARTH IMAGINE BABBLE POPIFY PREFEED EMBIND FOREPAW KAHILI ...",
"wif_priv_key": "5JsPmgU1dfKu8SHWAWkBKw1XGz97Kwz4DLwgm2bSz99qtFqTAkp", 
"pub_key": "STM73jgNRFLTKSTaGWv8QfXzSopUZBsQGmrECWPvpnemjyAcBfzAc"
}
  • Never share the "wif_private_key"
  • You will need your wif private key for the config.ini file in a minute.
  • this is a good time to load YOUR key in your cli_wallet terminal window like this:

import_key 5JsPmgU1dfKu8SHWAWkBKw1XGz97Kwz4DLwgm2bSz99qtFqTAkp

Exit cli_wallet terminal:

ctrl + c

This is a good time to pick your account/miner name. Remember, account names must be all lower case, less than 15 characters, and start with a letter. For instance, lets say you pick account name george1234 as your account name. Check if the account already exists by going to:

https://steemit.com/@george1234

If you get an error like this:

Server error (500) 10 assert_exception: Assert Exception itr != accounts_by_name.end(): Unable to find account 'george1234'. Did you forget to add a record for it? {"acct":"george1234"} th_a database.cpp:313 get_account

Then you are in luck and the account name is available to claim, try another until you stop getting the error.

Finally, you have what you need to edit your config.ini file and start mining.

Open file with your favorite linux text editor: steem/programs/steemd/witness_node_data_dir/config.ini

Replace george1234 with your account name and this wif key 5JsPmgU1dfKu8SHWAWkBKw1XGz97Kwz4DLwgm2bSz99qtFqTAkp with yours.

# P2P nodes to connect to on startup (may specify multiple times)

seed-node = 212.117.213.186:2016
seed-node = 185.82.203.92:2001
seed-node = 52.74.152.79:2001
seed-node = 52.63.172.229:2001
seed-node = 104.236.82.250:2001
seed-node = 104.199.157.70:2001
seed-node = steem.kushed.com:2001
seed-node = steemd.pharesim.me:2001
seed-node = seed.steemnodes.com:2001
seed-node = steemseed.dele-puppy.com:2001
seed-node = seed.steemwitness.com:2001
seed-node = seed.steemed.net:2001
seed-node = steem-seed1.abit-more.com:2001
seed-node = steem.clawmap.com:2001
seed-node = 52.62.24.225:2001
seed-node = steem-id.altexplorer.xyz:2001
seed-node = 213.167.243.223:2001
seed-node = 162.213.199.171:34191
seed-node = 45.55.217.111:12150
seed-node = 212.47.249.84:40696
seed-node = 52.4.250.181:39705
seed-node = 81.89.101.133:2001
seed-node = 46.252.27.1:1337

# name of witness controlled by this node (e.g. initwitness )

witness = "george1234"

# name of miner and its private key (e.g. ["account","WIF PRIVATE KEY"] )

miner = ["george1234","5JsPmgU1dfKu8SHWAWkBKw1XGz97Kwz4DLwgm2bSz99qtFqTAkp"]

# Number of threads to use for proof of work mining

mining-threads = 1

these are the parts you change, leave the rest as is and save your config file then go back to the steemd terminal window (hopefully it synced by now):

ctrl + c

will stop steemd and then restart it with the following line:

./steemd --rpc-endpoint

It should start mining as soon as it catches up to the latest block. Once a block is mined, the account name will be claimed. You can then run the following commands in CLI_wallet. Remember to change george1234 to your account name:

unlocked >>> get_account "george1234"  

unlocked >>> list_my_accounts  

unlocked >>> vote_for_witness george1234 joseph true true 

unlocked >>> vote george1234 "joseph" "mining-steem-for-dummies" 100 true 

https://steemit.com/steemhelp/@joseph/mining-steem-for-dummies

Big thanks to @joseph for his Mining guide. This guide borrows a lot from him.

#steemhelp #aws #mining #cryptocurrency #amazon #free

Sort:  

i have two instanses upp, want to setup a witnes and a node,ore mining steem any help welkoom

Saved: Will check it out for myself later.

What kind of Kh are you pulling on AWS?

I will let you know as soon as it sync's up the blockchain.

Thanks @eliteturbo! I followed this and it works like a breeze. I'm still catching up on the blockchain. Any updates on approximately how long this took you and what kind of hashrate you're seeing?

It takes about a day to sync up and I'm getting around 2500 hps per instance. Make sure you update to the latest version of steemd to get past some stopper blocks. I had trouble around 3.1M due to old version.

Yep had the same issue. Thanks for posting this tho. Was super helpful!

I'm curious what your kh is too !

Ho do you get back to view what the miner is doing after you close and then re-open a terminal? Thanks

I just open a second connection to the instance and run steem/programs/cli_wallet which should connect to steemd. Once inside cli_wallet, enter the command "info" to see its progress.

can you leave this on all the time without going over the free account allowances?

You can leave one t2.micro instance on 24/7 for one year. After that year, the instance will no longer be eligible for free-tier service.

This is a really great help - thanks for doing this. I am totally new to Linux but I'm trying to learn, could you break down what the commands in the first section are doing?

specifically:
sudo fallocate -l 4G /swapfile

sudo chmod 600 /swapfile

sudo mkswap /swapfile

sudo swapon /swapfile

chmod things are changing permissions to files, I can look that up

./bootstrap.sh --prefix=/usr/local

cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONTENT_PATCHING=OFF -DLOW_MEMORY_NODE=ON

after that we are installing steem and configuring.

any clarification would be great, thank you once again for taking the time to post about this!!!!

No problem. The AWS t2.micro is a low memory instance. In order to compile the software from source, we require virtual memory from the storage partition. This is what the swap commands are doing. Once you finish compiling the source files, you can turn off the swap file by running the following two commands:

sudo swapoff /swapfile

sudo rm /swapfile

I have got this working now but i think its crashing the server, i got back and check every couple of hours and I can't connect (connection reset by peer)

I need to reboot the server and reconnect.

I have done the low memory mode build, maybe i need to reduce the number of threads

hmm, I think it might be running out of harddrive space. Try the following to remove the swap file:

sudo swapoff /swapfile
sudo rm /swapfile

Usually a VPS or cloud will have issues if you close the SSH connection. You can solve this by adding "&" to the end of the command line that starts a server/daemon or whatever.

Example

sudo ./start_server &

You are basically telling bash to start the prog/service and keep it going in the background, then closing the ssh "should" not stop the server

This is great but I read somewhere that after the first hour you only get about 20 hps. THis is because in the first hour you use up the burst CPU feature and it runs at the baseline CPU power. IE, YOu would need thousands to make even a very modest living in a 3rd world country. It is a good guide though and interesting as a little project for the lulz.

Coin Marketplace

STEEM 0.20
TRX 0.12
JST 0.029
BTC 60670.43
ETH 3380.02
USDT 1.00
SBD 2.51