'How-To' Linux Upgrade Guide -Basic
This guide will help DIY Linux users to upgrade spd to a new version. It is written based on upgrading from 1.6.0 to 1.6.2 but the steps should still be relevant for future software upgrades too. Certain assumptions have been made in this guide so some steps may need tweaking to your exact setup.
The first step is to understand where you currently have spd installed to. In this guide, we have spd installed in /home/scprime/ScPrime/ScPrime-v1.6.0-linux-amd64 and ‘scprime’ is our Linux user.
The next thing we want to check while spd is still running is where is our metadata folder. This step is vital as it’s where most problems occur. To see how spd is currently running, run the following command:
ps -ef | grep spd
This will show you something like this:
From this we can see that spd is running using the ‘scprime’ user account, is using non-default ports 44282, 44283 and 44285 (will be covered in more detail in the Advanced Guide) and the metadata folder is in /home/scprime/.scprime. Note this is the default location Linux will use if you started it without the -d flag, /home/<USER>/.scprime and this folder is hidden in Linux. Also note we are using the -M gctwh flag which basically tells spd to load up the gateway, consensus, transaction pool, wallet and host modules but most importantly, not the renter module. The renter module is only used for storing data on the network and not required when setting up a provider.
The most important part of the upgrade is to ensure we start spd using the same metadata location as with the previous version, otherwise you are creating a new provider and risk losing any stored data from before.
Now that we know where our metadata is located, check the output of:
./spc host -v
Ensure the provider is showing ‘Host appears to be working’ as the Connectability Status. You can also see the current version is 1.6.0 below. It’s also working taking a note of the Provider ID here, this can help identify if after upgrade you’ve created a new provider or not:
Next we will stop spd using the following command:
./spc stop
Another important step to take at this point is to backup your metadata folder. This should be something you’re doing on a daily basis anyway but it’s good practice as part of an upgrade just in case. Where you backup to is up to you, could copy off the provider to an FTP server on your home network for example. In this example we’re going to copy to a USB drive we have plugged in. We are just going to copy the whole ~/.scprime folder to our USB Backup location using the following command:
cp -r ~/.scprime/* /mnt/USB_Backup/metadata_backup/
Check and make sure you see all the files and folders above in the backup location.
Next download the upgrade file from the software page. We are downloading 1.6.2 using the following command:
wget https://releases.scpri.me/1.6.2/ScPrime-v1.6.2-linux-amd64.zip
Once the file is downloaded, extract it to the ScPrime folder using the following which will overwrite the older spc and spd executables:
unzip -oj ScPrime-v1.6.2-linux-amd64.zip
Now we are ready to start up spd with the new version. The easiest way to startup spd is with the same command we recorded above in the output of ‘ps -ef | grep spd’ with ‘nohup’ before and ‘&’ after it (note that in this example we’re using non-default ports, for most cases you will be using default ports so won’t have the host-addr, siamux-addr and host-api-addr flags in your command, this is covered in the Advanced guide):
nohup /home/scprime/ScPrime/ScPrime-v1.6.0-linux-amd64/spd --host-addr :44282 --host-api-addr :44283 -d /home/scprime/.scprime -M gctwh &
Once spd is running again, we can run ./spc host -v to check the host appears online, the Provider ID is the same as before the upgrade and that we’re now running the new version, 1.6.2 in the case below.
At this point, give it 30 mins or so and then check on Grafana Dashboard that your host is online.
created 5/27/22 v1.0
Copy link