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
Import the public key that is used to sign the software release:
wget -qO - https://ppa.hornet.zone/pubkey.txt | sudo apt-key add -
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'
Update
apt
package lists and install Hornet:sudo apt update
sudo apt install hornetEnable the
systemd
service:sudo systemctl enable hornet.service
You can find the Hornet configuration files under the /var/lib/hornet
directory. You can also find more details on how to configure Hornet in the post installation article.
Additionally, the Environment file for configuring multiple default parameters can be found 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
: instructsjournalctl
to continue displaying the log to stdout until CTRL+C is pressed-u hornet
: filters the 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
Hornet uses an in-memory cache. To save all data to the underlying persistent storage, a grace period of at least 200 seconds for shutting down is required.
You can find more details on how to configure Hornet in the post installation article.
Pre-built Binaries
There are several pre-built binaries of Hornet for major platforms available including some default configuration JSON files.
All installation methods mentioned in this article from this point should be considered advanced for production use as you will have to prepare a system environment to run the executable as a service (in daemon mode), using systemd
or supervisord
.
Download the latest release compiled for your system from GitHub release assets:
curl -LO https://github.com/iotaledger/hornet/releases/download/v1.2.2/HORNET-1.2.2_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 64bit ARM based systems.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.
Extract the files in a folder of your choice (for example
/opt
on Linux):tar -xf HORNET-1.2.2_Linux_x86_64.tar.gz
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
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=Hornet
Wants=network-online.target
After=network-online.target
[Service]
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=hornet
PrivateDevices=yes
PrivateTmp=yes
ProtectSystem=full
ProtectHome=yes
User=hornet
WorkingDirectory=/opt/hornet
TimeoutSec=1200
Restart=always
ExecStart=/opt/hornet/hornet
[Install]
WantedBy=multi-user.target
Build From Source
- Install Go:
You can find installation instructions in the official Go documentation.
Install dependencies:
Git
andbuild-essentials
:sudo apt update
sudo apt install git build-essentialCheck the golang/git version:
go version
git --versionMake sure you have the latest version from https://golang.org/dl/.
Clone the Hornet source code from GitHub:
git clone https://github.com/iotaledger/hornet.git && cd hornet && git checkout mainnet
Build the Hornet:
./scripts/build_hornet_rocksdb.sh
- This command will build Hornet based on the latest commit from the currently chosen branch.
- This may take a couple of minutes.
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
.