How can I set up the hiveNet Agent on my Linux server?

This guide walks you through the process of installing and configuring the hiveNet Agent for servers, enabling you to contribute storage space to the hiveNet and earn storage space for your hiveDisk account.

Why use hiveNet Agent for servers?

The hiveNet Agent allows you to contribute your unused storage space to hiveNet. By doing this, you not only support the hiveNet ecosystem but also earn storage space that can be used with your hiveDisk account on different devices. It's particularly suitable for servers, NAS, or other systems where the traditional hiveDisk desktop application might not be ideal.

Getting Started:

Prerequisites:

You need a Hive user account. If you don't have one, sign up at hivenet.com.


Step 1: Install the hiveNet Agent

Download the Archive based on your processor architecture. You can find the latest download commands on our Downloads page.


Extract the Files:

    • For amd64: tar -xvzf hive-disk-1.16.4_linux-amd64.tar.gz

    • For arm64: tar -xvzf hive-disk-1.16.4_linux-arm64.tar.gz

Move and Set Permissions:

sudo cp hive-agent /usr/local/bin/hive-agent
sudo chmod 755 /usr/local/bin/hive-agent

Verify Installation:

hive-agent version

Step 2: Configure the hiveNet Agent

Setup Configuration File:

    • Create a config.yaml file in your ~/.hive directory with the command:

      • hive-agent config init or copy the content provided.

or copy the content below:

class: user
uploadplanelistenaddress: 0.0.0.0
uploadplanelistenport: 4443
uploadplaneprivatekey: MIIEowIB...ZuYFDLBYAaIQ5tWQ
uploadplanenodeid: QmVoN4xH9...pbZDqa1
ipfsnodeprivatekey: CAAS...b4GVQ==
ipfsnodeid: Qmf...EL
peerselectiontimeout: 2
loglevel: DEBUG
logrotationsize: 10
logrotationdays: 1
datalocation: ~/.hive

Important: Do not modify this file unless specifically instructed by support or as detailed in this documentation.

  • Validate Configuration by running the code:
    • Run hive-agent config validate

Set Contribution Path: If you want to contribute from a specific directory, modify the datalocation field in the config.yaml file to your preferred path. Ensure the user operating the hive-agent has appropriate permissions for this directory.


Step 3: Start Contributing

1. Launch the hive-agent daemon, specifying the space in GB you'd like to offer (at least 5 GB). Replace 'XX' with your contribution amount:


    • hive-agent contribute XX

2. Follow the on-screen instructions to complete the authentication challenge.

Important: Authentication Process Clarification

After running the command, the terminal will attempt to launch a browser session to link the hiveNet Agent with your Hive account. If you're using a headless Linux environment or a setup without a browser installed, the session will not launch automatically.

In such cases, carefully observe the terminal output. It will provide a URL for authentication. Manually copy this URL and open it on an alternative device with browser access, like your smartphone or another computer. This step is crucial to successfully authenticate and link your agent.

3. After authentication, a refresh token will be encrypted and saved in your ~/.hive directory. You won't have to re-authenticate in the future.

4. To confirm a successful startup, look for the message: Agent started in: XXXXms in the logs.



Congratulations! By following these steps, you are now an integral part of the hive network, actively offering your storage space to the network.