SWARM

SWARM is a management script for installing and managing a Hornet Node. It also provides the installation of a reverse proxy to allow access to the dashboard and API over HTTPS. Furthermore, there are additional functions for monitoring the node status, sync status, automatic updates and pruning the node database based on a specified memory size.

Requirements

  • VPS or Raspberry Pi with Ubuntu 20.04 LTS
  • Minimum 2 cores, 4GB RAM and 40GB SSD
  • Own domain or ddns service (no-ip.com)

Installation

1. Download SWARM using the installer

Code
curl -sL https://raw.githubusercontent.com/tanglebay/swarm/master/installer.sh | sudo bash -

Info: SWARM is always executed as root to have access to corresponding directories (Hornet/SWARM), as well as the service.


2. Confirm with YES that you want to start the installation


3. After SWARM has been downloaded and installed, you have the option to reboot the system. This is necessary to run SWARM with the command swarm. You can also continue without any problems and at your next system login the alias will take effect as well. In this example we choose NO.


After SWARM has been started, it is first checked whether all the necessary packages for SWARM are installed. Care has been taken to use as little additional software as possible (the following packages are required: ufw, curl, jq, nano, sponge, snap, go).

Configuration

SWARM offers a separate configuration for Hornet, Proxy and SWARM. These can be accessed via the respective menu. Special settings that are not available via the configuration of the SWARM configurations can be made, for example, for Hornet in the respective network configurations.
Important: In the case of automatic updates of Hornet, only the settings made in the configuration provided by SWARM are taken into account in a new configuration by Hornet.

Hornet.cfg

The Hornet.cfg offers you the possibility to make all important settings for your Hornet Node. These are always automatically adopted when Hornet is updated and are considered primary settings compared to the configuration files of Hornet, i.e. the Hornet.cfg configuration always overwrites the local configuration settings.

For each entry you will find a small explanation below, what it does and what it is good for.

Proxy.cfg

In the Proxy.cfg, you can simply store your own domain for the proxy. Either a personal domain is used for this or, as an example, a DDNS service.

SWARM.cfg

In SWARM.cfg all settings for SWARM itself, as well as for the plugins Watchdog and dbPruner are made.

Installation - Hornet

  1. Go to the Hornet menu (item 2 - main menu)
  2. Select 3) Hornet Installer in the menu
  3. Select 2) Install Hornet
  4. Select YES if you have already customized Hornet.cfg, otherwise select NO.
  5. Wait until the installation has been performed
  6. Now either go back to the Hornet menu to add neighbors or install the reverse proxy
  7. (OPTIONAL) Select 1) Hornet Configuration and then 3) Peering Config.
  8. (OPTIONAL) Enter your neighbors and then restart the node.
  9. Your node is successfully installed and should soon be synchronized with the network

Installation - Proxy

  1. Go to the main menu and select 3) Proxy Menu.
  2. In the proxy menu go to 1) Proxy Configuration.
  3. In the Proxy Configuration select the option 1) Edit proxy configuration.
  4. Go back to the Proxy Menu
  5. Now select 3) Proxy Installer in the proxy menu.
  6. Start the execution with 1) Install/Deploy the proxy.
    (Important! You must have adjusted the proxy.cfg before)
  7. Now enter your email address and confirm
  8. Accept the Terms of Service with a A and confirm
  9. Now enter N so that your email address is not shared for services
  10. Now select 1 or 2, the configuration will then be overwritten by SWARM
  11. Finally, your node URL will be displayed again

Plugin - Watchdog

  1. Go to the main menu and select 4) SWARM Menu.
  2. Now select 2) Manage Plugins in the SWARM menu.
  3. Now select 1) Manage Watchdog in the Manage Plugins.
  4. Activate or deactivate Watchdog now with the corresponding selection

You can get a direct status overview in the main menu with 1) SWARM Info.

Plugin - DBPruner

  1. Go to the main menu and select 4) SWARM Menu.
  2. Now select 2) Manage Plugins in the SWARM menu.
  3. Now select in the Manage Plugins 1) Manage DBPruner.
  4. Now activate or deactivate the DBPruner with the corresponding selection

You can get a direct status overview in the main menu with 1) SWARM Info.

Security

SWARM creates firewall rules directly for the installation of Hornet and the proxy. If you want to use other ports than the ones defined by default in the configuration, you have to do this before the installation.

SWARM also offers an option to activate the firewall. Follow the steps below to do this:

  1. Go to the main menu and select 4) SWARM Menu.
  2. Now select 2) Manage Security in the SWARM menu.
  3. Now select 1) Firewall in Manage Security
  4. Now enable or disable the firewall with the appropriate selection

Important note: When the firewall is activated, all incoming traffic that is not controlled by a rule in the firewall is also prevented. For the SSH connection, the currently configured SSH port (default=22) is taken from the SSH configuration. If you change the port, you have to change the rule accordingly. If you do not do this, you can lose access to your server.

SSH

Besides the firewall, special protection of SSH access is an important factor. Here you can find a list of instructions for the setup