Skip to content

Skyminer Skywire Installation Guide

Asgaror edited this page May 6, 2019 · 20 revisions

skywire logo

Skywire Installation Guide

This guide assumes that you have read and understood the readme.md, downloaded the official images and do every step exactly the way it is described. Misconduct will lead to the inability to connect and to potential reflashing. It is very important that there is no IP subnet collision with your existing home router subnet. The default settings of the official images, as well as the router of the Skyminer, are using the 192.168.0.0/24 subnet. Installation from source does not demand certain prevalent network settings.

Table of Contents

Introduction

This guide covers the installation of Skywire from source or by using our prepared images specifically designed for the orange pi prime or other H5 boards.

For stable operation of Skywire, we suggest not deploying Skyminer to any type of public network, including those in cafés, on-campus sites, in offices etc.

To ensure stable operation of the Skywire software, we suggest to not deploy a Skywire node:

  • in any type of public network
  • on-campus sites
  • in offices
  • etc.

The first bootup process of a Skywire node takes some time to finish the initialization. Please do not switch the node off unless at least 5 minutes have passed. Turning it off prior to the initialization process being finished may result in corruption of the micro SD card, therefore demanding reflashing of the image.


Requirements

Depending on the installation setup procedure you'd like to follow, different requirements are given.

Requirements Prepared Images

  • balenaEtcher or similar software to flash images on sd cards.
  • orange pi prime or similar board with H5 chip.
  • Micro sd card adapter + sd card reader.

Requirements Installation From Source

  • Any computer running a linux distribution.

Installation

This section covers the installation of Skywire. Two options are being presented, one is using the prepared images, the other one guides you through the installation from source.

Do not forget to submit your application using the new Skywire Whitelisting System.
Follow this guide if you need any help using it.

Prepared Images

You can install the Skywire software on any orange pi prime by using the official prepared images. Please note that we have new custom images (Skybian) in the making as well as our own custom flashing software (Skyflash) that takes care of the respective configurations of the images.

The prepared images are yet to be updated and therefore come with the old user interface. You may use this upgrade script to update the prepared images or install Skywire from source if you want to work with the new user interface right from the start.

First, you need to download the images, make sure to get all 8 images, each image is prepared to run on a separate orange pi prime.

  • Unzip the downloaded 'tar.gz' files, you'll end up with '.img' file.
  • Unzip one image at a time and rename them (!) to display the node they are representing. By default each images is called OrangePiH5_Prime.img and you are advised to rename them to:
    • manager.img
    • node1.img
    • node2.img
    • node3.img
    • node4.img
    • node5.img
    • node6.img
    • node7.img

Download balenaEtcher. BalenaEtcher is cross-platform image flashing software that does all the hard work for you.

Run balenaEtcher as administrator and select the manager image file while the Micro SD disk is inserted into your computer (you need a micro SD card reader/SD card reader + micro SD to SD card adapter) and click on ‘Flash’.

Note down which Orange Pi Prime runs which image, this will come in handy in case you'll encounter issues.
Knowing the position of the images simplifies the troubleshooting process in case you encounter difficulties with your miner.

After flashing ended successfully, please eject the Micro SD and insert it into an Orange Pi Prime in Skyminer. Repeat this procedure until all of the 8 images are flashed and inserted into the 8 Orange Pi Primes.


Once the flashing is done you have two options:

  • Option 1: connect only the manager and nodes 1-6 to the Skyminer router and use the 8th port for your computer/laptop.
    • By choosing option 1 you won't be able to view all 8 nodes in the manager since one LAN port of the Skyminer router will be used for your computer/laptop to connect to it. You are advised to setup the port-forwarding rules immediately after you're done with this guide.
  • Option 2: use the networking guide to prepare your router to enable access from within your home network via port-forwarding rules.

This section will cover the setup choosing option 1.

Independent on the option you choose to proceed with, you need to make sure you don't have IP subnet conflicts as mentioned in the disclaimer up top. Your home network needs to be different than 192.168.0.0/24.*

Make sure that all the switches next to Orange Pi and on the socket are OFF.

Plugin all previously flashed micro sd cards and connect the orange pi primes to the LAN ports of the Skyminer router.

Please connect the power cable, then turn on the socket switch and wait until all of the LEDs on the router go off. This indicates that the first bootup process of the router is finished. Some router models continue to light up the two LEDs on the bottom right. Please ignore this if they don't go off after 5 minutes.

Connect the Skyminer WAN port to one of the LAN ports of your home router - the WAN port LED should light up. Turn on the switch of the Skywire Manager node and wait until its LAN status LED lights up on Skyminer router before carrying out the next step. After that, turn on the switches of other nodes one by one with a recommended interval of 15 seconds between booting any two nodes. When all the 8 LAN LEDs on Skyminer router are lighted up, all the nodes have booted up successfully.

Now you can unplug the Ethernet cable of a non-manager node (orange pi prime with images of node1-7) and connect your computer/laptop to the vacant port in order to manage your nodes in the browser.

Next steps:

  • Verification that your nodes are online using this guide.
  • Setup the port-forwarding rules by using the networking guide. It was written for the official Skyminer but you can use it as guidance since the port-forwarding rules specified are universal to the Skywire software.
  • Continue with updating Debian 8 to 9 by performing these instructions.
  • Next, you can upgrade your images to include the new manager user interface by executing the one time upgrade script.

Please refer to the Skywire Manager Web Interface User Guide for using the Skywire software via the web interface.


Installation From Source

In case you're trying to install the software on a SBC you are advised to install a linux distribution of your choice before continuing with this guide. An alternative would be to use our prepared images.

The following steps were performed on the Armbian Ubuntu Server image but they work on any other debian distribution as well. It is necessary that you are able to connect to your boards via SSH for performing the installation steps. If you have troubles finding the IP of your board(s) that you are trying to set up, check out this guide to find the IP address(es).

Log in via SSH, default password is often times 1234. First, update and upgrade via

sudo apt-get update && sudo apt-get upgrade -y

Next, install the dependencies:

sudo apt-get install -y curl git mercurial make binutils gcc bzr bison libgmp3-dev screen gcc build-essential

Install Golang

Download the respective Golang (Go) version matching your CPU, the following commands are for 64-bit ARM architectures:

cd ~
curl -sS https://dl.google.com/go/go1.12.linux-arm64.tar.gz > go$1.12.linux-arm64.tar.gz
tar xvf go1.12.linux-arm64.tar.gz
rm go1.12.linux-arm64.tar.gz

then install Go, create symbolic links and create Go directories:

sudo mv go /usr/local/go
sudo ln -s /usr/local/go/bin/go /usr/local/bin/go
sudo ln -s /usr/local/go/bin/godoc /usr/local/bin/godoc
sudo ln -s /usr/local/go/bin/gofmt /usr/local/bin/gofmt
mkdir -p $HOME/go/{bin,pkg,src}

Next, set up the environment variables in .bashrc:

cd ~
nano .bashrc

This opens .bashrc in the nano text editor. Paste the following lines at the end of the file:

export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN

Save .bashrc via ctrl+x and y and then activate your changes via:

source ~/.bashrc

Install Skywire

Download the files from the GitHub repository:

mkdir -p $GOPATH/src/github.com/skycoin
cd $GOPATH/src/github.com/skycoin
git clone https://github.com/skycoin/skywire.git

Install Skywire using the following commands:

cd $GOPATH/src/github.com/skycoin/skywire/cmd
go install -v ./...

That's it, the installation of Skywire is finished. Test your installation by running a manager and node process as described in the readme. Verification steps that your nodes are online are outlined in this guide.

Please refer to the Skywire Manager Web Interface User Guide for using the Skywire software via the web interface.


Troubleshooting

Changing the IP addresses of the prepared images

To do this disconnect any cable going into the WAN port of the skyminer router (or DIY router) and connect your computer to a free LAN port. You need to run the pi's within a 192.168.0.0/24 subnet, otherwise, you won't be able to connect to them.

Now login to the first pi via SSH or open a terminal in the manager. If you use SSH or Putty you need to specify the IP of the pi itself and not the skyminer router!

You need to edit three files:

  • /etc/network/interfaces.d/eth0
  • /etc/resolv.conf
  • /etc/rebuild.sh

Let's say you want to start with the manager node and change its IP address. Type in a terminal: ssh root@192.168.0.2 Type in your password.

The first thing we need to change is the static IP address to match a different subnet, in this example we'll change it from the 192.168.0.1/24 subnet to the 192.168.1.0/24 subnet. You can replace 192.168.1.0/24 (router IP would be 192.168.1.1) in the following section to the specific subnet you choose to operate in.

Check the existing static ip via cat /etc/network/interfaces.d/eth0 The output will look like this:

eth0_unchanged

As you can see the file contains static IP settings for all 8 images, but only one address is active since all others are commented out ('#' at the beginning of the line). You need to change 3 lines.

address 192.168.0.2
gateway 192.168.0.1
dns-nameservers 192.168.0.1 8.8.8.8

to

address 192.168.1.2
gateway 192.168.1.1
dns-nameservers 192.168.1.1 8.8.8.8

Leave the rest as it is, save the changes via 'Ctrl+X' and confirm with yes.

Next, you need to edit the file resolv.conf, located in /etc. To do this, type:

nano /etc/resolv.conf

Change nameserver 192.168.0.1 to nameserver 192.168.1.1

Safe the changes via 'Ctrl+X' and confirm with yes.

The last file we need to change is the startup script rebuild.sh. Type nano /etc/rebuild.sh

For the manager the script should look like this:

cd  /usr/local/skywire/go/bin
nohup ./manager -web-dir /usr/local/skywire/go/src/github.com/skycoin/skywire/static/skywire-manager > $
sleep 3
nohup ./node -connect-manager -manager-address 192.168.1.2:5998 -manager-web 192.168.1.2:8000 -discover$
cd /

For nodes 1-7 the script should look like this:

cd  /usr/local/skywire/go/bin
#nohup ./manager -web-dir /usr/local/skywire/go/src/github.com/skycoin/skywire/static/skywire-manager > $
sleep 3
nohup ./node -connect-manager -manager-address 192.168.1.2:5998 -manager-web 192.168.1.2:8000 -discover$
cd /

Safe the changes via 'Ctrl+X' and confirm with yes.

You need to change all 8 nodes for this to work. The IP addresses of the nodes need to be pairwise distinct.

Since the router only has 8 ports and you need one for your laptop you have to change the connected pis at some point.

After you're done editing all files on all nodes please reboot the pis and the router. Then, while the pis are turned off, connect a LAN cable to the WAN port to the Skyminer router (or DIY router) and set the IP to 192.168.1.1 (or whatever subnet you'd like to use and configured in the steps above). Once that is done disconnect your laptop and reboot the Skyminer router again.

Proceed with starting the manager first and the other nodes within an interval of ~10 seconds. You should now be able to view the manager via these instructions as if it was running on the default settings.

Clone this wiki locally