Guide for Linux
Getting Hydra up and running on your Linux system

Setup for Ubuntu 20.04 (Instructions for Aarch64 and 18.04 below)

Here is a script for Ubuntu 20.04 that you can download and run for quick setup. It has been tested to run on new ubuntu 20.04 installations. It will do all the commands for you that are below and then execute the Daemon. (skip to Step 5 once installation is complete. If you prefer to set up HYDRA manually proceed to Step 1 instead) From the terminal paste this command:
1
wget -O - https://raw.githubusercontent.com/meshungina/hydra/main/install-run-gui-wallet.20.04.sh | bash
Copied!

Step 1.

Since Bitcoin PPA repository does not have a Release for Focal Fossa yet, we will need to do a few extra things.
First, make the command to update your system:
1
sudo apt update
Copied!
And now let’s upgrade if you have packages to be upgraded:
1
sudo apt upgrade -y
Copied!
Now let’s install the required packages.
1
sudo apt install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev libzmq3-dev
Copied!
Now:
1
sudo apt install software-properties-common
Copied!
Let’s compile! First let’s make a folder to compile the leveldb.
First let’s return to our home folder:
1
cd ~
Copied!
Now create a new folder:
1
mkdir dev
Copied!
Enter to the folder and get the source of leveldb:
1
cd dev
2
wget -N http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz
Copied!
Now we’ll decompress:
1
tar -xvf db-4.8.30.NC.tar.gz
Copied!
If you try to compile now you’ll get an error. Let’s bypass the bug:
1
sed -i s/__atomic_compare_exchange/__atomic_compare_exchange_db/g db-4.8.30.NC/dbinc/atomic.h
Copied!
Now let’s enter to the folder, create a build folder, and configure everything to compile:
1
cd db-4.8.30.NC/build_unix
2
mkdir -p build
3
BDB_PREFIX=/usr/local
4
../dist/configure --enable-cxx --prefix=$BDB_PREFIX
Copied!
After these commands lets make and install the leveldb 4.8:
1
make
2
sudo make install
Copied!

Download these final packages

1
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode
Copied!
You’re now ready to continue to STEP 2 below.

Ubuntu 18.04

Here is a script for Ubuntu 18.04 that you can download and run for quick setup. It has been tested to run on new ubuntu 18.04 installations. It will do all the below commands for you, and then execute the GUI. From the terminal do these two commands: (If you prefer manual installation you can skip this part.)
1
wget -O - https://raw.githubusercontent.com/meshungina/hydra/main/install-run-gui-wallet.18.04.sh | bash
Copied!

Before starting ensure that your system is up to date and has all required packages by executing:

1
sudo apt-get install build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils git cmake libboost-all-dev libgmp3-dev
2
sudo apt-get install software-properties-common
3
sudo add-apt-repository ppa:bitcoin/bitcoin
4
sudo apt-get update
5
sudo apt upgrade
6
sudo apt-get install libdb4.8-dev libdb4.8++-dev
7
sudo apt-get install libqt5gui5 libqt5core5a libqt5dbus5 qttools5-dev qttools5-dev-tools libprotobuf-dev protobuf-compiler qrencode
Copied!

Step 2 - Download

Select the latest wallet version from the link below:
Here you will find wallets for different types of operating systems. You will need to download the right one for your device. Please differentiate among the following builds:
Create a directory called Hydra and place the zipped file in it:
1
mkdir ~/Hydra
2
cd ~/Hydra
Copied!

For 20.04

1
wget -N https://github.com/Hydra-Chain/node/releases/download/hydra_v0.18.5.6/hydra-0.18.5.6-ubuntu20.04-x86_64-gnu.zip
Copied!
For 18.04
1
wget -N https://github.com/Hydra-Chain/node/releases/download/hydra_v0.18.5.6/hydra-0.18.5.6-ubuntu18.04-x86_64-gnu.zip
Copied!

For Aarch64

1
wget -N https://github.com/Hydra-Chain/node/releases/download/hydra_v0.18.5.6/hydra-0.18.5.6-aarch64-linux-gnu.zip
Copied!
Make sure to replace the above link with the one that matches your device and that it is the newest version available.

Step 3 - Unzip

Unzip the Hydra build. It will unzip to ~/Hydra/bin/
Your zip file may be named differently, depending on the required version
1
unzip -o hydra-0.18.5.6-ubuntu20.04-x86_64-gnu.zip
Copied!

Step 4 - Copy config file

Note: For the current Hydra testnet you will also need to copy the latest hydra.conf file from the zip and place into the /.hydra/ folder. This is a different directory from ~/Hydra. Notice there is a dot before the name and it is lower case.
Create ~/.hydra folder then and copy the hydra.conf from the current directory into it.
1
mkdir ~/.hydra
2
cp ~/Hydra/hydra.conf ~/.hydra
Copied!
You can now navigate back to where the Hydra binaries are to initialize them:
1
cd ~/Hydra/bin/
Copied!

Step 5 - Run

The Hydra binaries will then be in ~/Hydra/bin/ where you can cd into with
1
cd ~/Hydra/bin/
Copied!
Either run the command-line Hydra daemon (omit '-testnet' if you want to connect to mainnet):
1
./hydrad -daemon -testnet
Copied!
and call the Hydra daemon using (omit '-testnet' if you are connected to mainnet):
1
./hydra-cli -testnet getinfo
Copied!
Or you can run the Hydra GUI (omit '-testnet' if you want to connect to mainnet):
1
./hydra-qt -testnet
Copied!

Getting information through the cli

Retrieve general wallet information such as coin,token balance and expected staking time

You can view your Coin balance and amount currently staked as well as other general information about your wallet with the following command:
1
./hydra-cli getwalletinfo
Copied!

Retrieving your LOC token balance through the cli:

To see our wallets token balance, first we'll need to find out the HEX equivalent of our address. We can do this through the cli with this command:
1
./hydra-cli gethexaddress <YOURADDRESS>
Copied!
We can then call the contract with the "getbalance" identifier appended, which is 70a08231 and replacing the last part with your own hex address here:
1
./hydra-cli callcontract 4ab26aaa1803daa638910d71075c06386e391147 70a08231000000000000000000000000<YOURHEXADDRESS> | grep -e "output"
Copied!
Finally convert the "output" section of the response from hex to decimal to arrive at your LOC balance.
1
echo $((0x<YOUROUTPUT>))
Copied!
Below is a full example:
token balance
Keep in mind to adjust for 8 decimal places. Balance above is 64,172.22773141

Time until expected block creation

To see expected time enter the following command:
1
./hydra-cli getstakinginfo
Copied!
Note below the section "expectedtime".
The "expectedtime" can be converted to human readable format using the following command (replace 351955with your expectedtime value:
1
secs=351955 && echo $(($secs/86400))d $(($(($secs - $secs/86400*86400))/3600))h:$(($(($secs - $secs/86400*86400))%3600/60))m
Copied!

Linux Firewall settings

The node runs on port TCP 13333 for the Hydra testnet and port TCP 3338 for the mainnet. You may need to open the port on your router and operating system. By default Ubuntu comes with UFW firewall but it is inactive so all ports will be open. To activate the firewall and open these ports type 'sudo ufw allow 13333' for testnet and 'sudo ufw allow 3338' for mainnet and then enable the firewall with 'sudo ufw enable'. If you are using SSH to connect to your server you will need to open that port as well as any other ports you need access to. If you are using a home router you will need to find out the ip address of your computer and then adjust port forwarding on your router to allow these ports. A simple way to find out your IP is to type ip addr show and your IP should be displayed so you can add it to your router's port forwarding page.

Links

The Webwallet can be found at: https://webwallet.hydrachain.org/
The Testnet Explorer can be viewed at: https://testexplorer.hydrachain.org/
The Testnet Faucet is at: https://faucet.hydrachain.org/
The Mainnet Explorer can be viewed at: https://explorer.hydachain.org/
Last modified 3mo ago