Recently, I decided to upgrade my Chives farm and I encountered the dreaded lack of available SATA port problem. To remedy this, I figured that I would attempt to use my HiveOS mining rigs as harvesters. Not only would this give me access to many unused SATA ports, it will also save me money by not having to expand my existing farmer’s storage capabilities. Below is a short tutorial of how I accomplished this.
Disclaimer: this is an installation of a harvester ONLY and must be connected to an existing farmer. SSH access to both machines is required. You will also need the main farmer’s mnemonic and a copy of the ‘ca’ directory from (.chives/mainnet/config/ssl/ca). While this does install the Chives software on HiveOS, it does NOT use any of the Hive’s reporting back to the mobile app or the web dashboard. For farm monitoring, I suggest using the NPM package chives-dashboard-satellite.
For starters, open an SSH terminal to the HiveOS rig. I began by creating a new user and added to the sudoers group with the following commands:
adduser YourNewUserName
usermod -aG sudo YourNewUserName
Now close that SSH session and open a new one as the user that was just created. This will verify that you created the user successfully. We’ll begin to install the necessary packages with these commands:
sudo apt update
sudo apt install python3.7-venv python3.7-distutils python3.7-dev git lsb-release -y
Note: the above install command might throw an error about missing/broken packages. If so, run the following command then retry the above.
sudo apt update --fix-missing
Clone the Chives git repository, open the directory, and begin installation:
git clone https://github.com/HiveProject2021/chives-blockchain.git
cd chives-blockchain/
sudo sh install.sh
To see if Chives was installed correctly, type the following commands to verify. :
. ./activate
chives -h
The activate command will change the command prompt. It should now begin with (venv). The next command ‘chives -h’ will display the help text if everything was installed correctly. Note: if you ever need to exit (venv) mode, just type “deactivate” or to re-enter type “. ./activate”
Now we need to initialize Chives and set the mnemonic seed phrase. While still in (venv) mode, type the following:
chives init
chives keys add
After typing “chives keys add” you’ll be prompted to enter the mnemonic of your existing farmer. Enter the mnemonic exactly as it is on your farmer or this will not work correctly.
If you haven’t done so already, log in to your main farming machine. Here you will need to get two things: a copy of the “ca” directory and the IP address of the farmer.
The “ca” directory can be found in .chives/mainnet/config/ssl/ca. For Ubuntu, the .chives directory will be in the “home” directory or the main “users/username” directory in Windows.
The IP address can be found by opening the terminal and typing one of the following commands.
ip a (for Linux)
ipconfig (for Windows)
Make note of the IP address (usually something like 192.168.1.xxx). I also recommend using a USB drive to copy the ‘ca’ directory and writing down.
Now that you have all that, go back to the Hive/harvester machine and insert the USB. Most likely you’ll have to create a mount point and mount the drive. When you do, make note of the absolute path to the “ca” directory. Run the following commands to stop all Chives processes and init the SSL certs with the “ca” directory:
chives stop all -d
chives init -c /absolute/path/to/the/directory/ca
This should output text indicating that it updated several SSL certificates. This is needed to secure the connections need for the harvester and farmer.
Now we need to update the config.yaml file so that it’ll direct the harvester to communicate with the farmer on the local network. Using your prefered text editor, open the file .chives/mainnet/config/config.yaml. Here is where it gets a little tricky as there are two sections that are similar. Look for the section that is exactly like this (around line 170-ish):
harvester:
chives_ssl_ca:
crt: config/ssl/ca/chives_ca.crt
key: config/ssl/ca/chives_ca.key
farmer_peer:
host: localhost
port: 9647
You want to change the word localhost to the IP address of your farmer. For instance, if the IP address is 192.168.1.162, it will look like this:
harvester:
chives_ssl_ca:
crt: config/ssl/ca/chives_ca.crt
key: config/ssl/ca/chives_ca.key
farmer_peer:
host: 192.168.1.162
port: 9647
Close and save the file. Go back to the terminal and type the following to start the Chives harvester:
chives start harvester -r
If done successfully, it will indicate that the harvester is started. To verify that it’s connected to the farmer, go to the farmer and open Chives. Click the Farm tab on the left and scroll all the way down. Click on the “Show Advanced Options” text to open “Your Harvester Network” In there you should see and entry with the IP 127.0.0.1 (Farmer) and another with the IP address of the Harvester.
Now you have a fully functional harvester on your HiveOS rig. Once you have an HDD plotted and connected, don’t forget to add the plots directory with the following command:
(venv) chives plots add -d /path/to/plots
Once you do so, the farmer will recognize the drives connected to the harvester and include the plots in the Plot Count.
FYI, you will have to restart the harvester after every reboot with the following:
cd chives-blockchain/
. ./activate
chives start harvester -r
You may also have to remount the additional HDDs after a reboot or you could research how to automatically do so using the fstab file.
So far I haven’t noticed any issues with Hive or the mining on my rig. The rig I’m running on is an R9-3900x in a B450M board. It is both CPU and GPU mining and has plenty of resources to run everything including the harvester.