Hi All,
I wanted to share some useful tips for SPKCC node operators. I observed some stability issues on my server and experimented with a different setup that seems more stable (for the pizza.spk server).
The default configuration for SPKCC nodes uses docker-compose. A docker-compose.yml file describes 2 containers to run in a cluster, one is for IPFS and one is for the Honeycomb NodeJS application. While the "configuration as code" design of docker-compose is very convenient, I experienced some stability issues with the IPFS Docker container and decided to move away from it.
It takes a little more effort, but it's possible to set up your server to run the node without Docker in the picture. go-ipfs is installed natively (no container), and managed by the popular PM2 (advanced process manager for production Node.js applications). Here's how you can do the same.
With this set up you can easily share the IPFS resource between multiple nodes. For example, if you want to run a DLUX node, a DUAT (Ragnarok) node, and a SPKCC node on the same box, they can all share the single IPFS resource.
First, you need to install NodeJS and PM2 on the server. This is straightforward. Use your Linux distro's package manager to install NodeJS.
Then, to install PM2, run:
npm install pm2 -g
Download tarball (choose appropriate option for your OS/arch)
Untar, cd to the extracted folder
Run ./install.sh
Run ipfs init --profile server
Run pm2 start "ipfs daemon" --name ipfs
Check status using command pm2 status ipfs. The output should say status online.
By default, the honeycomb software will try to talk to a public IPFS node. These public nodes often have rate limiting which causes problems for honeycomb. It is highly preferred to use an instance of IPFS on the local server.
git clone https://github.com/spknetwork/honeycomb-spkcchoneycomb-spkcc directorynpm install to install dependenciesaccount="yournodehiveaccount"
active=5K...
mspublic=STM5...
msowner=5J...
domain=https://spkcc.yourdomain.com
ipfshost=0.0.0.0
ipfsport=5001
ipfsprotocol=http
The ipfs* lines tell honeycomb to talk to your local IPFS instance instead of 3rd party endpoint.
After setting up the .env configuration file, launch the node in PM2.
pm2 start index.js --name spkccpm2 status spkcc. The output should say status online.pm2 logs spkcc.Node operators can also set up a script to automatically upgrade their node. The sequence of commands varies between Docker set up and non-Docker set up.
Save one of the below scripts to a .sh file like update_spkcc.sh file
Use crontab -e to add a cron job like 15 * * * * /home/user/update_spkcc.sh. This will check for updates every 15 minutes.
Note: replace user with your account name.
cd /home/user/honeycomb-spkcc/
update=`git pull`
if [ "$update" == "Already up to date." ]
then
exit 0
return
fi
npm i
pm2 restart spkcc
cd /home/user/honeycomb-spkcc/
update=`git pull`
if [ "$update" == "Already up to date." ]
then
exit 0
return
fi
docker-compose down
docker-compose build
docker-compose --compatibility up -d
I hope this helps node operators and the stability of the SPKCC network. Please consider delegating LARYNX Power to pizza.spk, which is the node I operate. See also: https://hiveuprss.github.io/spkccmonitor/, which is our tool for monitoring the SPKCC network. This tool has gone through several iterations of improvement in the last few weeks.