Linux Supervisor-Lite Installation Guide
This guide will help DIY Linux users to install the new supervisor-lite software on their providers. To do this you will need to have purchased a Basic License from XaMiner shop and registered it to your DIY Provider ID on the XNS Console. The software supports all major Linux distros including Ubuntu, CentOS and Alpine Linux.
Supervisor-lite will run alongside spd as a process on your provider and can perform 2 functions, auto pricing and auto re-announce. Auto pricing will keep the provider’s price settings within recommended values based on a $ price per TB per month in SCP. This value is currently $4 per TB per month but in case this value changes in the future, this can be set in the software. The following provider settings will be set by supervisor-lite:
collateral
collateralbudget
maxcollateral
minbaserpcprice
mindownloadbandwidthprice
minsectoraccessprice
minstorageprice
These values will be updated on an hourly basis so once supervisor-lite is started, it will keep the provider using pricing settings which will keep them within incentives compliance and in line with Xa-Miners and Full License providers.
The other function of supervisor-lite is auto re-announce. This feature will regularly check what the provider’s public IP address is and if it is different to the address the provider is announced on, then it will re-announce on the new public IP address. This will completely remove the need for providers to use Dynamic DNS services like DuckDNS, No-IP.com etc. if they do not have a static IP address from their ISP. This should make the provider and therefore the network more stable and reliable as any DNS issues will not impact the reachability or scanning of the provider network.
Installing the Software
The first step to install the software is to either SSH to your Linux provider, open a Terminal window if running a GUI or simply the CLI console. Download the software to your provider to the folder where spd and spc are located using the following command:
wget <URL>
Where URL is the link from the ScPrime Software page, for the latest Linux version of supervisor-lite. This will download the zip file, unzip it with:
unzip supervisor-lite-v1.0-linux-amd64.zip
for example, the exact filename will depend on the version.
Supervisor-lite needs to know the host port that spd is being run on. In most cases this will be 4282 but this can be confirmed if you are unsure by running the following:
xaminer-diy1:~/ScPrime# ./spc host
Host info:
Provider ID : eab0ee64e0af2ed1c9878e87e77594d5b6c508a11fdd7daa4e923cbefecb2d48
Announced as : 213.104.199.250:14282
(manually specified)
Connectability Status: Host appears to be working.
In this case spd is running on 14282 and so this is the host port used when starting supervisor-lite in this example.
Starting Supervisor-Lite with Default Options
Supervisor-lite can be started using the following command with minimum options if you are running spd on the default ports:
nohup ./supervisor-lite &
The ‘nohup’ option runs the process with ‘no hangup’ should the user who started the process log out of the system. This also has the added benefit of outputting the logs to the ‘nohup.out’ file rather than printing out on the terminal. This command will start the supervisor-lite process running with all the default options (auto pricing enabled, auto re-announce enabled, default host port 4282 etc.)
Once supervisor-lite is running, to see what it is doing, look at the nohup.out file using for example ‘tail -20 nohup.out’ to see the last 20 lines of the file:
xaminer-diy1:~/ScPrime# tail -20 nohup.out
2022-10-12T08:12:42.930Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minsectoraccessprice”, “old”: “920131498433232000000”, “new”: “915530840940960000000”}
2022-10-12T08:12:42.933Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minstorageprice”, “old”: “4259868048302”, “new”: “4238568708060”}
2022-10-12T08:12:42.933Z [INFO ] v1.0-beta4 pricing/service.go:204 host settings are up to date
2022-10-12T09:12:42.886Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “collateral”, “old”: “4238568708060”, “new”: “4259761551600”}
2022-10-12T09:12:42.891Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “collateralbudget”, “old”: “1922614765976016000000000000000”, “new”: “1932227839805760000000000000000”}
2022-10-12T09:12:42.895Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “maxcollateral”, “old”: “76904590639040640000000000000”, “new”: “77289113592230400000000000000”}
2022-10-12T09:12:42.899Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minbaserpcprice”, “old”: “36621233637638400000”, “new”: “36804339805824000000”}
2022-10-12T09:12:42.903Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “mindownloadbandwidthprice”, “old”: “4577654204704800”, “new”: “4600542475728000”}
2022-10-12T09:12:42.907Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minsectoraccessprice”, “old”: “915530840940960000000”, “new”: “920108495145600000000”}
2022-10-12T09:12:42.911Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minstorageprice”, “old”: “4238568708060”, “new”: “4259761551600”}
2022-10-12T09:12:42.911Z [INFO ] v1.0-beta4 pricing/service.go:204 host settings are up to date
2022-10-12T10:12:42.888Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “collateral”, “old”: “4259761551600”, “new”: “4270245747518”}
2022-10-12T10:12:42.894Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “collateralbudget”, “old”: “1932227839805760000000000000000”, “new”: “1936983471074164800000000000000”}
2022-10-12T10:12:42.899Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “maxcollateral”, “old”: “77289113592230400000000000000”, “new”: “77479338842966592000000000000”}
2022-10-12T10:12:42.903Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minbaserpcprice”, “old”: “36804339805824000000”, “new”: “36894923258555520000”}
2022-10-12T10:12:42.908Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “mindownloadbandwidthprice”, “old”: “4600542475728000”, “new”: “4611865407319440”}
2022-10-12T10:12:42.912Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minsectoraccessprice”, “old”: “920108495145600000000”, “new”: “922373081463888000000”}
2022-10-12T10:12:42.916Z [INFO ] v1.0-beta4 pricing/service.go:194 host setting is updated {“param”: “minstorageprice”, “old”: “4259761551600”, “new”: “4270245747518”}
2022-10-12T10:12:42.916Z [INFO ] v1.0-beta4 pricing/service.go:204 host settings are up to date
xaminer-diy1:~/ScPrime#
Above you can see the price settings being updated once an hour which is the default interval to update pricing.
Supervisor-lite Command Line Options
Similar to when spd it started, there are various command line options when starting supervisor-lite to tailor it to a user’s particular needs and setup. The following table details those options:
Option | Description |
SPD Options | |
–api-addr= | Spd API address (value of spd –api-addr) (default: localhost:4280) |
–api-password= | Spd API password, can (and should) be defined using SCPRIME_API_PASSWORD environment variable. By default will try to read password from ‘apipassword’ file created by spd [$SCPRIME_API_PASSWORD] |
Autoannounce Options | |
–no-announce | Disable autoannounce |
–host-addr= | Spd daemon host address (value of spd –host-addr) (default: :4282) |
–check-ip-interval= | Interval between two IP checks (default: 5m) |
–announce-interval= | Minimum interval between two announcements (default: 30m) |
–mining-check= | If transaction was not included in the block for that amount of time, host will announce again. Must be >= announce-interval (default: 1h) |
Autopricing Options | |
–no-pricing | Disable autopricing |
–update-interval= | Update settings interval (default: 1h) |
–settings= | Comma-separate list of host settings to update. Available are: maxdownloadbatchsize, maxduration, maxrevisebatchsize, windowsize, collateral, collateralbudget, maxcollateral, minbaserpcprice, mincontractprice, mindownloadbandwidthprice, minsectoraccessprice, minstorageprice, minuploadbandwidthprice, maxephemeralaccountbalance, maxephemeralaccountrisk. Updates all listed settings by default |
–target-price-usd= | Target price in USD (default: 4.0) |
–max-shift-ratio= | Maximum price shift between two updates. Example: current storage price 100 SCP, target price 102 SCP, max shift is 0.005, new price would be 100.5 SCP (default: 0.005 |
–force-update-diff= | Update price to target if target differs from current by this ratio (not take into account max-shift-ratio during update). Example: current price is 100 SCP, target is 160 SCP, force update diff is 0.5, new price would be 160 SCP (default: 0.5) |
While all the available options have been documented above, most can be left as default. The –no-announce and –no-pricing options will disable either of those functions should the user want to only use one of them and not the other.
The main option to be aware of is –host-addr should the provider not be running on the default ports, the port spd is running on needs to be specified. Also an option which may need to be used in the future is the –target-price-usd, while this defaults today to $4 which is the target price to be within incentives range, should this $4 amount change in the future, then this command line flag will need to be used to set the new target price. So for example if the provider is running on port 14282 and the target price is now $3, start supervisor-lite with the following:
nohup ./supervisor-lite --host-addr=localhost:14282 --target-price-usd=3.0 &
Auto starting Supervisor-lite
While the above process starts up supervisor-lite and it will continue running while the provider OS is up and running, upon a reboot or power outage, supervisor-lite would need manually restarting. So similar to starting up spd automatically, we recommend adding supervisor-lite to any existing auto startup script the provider may already have setup. If you have no auto startup script for spd currently, refer to the Linux Setup Guide for how to set that up. This guide will assume you already have a script setup to auto start spd.
To automatically start up supervisor-lite, simply add a ‘sleep 60s’ command plus the command as you configured above to start supervisor-lite with the options you need to the end of your startup script, for example using the method described in the Linux Setup Guide, add to the end of the spd-startup.sh script the following if using the default 4282/4283 ports:
sleep 60s
nohup $SCPRIME/supervisor-lite &
Or if using non-default ports, insert your host port in place of <HOST-PORT>:
sleep 60s
nohup $SCPRIME/supervisor-lite --host-addr=localhost:<HOST-PORT> &
The ‘sleep 60s’ command is important as it gives spd time to start up fully and the api to be available to supervisor-lite.
Now test that supervisor-lite starts up automatically by reloading your provider PC, confirm that both spd and supervisor-lite are running using the following command and checking both processes are running:
xaminer-diy1:~/ScPrime# ps -ef | grep ‘spd\|supervisor’
3593 root 0:12 /root/ScPrime/current/spd –host-addr :14282 –host-api-addr :14283 -d /root/.scprime -M gctwh
3661 root 0:00 /root/ScPrime/current/supervisor-lite –host-addr=localhost:14282
3749 root 0:00 grep spd\|supervisor
xaminer-diy1:~/ScPrime#
This shows both spd and supervisor-lite are running with the specified options after the reload.