Search

Saturday, December 16, 2017

Easy Bitcoin Mining on CentOS 7 and Ubuntu 17 for the curious | cpuminer-multi and slushpool

Supratim Sanyal's Blog: Bitcoin Mining Howto - Slushpool Screenshot


Be informed

Mining cryptocurrency bitcoins: for me, an exercise in satisfying curiosity. You cannot make any real bitcoin money any more using spare CPU cycles on your home computers manipulating blockchains.

If you are serious about mining bitcoins, invest in a modern ASIC based miner.

Otherwise, if you are like me, play around a bit with bitcoin mining and then go back to your boinc daemons for SETI@HOME and LHC@HOME and contribute your CPU cycles to where it matters more for advancing the human species.

Installing cpuminer-multi (Linux - CentOS and Ubuntu)

cpuminer-multi should be run from a user account (never as root).

Install the necessary packages

CentOS 7

$ sudo bash
# yum groupinstall "Development Tools"
# yum install curl-devel openssl-devel git screen
# exit
$ cd


Ubuntu 17

$ sudo apt-get install build-essential autotools-dev autoconf libcurl3 libcurl4-gnutls-dev git screen libssl-dev


Raspbian Stretch (Raspbian GNU/Linux 9)

$ sudo apt-get install build-essential autotools-dev autoconf libcurl3 libcurl4-gnutls-dev git screen libssl-dev libjansson-dev


Clone and build cpuminer-multi

CentOS 7, Ubuntu 17 and Raspbian Stretch

$ git clone https://github.com/tpruvot/cpuminer-multi.git
$ cd cpuminer-multi
$ ./autogen.sh
$ ./configure CFLAGS="-march=native" --with-crypto --with-curl
$ ./build.sh
$ cd

Join a pool

Sign up with slushpool and get worker details for your computer. You can have different workers for different computers if you so wish. Basically you need a "miner login" (not the same as your slushpool account login) for your worker. This is of the form "yourusername.Worker1" and can be obtained by adding a worker.

Launch cpuminer in a dedicated screen

Use a shell script in your home directory to launch cpuminer with your slushpool worker. Nice it down if your server is doing other more important stuff; cpuminer will happily take up all of your available processing power.

The "password" does not matter here; it is not used.

Change it for your worker unless you want to mine for me.

cpuminer_in_screen.sh

#!/bin/bash
#
# Run niced down cpuminer in screen
#
screen -S cpuminer -m -d nice ~/cpuminer-multi/cpuminer -a sha256d -o stratum+tcp://us-east.stratum.slushpool.com:3333 -O tuklu_san.MyPublicMiner:password
screen -ls

Make the script executable:

$ chmod +x cpuminer_in_screen.sh

and launch it:

$ ./cpuminer_in_screen.sh

Attach to the screen "cpuminer":

$ screen -r cpuminer

You should see something like this:

** cpuminer-multi 1.3.3 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)

[2017-12-14 13:18:46] Starting Stratum on stratum+tcp://us-east.stratum.slushpool.com:3333
[2017-12-14 13:18:46] 2 miner threads started, using 'sha256d' algorithm.
[2017-12-14 13:18:46] Stratum difficulty set to 2048
[2017-12-14 13:18:46] sha256d block 499253, diff 1590896927258.079
[2017-12-14 13:18:48] CPU #0: 1207 kH/s
[2017-12-14 13:18:48] CPU #1: 1197 kH/s
...
...


Detach from the screen using Ctrl-a, d. Watch your slushpool account for progress.

Payouts

You will need to set a bitcoin wallet number in your slushpool account to receive payouts if you ever get to that point. I already had a coinbase account with a bitcoin wallet number that I used for this purpose. 

It is just an experiment

I do not expect anything to really happen in terms of payouts. My slushpool dashboard says I will complete mining one-tenth of a bitcoin in another 79 years and some months.

Once again, if you are serious, invest in a modern ASIC based miner. Be aware, though, of the fact that the vendors of these ASIC bitcoin miner hardware are making more money selling them than folks actually making money off bitcoin mining. Also, as you will see if you research a bit, the amount of money you will pay your electric utility company will be more than you make mining bitcoins.

Have fun!


No comments:

Post a Comment

"SEO" link builders: move on, your spam link will not get posted.

Note: Only a member of this blog may post a comment.

Recommended Products from Amazon