A guide on Mining Whive Rewards with your CPU

The Whive Protocol
5 min readApr 1, 2020

--

CPU Miner!

This is a Whive mining guide, compatible with Ubuntu, Raspbian(raspberry Pi os), Linux distros and Mac OS which also contains the cpu miner release for the Whive protocol.

Get 200 Whive Rewards for every Block you mine using the optimized Yespower algorithm whichfavours time-zones with higher solar reliability indexes.

This allows anyone with a CPU device to be able to run and mine without the need of powerful machines.

This makes the Whive Protocol efficient enough to run on a raspberry Pi and any other old types of CPU processors.

Today we share a step by step guide on how to set-up a Whive protocol node and miner:

1 Setting up the Whive Daemon (whived)

Go to our Github and Fork the GitHub repository and follow the steps shown below:

Repository: https://github.com/whiveio/whive.git

Supported Hardware: Desktops, laptops, Raspberry Pi 3 or 4, Odroid with linux or debian installation

1.1 For Ubuntu & Debian Operating Systems

We will install build and configuration packages with:

sudo apt-get install build-essential libtool autotools-dev automake pkg-config bsdmainutils python3 git

The next step is the installation of Boost libevent, and SSL libraries which Whive needs to operate:

sudo apt-get install libssl-dev libevent-dev libboost-system-dev libboost-filesystem-dev libboost-chrono-dev libboost-test-dev libboost-thread-dev

After a few moments, the operation will complete. We will also install two additional packages: ZMQ11 and libupnpc.

sudo apt-get install libminiupnpc-dev

sudo apt-get install libzmq3-dev

For GUI support let us install Qt libraries:

sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler

We will also install the library for QR code generation which is required for scenarios where we use QR codes instead of typing raw addresses, for example, when scanning addresses with mobile apps.

sudo apt-get install libqrencode-dev

Our last dependency installation is the curl dependency :

sudo apt-get install libcurl4-openssl-dev

To start our whive compilation and install, let’s begin by cloning the Whive repository

git clone https://github.com/whiveio/whive.git && cd whive

The final step is the installation of the Berkeley DB 4.8, which is mandatory for all scenarios that must have access to wallets. From within the whive directory type this command in your console

./contrib/install_db4.sh `pwd`

A lengthy installation procedure will start that will download BDB’s source code, configure it, and ultimately compile the binaries. Be patient, and don’t use your device for anything else to avoid slowing down the procedure. Ultimately, the installation script will finish with this message.

db4 build complete.

When compiling bitcoind, run `./configure` in the following way:

export BDB_PREFIX=’/home/ub20/whive/db4' (copy this output from your terminal we shall use it up ahead)

./configure BDB_LIBS=”-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS=”-I${BDB_PREFIX}/include”

Add the following line in you bash_profile

nano ~/.bashrc

and add this line at its end:

export BDB_PREFIX=’/home/ub20/whive/db4' (copy the output from your terminal)

Then Save changes with CTRL+O and ENTER, then close the nano editor with CTRL+X.Then do source .bashrc in your terminal to activate changes.

2 Building the source code for ALL Operating Systems:

$ cd whive

The next step we have to make is executing the autogen.sh script inside the whive directory.

./autogen.sh

Now we can execute the configuration script which will generate all the Makefiles we need to build a working Whive Client. This strategy simply saves some compilation time on our devices. We also decide to build a binary that doesn’t rely on dynamically linked libraries but instead integrates all of them into a single file.

./configure BDB_LIBS=”-L${BDB_PREFIX}/lib -ldb_cxx-4.8" BDB_CFLAGS=”-I${BDB_PREFIX}/include” — with-gui=qt — disable-tests — disable-bench — disable-shared

We’re now ready to compile Whive’s binaries.Now it’s time to kick off the compilation. For this, we use the make script, which we can tweak a bit by using the -j flag that allows us to define the number of CPU cores to be used during compilation.

make -j 2

After building the source code you can run the wallet as shown below:

$ ./whive/src/whive-qt (GUI)

$ ./whive/src/whived -daemon ( for commandline whive daemon)

2. Setting up the CPU Miner for Whived

2.1 Install dependencies

$ sudo apt install autoconf

$ sudo apt-get install build-essential libcurl4-openssl-dev

2.2 Compiling the miner

Building the source code:

$ git clone https://github.com/whiveio/cpuminer-mc-yespower.git

$ cd cpuminer-mc-yespower/

$ ./autogen.sh

$ ./configure

$ sudo make

Your outputs should look like this:

2.3 Mining

Before we proceed make sure you Whive daemon is running as illustrated below.

2.3.1 Then set up a whive.conf file in the $home/.whive directory

Whive.conf contents:

server=1

listen=1

txindex=1

rpcuser=whive

rpcpassword=pass

2.3.2 Fire up the miner:

Example of solo mining:

./minerd -a yespower -o http://127.0.0.1:1867 -u whive -p pass — coinbase-addr=YOUR_WHIVE_WALLET_ADDRESS

Congratulations!! You should now be able to earn some Whive Rewards.

Visit https://t.me/whiveIO for assistance on setting up your mining node.

--

--

The Whive Protocol

An #OpenSource #P2P 🔄 & Web³ 🕸️ Protocol using #CPUmining ⛏️ to drive 🌱 #GreenEnergy adoption via #TrustlessRewards 🎁 $WHIVE 🐝 #Blockchain ⛓️ #AI 🧠 #IoT💡