Updating the Ronny’s Cheap Man’s Miner

Ronny
3 min readApr 30, 2019

--

Today I noticed my Cheapman’s Miner was disconnected from the discovery service.

http://testnet.skywire.skycoin.com:8001/conn/getAll

I did some testing recently with filtering the network. I don’t know if this has caused my Skyminer to go offline. Nevertheless, it was time for an update anyway, so here we go!

Update your Raspberry Pi

Tip: If you are a noob, make a copy of your SD card with https://etcher.io

First, we login to our miner using Terminal on a Macintosh as ‘root’ using the sudo command (remember, we installed Skywire on our miner as user root).

ssh pi@yourlocalipsudo -iapt-get updateapt-get upgrade

This can take some time. So if you need to do anything else, now is a good moment. When finished, we are first going to backup our Skywire keys, in case something goes wrong.

Backup your keys

To backup we need to find our .skywire folder on the Raspberry Pi and select the correct one for backup + updating:

find / -name keys.json 2> /dev/null

In my case the result was:
/root/.skywire

Now we need to check if this .skywire folder has indeed got the keys that we registered:

sudo nano /root/.skywire/node/keys.json

Yes, the public key is the same as the key I registered for getting rewards.

Now I make a copy of this folder:

cp -r /root/.skywire /root/.skywireMyBACKUP
#check it, -a shows hidden folders & files:
ls -a /root/ -a

OK that is done. Now it is time to update Skywire.

Update Skywire

sudo -i
cd $GOPATH/src/github.com/skycoin/skywire/
git reset --hard
git pull origin master
cd $GOPATH/src/github.com/skycoin/skywire/cmd/
go install -v ./...

The Skywire software has changed some names of applications in a recent update.

Check yourself:

ls -a $GOPATH/src/github.com/skycoin/skywire/cmd

As you can see previous ‘node’ and ‘skywire’ are gone and replaced by ‘node-manager’ and ‘skywire-manager’.

So now we need to adjust our startup scripts:

sudo -i
cd /etc/init.d
nano MyScript.sh

Adjust the startup script:

replace .manager with ./skywire-manager
replace .node with ./skywire-node

#!/bin/sh
export GOPATH=$HOME/go
cd $GOPATH/bin
./skywire-manager -web-dir /root/go/src/github.com/skycoin/skywire/static/skywire-manager > /dev/null 2>&1 &
echo "Skywire is now running in the background. You can now access the Skywire Manager via the web browser"
sleep 5
cd $GOPATH/bin
./skywire-node -connect-manager -manager-address :5998 -manager-web :8000 -discovery-address testnet.skywire.skycoin.com:5999-028ec969bdeb92a1991bb19c948645ac8150468a6919113061899051409de3f243 -address :5000 -web-port :6001 &> /dev/null 2>&1 &
echo "Skywire monitor started."
echo "You can now open the monitor in your browser: http://#.#.#.#:8000"
sleep 10

Check if the script is working:

sudo -i
cd /etc/init.d
./MyScript.sh

Reboot if ok→ Done!

reboot

You can now login to your updated manager with a web-browser:

http://yourlocalip:8000

* Clear your cache if you see nothing or the manager is not updated.
* If something goes wrong, check the pi log with: sudo tail -f /var/log/syslog

Cheers!
Ronny

SKYCOIN: 2FBZoLvKQsySAzSz3RV1ve62iRTMjvf9vge
BITCOIN: 16VynXgJET1JYpL6kZfaGTxkTfuemJq4Ko
HANDCASH: $RONNY

--

--