Comprehensive and Updated Guide to Mining Steem (For Both Windows and Linux Users) - One-stop-shop for all your information needs!

in steemit •  8 years ago  (edited)

I have been using Steemit for the past couple of weeks now.  Like a lot of other people who started mining Steem to get their early start, I followed several guides posted by more experienced members.   Following these guides, I found that most were either not detailed enough or had steps which were either missing or in some instances incorrect.   As a newbie this made getting started complicated and frustrating at the same time trying to figure everything out.  Piecing together information from several guides, I finally got my miner started only to have to start from square one again once a hard fork came along which required updating files.

Over the course of the past few weeks, I have deployed miners on several PCs and Virtual Machines using both Windows and Linux.  I have setup miners on various cloud platforms and have finally compiled a list of steps which has worked on every deployment and should continue to work in the event of any future hard forks that come along.  I initially wrote an article on how to setup mining using a free Azure account but even that article had some confusing parts to follow.

This guide will hopefully help any newbie in setting up a miner for either Windows and/or Linux and serve as a one-stop-shop for everyone.  I have also included videos of actual installations that I did which will take you through the entire setup process all the way until the miner starts mining.

Before I begin, thanks to @pfunk, @bitcube, @tuck-fheman, @joseph, and @r3b37 for getting me started.  I have gathered bits and pieces from their guides and added/updated some steps of my own to create a detailed walk through which should work for everyone.

I couldn't get HTML page anchors to work, so below are the different sections to this post. You can scroll down to the specific section you need help on:

Windows

Linux/Ubuntu


Other optional Instructions

Setting up multiple miners - beneficial to have since your miner becomes idle when it enters the block mining queue

Setting up your wallet- This is purely Optional.  Although you can control your wallet from your account profile on steemit.com, configuring it through the terminal and/or DOS will give you additional control over your earnings


Windows

Setting up a miner in windows is the faster and simpler of the two Operating Systems.  There has been much debate on whether mining is more efficient in Windows or in Linux.  I have found that mining in either environment produces the same result.  The only difference i have noticed is that your mining indicator shows up as "false" when you mine with Windows.  You are however, still mining and still receive POW notifications and earnings.

Step 1: (If you have not installed this yet)  Download and Install the  Visual C++ Redistributable Package for Visual Studio 2013 (Choose the correct package for your operating system x64 or x32 bit)

Step 2: Download the Steem Miner and Wallet for Windows (compiled by @bitcube - This link should continue to contain the latest version of the miner)

Step 3: Extract the Files to a location on your PC.  I usually extract them to the root c: or to the desktop to make it easier to find (in the video example below I extracted to the desktop and then moved it to the root c:)

Step 4: (optional) rename the extracted folder to Steem (or anything you like - this step will make it easier when you are trying to navigate to the folder in DOS)

Step 5: Download the latest Blockchain file (Click the "Download Steemit" blockchain button.  This file is updated every 12 hours and will reduce the amount of time it takes your miner to sync after you complete the setup)

Step 6: Extract the contents to the desktop.  by default the folder name is witness_node_data_dir.  

Step 7: Open the witness_node_data_dir folder you just extracted and you will see another witness_node_data_dir folder.  Copy this folder to your miner folder (the folder from steps 3 and 4 above)

Step 8: Open the witness_node_data_dir folder that you copied and right click on the config.ini file.  Edit this file using Wordpad

Step 9: Previously you had to edit and update the seed nodes, but in the recent versions, the file comes with nodes pre-loaded.  The only fields you will need to edit are the following:

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

witness = "your-steem-account-name" 

make sure the account name is not taken by going to https://steemit.com/@your-steem-account-name

and

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

miner = ["your-steem-account-name","5YourPrivateWIFKeyIsVeryLong"]

you can find your WIF key by either logging into your steemit account and going to the Permissions section - use the ACTIVE Private Key 

or if you don't yet have an account on steemit

you can generate one at bitaddress.org - Make sure you keep this in a safe place because it will serve as your password later when logging into your steemit account. (You will need to mine a block before the account will be created automatically at steemit.com)

the last field to change is

 # Number of threads to use for proof of work mining 

mining-threads = X 

change X to the number of threads your CPU can support.  If you're not sure, press CTL+Shift+ESC to open the Task Manager and click the Performance tab. The number of graph boxes under CPU usage history is the number of threads your CPU supports. In Windows 10 you will need to click "Open Resource Monitor".

Step 10: Save the file

Step 11: Open a DOS window and navigate to the location where you stored the folder you extracted in step 3

Step 12: type in steemd.exe --rpc-endpoint to start your miner.  It should start syncing and then eventually start mining

Below is a video I made of the entire setup process from start to finish for Windows


Linux/Ubuntu

Setting up a miner in Linux/Ubuntu is a little more complex - especially if you don't have experience with the operating system (like me.)  Following is step-by-step instructions on how to setup and get your miner running.  All you need to do is type in the following commands and follow each step and you should be good.

Step 1: Input all of the following commands in order 1 step at a time

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

wget http://steemitup.eu/witness_node_data_dir.tar.gz

tar xvzf witness_node_data_dir.tar.gz

cd witness_node_data_dir

Step 2: edit your config.ini file by typing the following command

nano config.ini

Previously you had to edit and update the seed nodes, but in the recent versions, the file comes with nodes pre-loaded.  The only fields you will need to edit are the following:

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

witness = "your-steem-account-name" 

make sure the account name is not taken by going to https://steemit.com/@your-steem-account-name

and

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

miner = ["your-steem-account-name","5YourPrivateWIFKeyIsVeryLong"]

you can find your WIF key by either logging into your steemit account and going to the Permissions section - use the ACTIVE Private Key 

or if you don't yet have an account on steemit

you can generate one at bitaddress.org - Make sure you keep this in a safe place because it will serve as your password later when logging into your steemit account. (You will need to mine a block before the account will be created automatically at steemit.com)

the last field to change is

 # Number of threads to use for proof of work mining 

mining-threads = X 

change X to the number of threads your CPU can support.  If you're not sure, press CTL+Shift+ESC to open the Task Manager and click the Performance tab. The number of graph boxes under CPU usage history is the number of threads your CPU supports. In Windows 10 you will need to click "Open Resource Monitor".

Step 3: Save the file by pressing Ctrl+O and then press "Enter" to save.

Step 3: Press Ctrl+X to exit

Step 4: Type cd

Step 5: Type ./steemd --rpc-endpoint to start your miner.  It should start syncing and then eventually start mining

Below is a video I made of the entire setup process from start to finish for Ubuntu (Its a long video)


Setting up Multiple Miners

It is beneficial to setup multiple miners.  Because of the mining queue system, this will allow you to continue mining when your initial miner enters the Miner-witness queue. To accomplish this,  you just need to edit your config.ini file described in the previous Windows and Linux sections.  The only difference is instead of inputting the information for 1 miner, you will need to input information for the number of miners you want to create.

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

witness = "your-steem-account-name-1

witness = "your-steem-account-name-2

witness = "your-steem-account-name-3

You will also need to input miner details for all your witness accounts you create

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

miner = ["your-steem-account-name-1","5YourPrivateWIFKeyIsVeryLong"]

miner = ["your-steem-account-name-2","5YourPrivateWIFKeyIsVeryLong"]

miner = ["your-steem-account-name-3","5YourPrivateWIFKeyIsVeryLong"]

You can use the same 5YourPrivateWIFKeyIsVeryLong Key if you like, but I would recommend different ones.  You will also need to make sure none of the account names are taken as mentioned in the windows and linux setup instructions.  New accounts will be created for each miner when a block is found if they don't already exist.  


Setting up your wallet

in Linux/Ubuntu:

start a new terminal window and type in the following commands:

cd steem/programs/cli_wallet

./cli_wallet

set_password "PASSWORD"

 unlock "PASSWORD"


in Windows:

Open a DOS window and Navigate to your miner folder

Type in cli_wallet.exe and use the same commands as mentioned above

set_password "PASSWORD"

 unlock "PASSWORD"

import_key 5YourPrivateWIFKeyIsVeryLong - From your config.ini file that you updated previously 

ctrl + c - To Exit 

There are other guides on Steemit which can explain the different functions, commands, and uses for your wallet


You can also use your wallet file to generate a WIF key using the following command after you unlock your wallet as described above

 suggest_brain_key 

The output would look something like this:

 `{
"brain_priv_key": "FULK DEBUG EARTH IMAGINE BABBLE POPIFY PREFEED EMBIND FOREPAW KAHILI ...",
"wif_priv_key": "5JsPmgU1dfKu8SHWAWkBKw1XGz97Kwz4DLwgm2bSz99qtFqTAkp",
"pub_key": "STM73jgNRFLTKSTaGWv8QfXzSopUZBsQGmrECWPvpnemjyAcBfzAc"
}`


That's It!   I hope this guide proves to be useful for everyone and is a helpful contribution to the steemit community.  Please don't hesitate to comment and make suggestions.  I will continue to update this if anything changes.  

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Warning! mining STEEM is not possible anymore.
Save your time.

Can I mine STEEM?
No. Proof of work mining has been removed from Steem.
https://steemit.com/faq.html#Can_I_mine_STEEM

Yup. I hold Steem that I have earned through posts. Thanks for Reading

@cloh76 This is a great tutorial! You can replace the boost instructions and just add libboost-dev to the apt get line.

Thanks for the recommendation @williambanks. I'll have to update that information in my next guide since i can no longer edit this one

I'm just starting to research and trying to understand why the focus in mining steem isn't on video cards like for eth or btc in it's early days?

Not exactly sure, but maybe someday someone will figure out how to start mining with GPUs

i think its uncluded in git submodule update --init --recursive
git clone https://github.com/bitcoin/secp256k1

GPU mining? I didnt see anything in the update that points to it

Cheers I am still trying to work out if I finally got it working last night thanks for more info

Sure. Let me know if you have any questions. If you see a hash rate like below, then it is working

I got this working relatively problem free, though I had to hash out the last seed note from the Config.ini file, as shown below:

seed-node = 212.47.249.84:40696
seed-node = 52.4.250.181:39705
seed-node = 81.89.101.133:2001
seed-node = 192.99.4.226:2001
seed-node = 46.252.27.1:1337
#seed-node = seed.steemd.com:34191

I was getting multiple errors stacking up until it exited starting with this:

3110051ms th_a application.cpp:102 reset_p2p_node ] Adding seed node 46.252.27.1:1337
3110111ms th_a application.cpp:102 reset_p2p_node ] Adding seed node 162.213.199.171:34191
3110112ms th_a application.cpp:102 reset_p2p_node ] Adding seed node 162.213.199.171:34191
3110123ms th_a application.cpp:352 startup ] 90003 already_connected_to_requested_peer: already connected to requested peer
already connected to requested endpoint 162.213.199.171:34191
{"endpoint":"162.213.199.171:34191"}
p2p node.cpp:4565 connect_to_endpoint


Any ideas as to why this was the case? Also hashing that out is liable to cause any problems?
I also started out with a decent hash rate of about 35000/hps running off 16 cores, for some reason Ubuntu VM wouldn't allow me to configure all 24 in settings! Why?

But anyway, after around 20/30minues my hash rate gradually started dropping off, it is now only running at about 40/hps and drops with every new set of transactions on each new block. My cpu is also now doing almost nothing, it was running upto 70%, now it is idling at around 4% use.. What is the reason for such behaviour?

Thanks

The loss of hash power could possibly have been due to lack of space on the VM, though it did appear to have enough space, a low space warning was given when exiting. I increased the VM size to 30GB, up from 20GB. Have re-run mining of Steemit, and has maintained a consistent 35000ish/hps for over 2 hours.

Though is there a way to stop the mining and then restart it without just closing the Terminal window? As this always causes a replaying of the Blockchain when I restart it, which is a pretty slow process.

  ·  8 years ago (edited)

you can press ctrl-c to stop the miner. you can then just run ./steemd again to restart it. As for the space, i noticed 30GB is better for a VM arrangement. At 20GB I also run out of space

  ·  8 years ago (edited)

did you mean "./steemd"? ... "./steemit" isn't recognised, and to my knowledge there isn't anything named steemit.

./steemd doesn't work any better, as it just loads up and then replays the blockchain, percent by percent and lists the hard-forks, which takes 20mins+, and that was after using the Ctrl-C to shutdown mining cleanly

corrected it. Yup. It can take a little bit of time to replay the blockchain, but should start back up

Thank you @cloh76 ! Really good, im up and running mining by just reading your post one time but i have one question. There is a web where i can see my stats or something like the blockchain working and my name surounded by graphics? You know what i mean, something to see if it is really working ;) Im very bad with programming, no idea what im seeing in my screen right now . Thanks in advance for the help you can give me and thanks a lot again for the good post, Cheers

Are you talking about https://steemd.com/@yourname

Well, yes something like that thanks a lot :) And maybe do u know why it says Mined = False? It seems that you already have a lot of experiences around the Steem-mining adventure :)

If you are using windows, it will show that. It will also show that if you have not yet mined a block

Thanks a lot again! Cheers and happy Steeming :)

I am trying to set up a miner on Ubuntu and I got as far as step 4, but step 4 and 5 aren't working. It is telling me that for --rpc-endpoint the command is not found. I am assuming that I am supposed to be issuing the command while in the steemd directory but I must be missing something.

yup. you should be in the steemd directory. You need to make sure you are typing ./steemd -- rpc-endpoint and not just --rpc endpoint. The executeable is ./steemd

I set up the mining in Windows. At the initial start I am getting a message that there is an error parsing logging config from the config file and that it is using the default config. Did I miss a step somewhere?

Also, how long does it normally take to get a proof of work which will show me that my mining does work? Thanks in advance

The blockchain link you have provided is not working. Please update the link.

  ·  8 years ago (edited)

Thank you, thank you, thank you .... for collecting and organizing all this information. I was just struggling to get a miner working by myself and you saved me another endless configuration session. GREAT WORK!!!!

Happy to help. I figured this would help others avoid the same issues I ran into when I first started as well. Just trying to pass on the experience I have gained and make it easier for new people to the Steemit community. Happy Steeming!

I started @steemit Aug ‘2016’ and have always heard that Mining STEEM was 0r is only possible via the Linux 0.S.🤔

Finding/reading this post appears to be a blessing and I say “appears” due to the first comment above by @khunfarang, stating that P0W-Mining is no longer feasible❓

If P0W is no more, how are ppl still able to mine STEEM via there computers, as I’m constantly hearing 0f ppl actually Mining via hardware❓

This is obviously an 0ld post, but still hope to get replies😁

Great w0rk@cloth7622208A98-7BE8-4CA5-B145-EA3F14A9699B.png