Skip to content

Skywire Binary Installation

Moses Narrow edited this page Mar 8, 2024 · 3 revisions

Skywire Binary Installation Guide

Introduction

What comprises a software installation? The answer to this question varies depending on the user and the operating system, and the matter is one of some contention between developers.

A software installation, as the product of the process of software installation, is the resultant state of a computer system after the successful deployment and configuration of a software program or application onto the target computing environment.

The software installation describes an end, not a means to that end. This brings us to the next important question.

What is the correct way to install this software on my system? The answer to this question varies based on the operating system. It's important to install software the correct way for your operating system.

With that said, this guide is no longer recommended to follow for new installations. Refer to the package installation guide for linux or the release section for macOS / windows.

This guide is intended to be used for installing the Skywire software using the compiled binary executable files (minimum version 0.5.1) provided in the Skywire Release Section

Furthemore, instructions on how to setup the systemd services are included. The systemd service for skywire allows the process to start automatically after rebooting the board.

We also outline some necessary prerequisites for some SBCs (single board computer) models like the Raspberry Pi for this guide.

We used a Raspberry Pi to create this guide but all steps can be done on other board types as well if the prerequisites are guaranteed.

Prerequisites

In order to install Skywire, ensure that the following prerequisites are present:

  • Armbian or Raspbian has been flashed on the micro SD card of the board. You can find the Armbian image here and the latest Raspbian image here.
  • To enable SSH on Raspbian, an extra step is necessary: creating an empty file named SSH.txt on the /boot partition after flashing the Raspbian image on the micro SD card. Only once that's done must the micro SD card be inserted into the board.
  • The board is running properly using either the Armbian or Raspbian image.
  • The board is connected to a router/switch within your home network + the board's IP address is known. You can use the DHCP lease page of your router or an IP subnet scan tool like Nmap/Zenmap or IP scanner etc. to obtain the board's IP address.

Installation

Log into your board via SSH using either PuTTY if you're using Windows, or the regular terminal if you're a Mac/Linux user.

The terminal command to use SSH for Mac/Linux users is: ssh username@YOURBOARDIP:

  • where YOURBOARDIP must be replaced with the previously obtained IP of your board.
  • and username must be replaced with the actual username: the default username and password for Raspbian is pi (password raspberry) and for Armbian it's root (password 1234).

First thing you need to do is to create the folders /var/skywire-visor and a temp folder in /tmp /tmp/bin:

	sudo mkdir -p /etc/skywire-visor
	
	sudo mkdir -p /tmp/bin

Next, download the latest version of the skywire-mainnet package using the following command in the /tmp folder.

NOTICE that for different architecture boards you need to download the appropriate package build, for example on Raspberry Pi we need the ...linux-arm.tar.gz while on an Orange Pi PC2 we would need ...linux-arm64.tar.gz file. If you are unsure on what architecture your board is based on, please ask in the Skywire Mainnet channel on Telegram.

	sudo curl -L https://github.com/skycoin/skywire/releases/download/v0.5.1/skywire-v0.5.1-linux-arm.tar.gz > /tmp/skywire.tar.gz 

Extract the downloaded package in the /tmp/bin folder and remove the unnecessary files:

	sudo tar xvzf /tmp/skywire.tar.gz -C /tmp/bin

	sudo rm -rf /tmp/bin/*.md

Install the extracted files from /tmp/bin/ to /usr/bin/:

	sudo install -Dm755 /tmp/bin/skywire-cli /usr/bin/
	sudo install -Dm755 /tmp/bin/skywire-visor /usr/bin/
	sudo install -Dm755 /tmp/bin/apps/skychat /opt/skywire/apps/
	sudo install -Dm755 /tmp/bin/apps/skysocks /opt/skywire/apps/
	sudo install -Dm755 /tmp/bin/apps/skysocks-client /opt/skywire/apps/
	sudo install -Dm755 /tmp/bin/apps/vpn-server /opt/skywire/apps/
	sudo install -Dm755 /tmp/bin/apps/vpn-client /opt/skywire/apps/

If you want to expose the hypervisorUI on the board, run

	sudo /usr/bin/skywire-cli config gen -ipro /opt/skywire/skywire-config.json

NOTE:: The board running with a config generated with the above command will be called the hypervisor board and the program exposing the hypervisorUI will be called hypervisor in this guide. The only difference between a visor and a hypervisor is that the hypervisor exposes a WebUI that can be used to manage other visors.

If you only want to run the visor generate the visor config file:

	sudo /usr/bin/skywire-cli config gen -pro /opt/skywire/skywire-config.json

Add the hypervisor public key to each visor config file. This is necessary to that the boards connect to the hypervisor and appear in the hypervisor UI.

The hypervisor public key can be found in the config file of the visor generated with the -i or --is-hypervisor flag. Simply print it using the skywire-cli visor pk command.

	skywire-cli visor pk -i /opt/skywire/skywire-config.json

Copy this public key and regenerate your visor config using it

	skywire-cli config gen --hypervisor-pks 924b125136a9eeac0ceb079005846e02500d26129e073ef0d913bcd364795e8377 -pro /opt/skywire/skywire-config.json

Substituiting your hypervisor key for the one above.

That's it, the installation and configuration is done. The next step is to create & enable the systemd services so that the hypervisor & visor processes start automatically upon reboot.

Systemd Service

Now that we have our hypervisor and visors all set up, we have to continue with the systemd services.

Create the systemd service:

sudo nano /etc/systemd/system/skywire-visor.service

paste the following into the editor

[Unit]
Description=Skywire Visor
After=network.target

[Service]
Type=simple
User=root
Group=root
ExecStart=/usr/bin/skywire-visor -c /opt/skywire/skywire-config.json
Restart=on-failure
RestartSec=20
TimeoutSec=30

[Install]
WantedBy=multi-user.target

do ctrl+X save and then exit

Next, we need to enable the systemd service(s).

To enable and start the skywire-visor.service systemd service:

	sudo systemctl daemon-reload
	
	sudo systemctl enable --now skywire-visor.service

To disable and stop the skywire-visor.service systemd service:

	sudo systemctl disable --now skywire-visor.service

Restarting the service, if necessary, can be accomplished using the following commands:

and for the skywire-visor, use:

sudo systemctl restart skywire-visor.service

Configure Initial Launch

After starting the skywire-visors service, we will open the hypervisor UI and configure the password that we want to use to login.

Open the UI by visiting the hypervisor's board IP on port 8000 in a web browser tab. If your hypervisor's board IP would be 192.168.1.10 you'd have to enter http://192.168.1.10:8000 in the browser tab. Special note regarding the skywire-hypervisor TLS configuration: use https instead of http, sp https://192.168.1.10:8000.

Once the UI shows up, select the Configure Initial Launch found just below the password field. This will open a pop-up where you can enter your individual password; confirm the changes Set password

start_window

start_window

Once the password has been set you can simply login to the hypervisorUI using the new password.

start_window

Enhancement

Enable TLS

Before enabling TLS in the skywire-hypervisor config file, we need to generate a certificate for the hypervisor.

Download the generate.sh script and the certificate.cnf configuration file to /tmp.

sudo wget -c https://raw.githubusercontent.com/SkycoinProject/skywire-mainnet/master/static/skywire-manager-src/ssl/generate.sh -O /tmp/generate.sh

sudo wget -c https://raw.githubusercontent.com/SkycoinProject/skywire-mainnet/master/static/skywire-manager-src/ssl/certificate.cnf -O /tmp/certificate.cnf

Adjust the generate.sh script to generate the certificate in /etc/skywire-visor folder

	sudo nano /tmp/generate.sh

Replace server.key with /opt/skywire/ssl/key.pem and server.crt with /opt/skywire/cert.pem; the script should look like this:

start_window

Save it using CTRL+x, type Y and press the ENTER key.

Optionally, you can check and adjust the certificate.cnf config file to change the Country State and some other information. For example, we've adjusted it as follows:

start_window

Lastly, change the permissions of the scripts to enable its execution:

	sudo chmod +x /tmp/generate.sh

Execute the script.

	cd /tmp

	sudo ./generate.sh
        sudo mkdir -p /opt/skywire/ssl
        sudo mv /etc/*.pem /opt/skywire/ssl/

Now that we have our certificate, let's enable TLS in the hypervisor config file

	sudo sed -i 's+"enable_tls": false,+"enable_tls": true,+g' /opt/skywire/skywire-visor.json
	
	sudo sed -i 's+"tls_cert_file": "",+"tls_cert_file": "/opt/skywire/skywire-visor/cert.pem",+g' /opt/skywire/skywire-visor.json
	
	sudo sed -i 's+"tls_key_file": ""+"tls_key_file": "/opt/skywire/skywire-visor/key.pem"+g' /opt/skywire/skywire-visor.json

After you enabled it, restart the hypervisor service using:

	sudo systemctl restart skywire-visor.service

Now, please open the hypervisorUI using https:

start_window

Clone this wiki locally