Skycoin Forum

Full Version: DIY Skyminer on raspberry pi devices
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
INTRO

I wrote some simple scripts to setup your skiminer on raspberries pi, available on github.

Here is a short and extremely easy tutorial to set up your skyminer using raspberry pi (RB) devices. I used Raspberries pi 3 B+ with OS raspbian lite.


FLASH YOUR SD CARD

I downloaded the official OS raspbian lite. I chose the lite version because we don't need a desktop environment, the install is faster, and occupies les space (less than 1Gb).

Flash your SD card from:
Before removing the SD card from your pc/mac, you can activate ssh by adding a file named ssh (no extension) to the visible part of the SD card. Upon the next reboot of your RB, ssh will be activated. From windows, use MobaXterm, PuTTY or similar to connect to your RB with ssh. If you can't figure out how to do this, connect a monitor and a keyboard to your RB and proceed to the next step.


FIRST BOOT AFTER INSTALL

Let's boot the RB.

If you did not activate ssh, you can simply connect a monitor (HDMI) and a keyboard (USB) to the RB. In that case, you first log in with user pi and password raspberry. Also, you can now activate ssh from your RB:

Code:
sudo touch /boot/ssh
reboot

Upon reboot, you will be able to connect to your RB with ssh as described above and get rid of the monitor and keyboard. You can continue the installation process without ssh. However, I recommend you use ssh in order to overcome problems like bad configured keyboards. Also, it's really more comfortable to use ssh.

You can now connect to your RB from any device connected to your local network. For Linux/Mac, open a terminal and write:

Code:
ssh pi@<IP_OF_YOUR_RB>

For windows, use MobaXterm, PuTTY or similar.

From here on, it doesn't matter whether you connect through ssh or use the RB with monitor and keyboard setup. Let's log into our RB.

The default password for the user pi is raspberry. Once logged in, you can reset that password with:

Code:
sudo passwd pi

Also, reset the password of the root, as we will need the root in the coming sections:

Code:
sudo passwd root

Other useful commands:

Code:
sudo -i # or simply su to become root
sudo raspi-config # to setup basic stuff like wifi connection, timezone, keyboard, etc


SKYWIRE MANAGER AND NODES

One RB must run the skywire manager which manages the skywire nodes. That same RB can also run a node. The installation described below is exactly the same for each RB. However, you have to choose which RB will run the manager:

  1. Choose the RB which will run the manager
  2. Make sure the RB is connected to your local network (with wifi or ethernet)
  3. From a browser on any device connected to your local network, go to your router (typically 192.168.1.1 or 192.168.0.1)
  4. Locate your RB and set its IP as static
  5. Write the static IP down. Let's call it STATIC_IP (we'll refer to it later).
This is important! It makes sure that the IP of your RB which runs the manager (i.e. STATIC_IP) does not change. That way, the other RB nodes will be able to find the manager easily.


INSTALLATION

This is actually the easiest part! Log into your RB providing your user (pi) and password, download the install scripts from github, and execute them. Once logged in:

Code:
# first install git to download the scripts from github
sudo apt-get install git

# cd to the directory we want to download the scripts
cd /home/pi # for example

# download the scripts
git clone https://github.com/MFnx/skywire.git
cd skywire # cd into the downloaded skywire folder

# become root
sudo -i

# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before

At the end, your RB will reboot. You can now remove the folder /home/pi/skywire if you want to. Do the same for each RB, using the same STATIC_IP every time. The skywire services are run automatically upon each rebooot of your RB (give it a minute or two), so you won't have to do that manually.


SKYWIRE MANAGER

You can access the skywire manager from a browser on any device connected to your local network. Just enter STATIC_IP:8000. There you'll be able to monitor your nodes (you'll find the public and private keys there).


WHITELIST YOUR MANAGER

https://github.com/skycoin/skywire/wiki/...ing-System
very good.

You can skip out the keyboard and monitor part by adding an SSH file to the SD card while its in your device as you image it. Just make a file called ssh.txt and drag it over.

Overall well done tho!
(07-12-2019, 08:30 AM)I Am You Wrote: [ -> ]very good.

You can skip out the keyboard and monitor part by adding an SSH file to the SD card while its in your device as you image it. Just make a file called ssh.txt and drag it over.

Overall well done tho!

Thank you! I mentioned how to activate ssh when flashing your SD in the section: FLASH YOUR SD CARD

The file should have no extension though (i.e.: ssh, not ssh.txt)
Works like a charm! Thanks!
Hi, firstly, thanks for putting this together!  I am trying to build a DIY skyminer based on 8 RPI 4bs, and trying to set them up using terminal on my macbook.  It goes quite well until until I try execute the commands:


Code:
# become root
sudo -i


# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before


I get the error message "setup.sh: No such file or directory".  I presume this is because "sudo -i" command has somehow taken me to the root directory, where teh setup file does not exist.  To get around this I have tried going back to skywire directory and then instead run the command as "sudo bash set.sh --all --manager-ip 192.168.42.100" but then end up with the following error message:

"unexpected directory layout:
import path: github.com/skycoin/skycoin/src/util/file
root: /root/go/src
dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
expand root: /root/go
expand dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
separator: /"





I am new to CLI (only started yesterday) and just cannot figure out what the issue is.  Anyone lend a helping hand?  Thanks
(04-27-2020, 03:38 PM)gbsilp Wrote: [ -> ]Hi, firstly, thanks for putting this together!  I am trying to build a DIY skyminer based on 8 RPI 4bs, and trying to set them up using terminal on my macbook.  It goes quite well until until I try execute the commands:


Code:
# become root
sudo -i


# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before


I get the error message "setup.sh: No such file or directory".  I presume this is because "sudo -i" command has somehow taken me to the root directory, where teh setup file does not exist.  To get around this I have tried going back to skywire directory and then instead run the command as "sudo bash set.sh --all --manager-ip 192.168.42.100" but then end up with the following error message:

"unexpected directory layout:
import path: github.com/skycoin/skycoin/src/util/file
root: /root/go/src
dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
expand root: /root/go
expand dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
separator: /"





I am new to CLI (only started yesterday) and just cannot figure out what the issue is.  Anyone lend a helping hand?  Thanks
Hi, it seems something went wrong with your go installation. Could you check if all the paths (/root, /root/go/src, ...) exist?
(04-27-2020, 07:21 PM)mfnx Wrote: [ -> ]
(04-27-2020, 03:38 PM)gbsilp Wrote: [ -> ]Hi, firstly, thanks for putting this together!  I am trying to build a DIY skyminer based on 8 RPI 4bs, and trying to set them up using terminal on my macbook.  It goes quite well until until I try execute the commands:


Code:
# become root
sudo -i


# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before


I get the error message "setup.sh: No such file or directory".  I presume this is because "sudo -i" command has somehow taken me to the root directory, where teh setup file does not exist.  To get around this I have tried going back to skywire directory and then instead run the command as "sudo bash set.sh --all --manager-ip 192.168.42.100" but then end up with the following error message:

"unexpected directory layout:
import path: github.com/skycoin/skycoin/src/util/file
root: /root/go/src
dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
expand root: /root/go
expand dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
separator: /"





I am new to CLI (only started yesterday) and just cannot figure out what the issue is.  Anyone lend a helping hand?  Thanks
Hi, it seems something went wrong with your go installation. Could you check if all the paths (/root, /root/go/src, ...) exist?
The directories seem to exist.  I can drill all the way down to the file.go file with path:

"root@rpi00:~/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file"

Is this path actually in /root?
(04-27-2020, 07:21 PM)mfnx Wrote: [ -> ]
(04-27-2020, 03:38 PM)gbsilp Wrote: [ -> ]Hi, firstly, thanks for putting this together!  I am trying to build a DIY skyminer based on 8 RPI 4bs, and trying to set them up using terminal on my macbook.  It goes quite well until until I try execute the commands:


Code:
# become root
sudo -i


# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before


I get the error message "setup.sh: No such file or directory".  I presume this is because "sudo -i" command has somehow taken me to the root directory, where teh setup file does not exist.  To get around this I have tried going back to skywire directory and then instead run the command as "sudo bash set.sh --all --manager-ip 192.168.42.100" but then end up with the following error message:

"unexpected directory layout:
import path: github.com/skycoin/skycoin/src/util/file
root: /root/go/src
dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
expand root: /root/go
expand dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
separator: /"





I am new to CLI (only started yesterday) and just cannot figure out what the issue is.  Anyone lend a helping hand?  Thanks
Hi, it seems something went wrong with your go installation. Could you check if all the paths (/root, /root/go/src, ...) exist?

Can you let me know what the paths are supposed to be?  Maybe I can then move/remove directories to get to the correct structure.  Thanks
(04-28-2020, 11:23 AM)gbsilp Wrote: [ -> ]
(04-27-2020, 07:21 PM)mfnx Wrote: [ -> ]
(04-27-2020, 03:38 PM)gbsilp Wrote: [ -> ]Hi, firstly, thanks for putting this together!  I am trying to build a DIY skyminer based on 8 RPI 4bs, and trying to set them up using terminal on my macbook.  It goes quite well until until I try execute the commands:


Code:
# become root
sudo -i


# execute the install script
bash setup.sh --all --manager-ip STATIC_IP # STATIC_IP is the IP you wrote down before


I get the error message "setup.sh: No such file or directory".  I presume this is because "sudo -i" command has somehow taken me to the root directory, where teh setup file does not exist.  To get around this I have tried going back to skywire directory and then instead run the command as "sudo bash set.sh --all --manager-ip 192.168.42.100" but then end up with the following error message:

"unexpected directory layout:
import path: github.com/skycoin/skycoin/src/util/file
root: /root/go/src
dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
expand root: /root/go
expand dir: /root/go/src/github.com/skycoin/skywire/vendor/github.com/skycoin/skycoin/src/util/file
separator: /"





I am new to CLI (only started yesterday) and just cannot figure out what the issue is.  Anyone lend a helping hand?  Thanks
Hi, it seems something went wrong with your go installation. Could you check if all the paths (/root, /root/go/src, ...) exist?

Can you let me know what the paths are supposed to be?  Maybe I can then move/remove directories to get to the correct structure.  Thanks
I've whittled the problem down to the commands:


"cd $GOPATH/src/github.com/skycoin/skywire/cmd

go install ./..."

My understanding from research is that this is supposed to build executables and put them in the $GOPATH/bin directory (where GOPATH is $HOME/Go).  I haven't found out what "./..." means yet but presume it's some form of relative directory.