Skip to main content

Hornet apt Repository (Linux-distro specific)

Hornet developers maintain the Hornet apt repository. It installs Hornet as a systemd service under a user called hornet.

Ubuntu/Debian#

  1. Import the public key that is used to sign the software release:

    wget -qO - https://ppa.hornet.zone/pubkey.txt | sudo apt-key add -
  2. Add the Hornet APT repository to your APT sources:

    sudo sh -c 'echo "deb http://ppa.hornet.zone stable main" >> /etc/apt/sources.list.d/hornet.list'
  3. Update apt package lists and install Hornet:

    sudo apt updatesudo apt install hornet
  4. Enable the systemd service:

    sudo systemctl enable hornet.service

You can find the Hornet configuration files under the /var/lib/hornet directory. You can find more details on how to configure Hornet in the post installation chapter.

You can find the Environment file to configure multiple default parameters under the /etc/default/hornet directory.

Start the node#

You can use the systemd service to start running Hornet on the Mainnet by running the following command:

sudo service hornet start

Managing the Node#

Displaying log output#

You can display the nodes logs by running the following command:

journalctl -fu hornet
  • -f: instructs journalctl to continue displaying the log to stdout until CTRL+C is pressed
  • -u hornet: filter log output by user name

Restarting Hornet#

You can restart hornet by running the following command:

sudo systemctl restart hornet

Stopping Hornet#

You can stop hornet by running the following command:

sudo systemctl stop hornet
info

Hornet uses an in-memory cache. In order to save all data to the underlying persistent storage, it is necessary to provide a grace period of at least 200 seconds while shutting it down.

You can find more details on how to configure Hornet in the post installation chapter.

Pre-built Binaries

There are several pre-built binaries of Hornet for major platforms available including some default configuration JSON files.

info

We consider this as an advanced installation method for production use as you will have to prepare a system environment in order to run the executable as a service (in daemon mode), using systemd or supervisord.

  1. Download the latest release compiled for your system from GitHub release assets:

    curl -LO https://github.com/gohornet/hornet/releases/download/v1.0.5/HORNET-1.0.5_Linux_x86_64.tar.gz

    Please make sure to download the binaries for your system:

    • HORNET-X.Y.Z_Linux_x86_64.tar.gz: standard 64-bit-linux-based executable, such as Ubuntu, Debian, etc.
    • HORNET-X.Y.Z_Linux_arm64.tar.gz: executable for Raspberry Pi 4.
    • HORNET-X.Y.Z_Windows_x86_64.zip: executable for Windows 10-64-bit-based systems.
    • HORNET-X.Y.Z_macOS_x86_64.tar.gz: executable for macOS.
  2. Extract the files in a folder of your choice (for example /opt on Linux):

    tar -xf HORNET-1.0.5_Linux_x86_64.tar.gz
  3. Once you have extracted the files, you get a main executable file. You can also find sample configuration JSON files available in the archive (tar or zip).

You can run Hornet using --help to get all executable-related arguments by running:

./hornet --help

You can double-check that you have version 0.6.0+ deployed by running:

./hornet --version

You can run Hornet using default settings by running:

./hornet

If you are using this method, you will have to make sure the executable runs in a daemon mode, for example using systemd.

info

Hornet uses an in-memory cache. In order to save all data to the underlying persistent storage, it is necessary to provide a grace period of at least 200 seconds while shutting it down.

You can find more details on how to configure Hornet under the post installation chapter.

Example of Systemd Unit File#

The following is an example of a systemd unit file. If you have extracted the Hornet executable to /opt/hornet together with configuration files, this file should work as is. If you have extracted the Hornet executable in another location, please review the configuration and update it accordingly.

[Unit]Description=HornetWants=network-online.targetAfter=network-online.target
[Service]StandardOutput=syslogStandardError=syslogSyslogIdentifier=hornetPrivateDevices=yesPrivateTmp=yesProtectSystem=fullProtectHome=yes
User=hornetWorkingDirectory=/opt/hornetTimeoutSec=1200Restart=alwaysExecStart=/opt/hornet/hornet
[Install]WantedBy=multi-user.target

Build From Source

info

We consider this as an advanced installation method for production use as you will have to prepare a system environment in order to run the executable as a service (in daemon mode), using systemd or supervisord.

  1. Install Go:

You can find installation instructions in the official Go documentation.

  1. Install dependencies: Git and build-essentials:

    sudo apt updatesudo apt install git build-essential
  2. Check the golang/git version:

    go versiongit --version

    Make sure you have the latest version from https://golang.org/dl/

  3. Clone the Hornet source code from GitHub:

    git clone https://github.com/gohornet/hornet.git && cd hornet
  4. Build the Hornet:

    ./scritps/build_hornet_rocksdb_builtin.sh
    • This command will build Hornet based on the latest commit from the currently chosen branch.
    • This may take a couple of minutes.
  5. Once it is compiled, then the executable file named hornet should be available in the current directory. You can check the version by running:

    ./hornet --version

    Example of version:

    HORNET c37bbe0f

    For self-compiled binaries, the version is the short commit sha, which you can use to check which commit the given version is compiled against.

You can run Hornet using --help to get all executable-related arguments by running:

./hornet --help

You can double-check that you have version 0.6.0+ deployed by running:

./hornet --version

You can run Hornet using default settings by running:

./hornet

Using this method, you have to make sure the executable runs in a daemon mode using for example systemd.

info

Hornet uses an in-memory cache. In order to save all data to the underlying persistent storage, it is necessary to provide a grace period of at least 200 seconds while shutting it down.

See more details on how to configure Hornet under the post installation chapter.

Example of Systemd Unit File#

The following is an example of a systemd unit file. If you have extracted the Hornet executable to /opt/hornet together with configuration files, this file should work as is. If you have extracted the Hornet executable in another location, please review the configuration and update it accordingly.

[Unit]Description=HornetWants=network-online.targetAfter=network-online.target
[Service]StandardOutput=syslogStandardError=syslogSyslogIdentifier=hornetPrivateDevices=yesPrivateTmp=yesProtectSystem=fullProtectHome=yes
User=hornetWorkingDirectory=/opt/hornetTimeoutSec=1200Restart=alwaysExecStart=/opt/hornet/hornet
[Install]WantedBy=multi-user.target