How to Build Hydra on Raspbian
Hydra is capable to run on small devices, it requires quite little CPU power, memory and storage to mine coins. But the binaries released by Hydra official are not suitable for Raspberry Pi Zero or First Generations. Here is a tutorial on how to build Hydra on a raspi. In this tutorial, we assume that you are using a raspbian system.

System Requirements

Generally, a raspi is capable to build Hydra, but we need:
    an SD card with at least 8G space and at least 6G available;
    Internet connection is also required.

Memory Requirements

Hydra requires quite few memory to run. However it is not true for building Hydra. It requires over 1.5G memory to build, which is much more than a raspi has. So we have to set the swap space to 2G:
1
2
sudo sed -ri 's/CONF_SWAPSIZE=[0-9]+/CONF_SWAPSIZE=2048/' /etc/dphys-swapfile
3
sudo systemctl restart dphys-swapfile
Copied!

Build Process

Install Dependencies

We cat install building tools and most dependencies with apt:
1
# install dependencies
2
sudo apt-get install git autoconf libtool libboost-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-chrono-dev libboost-random-dev libssl-dev libevent-dev libboost-test-dev
Copied!
If you need the Qt GUI, additionally run:
1
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode
Copied!

Prepare Building Folder

1
mkdir build_Hydra
2
cd build_Hydra
Copied!

Build Berkeley DB Dependency

Unfortunately we can't install Berkeley DB 4.8 dependency on a raspbian via apt, so we need to build it ourselves:
1
# to build berkeley db 4.8
2
wget http://download.oracle.com/berkeley-db/db-4.8.30.tar.gz
3
tar -xzf db-4.8.30.tar.gz
4
pushd db-4.8.30/build_unix
5
../dist/configure --prefix=/usr/local --enable-cxx
6
make # this would take around 50 minutes on a raspi 0 W
7
sudo make install
8
popd
Copied!

Build Hydra

First we have to get the source:
1
git clone https://github.com/Hydra-Chain.git --recursive HYDRA
2
cd HYDRA
Copied!
Then we should switch to a stable release tag, for now the latest release for Hydra is mainnet-ignition-v0.17.5, but you should always build a latest one.
1
git checkout mainnet-ignition-v0.17.5
Copied!
Then init submodules:
1
git submodule update --init --recursive
Copied!
Finally the most common way to build and install a software:
1
./autogen.sh
2
./configure
3
make
4
sudo make install
Copied!
It is highly recommended that you run the make step inside a virtual console like screen or tmux because the step takes more than 20 HOURS. By using a virtual console, you don't need to keep the ssh session during its building. To do this, run these commands before make:
1
sudo apt-get install screen
2
screen -S build
Copied!
And when you started making, you may leave the screen by pressing Ctrl + A then D, and you may go back to it with this command:
1
screen -R
Copied!
Boom! Now you have Hydra installed on your raspi!
Last modified 7mo ago