Hi v2 Node Operators,
With the official shutdown of Storjshare v2, it is finally time to remove the old software and data. I decided I wanted to clean things up as much as possible, so I found as much of the old installation instructions as I could and removed everything as a reverse of install. While I was at it I decided I would create this guide. I know there isn’t a big audience for this, but maybe it will help someone who has forgotten how this all started in the first place (like me!). Some of the steps aren’t 100% necessary, but I have done everything as per what I feel are best practices.
THIS GUIDE IS FOR v2 NODES ONLY. If you have no idea what a v2 node is, this guide is not for you. My node was running as a daemon (cli) on Debian, but most linux distros should be similar.
Step 1: Stop/remove node
First, if Storjshare is still running we want to remove the node and stop the daemon:
user@rock64:~$ storjshare status ┌─────────────────────────────────────────────┬─────────┬──────────┬──────────┬─────────┬───────────────┬─────────┬──────────┬───────────┬──────────────┐ │ Node │ Status │ Uptime │ Restarts │ Peers │ Allocs │ Delta │ Port │ Shared │ Bridges │ ├─────────────────────────────────────────────┼─────────┼──────────┼──────────┼─────────┼───────────────┼─────────┼──────────┼───────────┼──────────────┤ │ c8fcf3f9cd5d6939ab4e1c0b77828c279397f1cc │ running │ 56s │ 0 │ 0 │ 0 │ 12ms │ ... │ ... │ disconnected │ │ → /mnt/storj1/node1 │ │ │ │ │ 0 received │ │ │ (...%) │ │ └─────────────────────────────────────────────┴─────────┴──────────┴──────────┴─────────┴───────────────┴─────────┴──────────┴───────────┴──────────────┘
To remove the node we will use the
destroy option along with the node ID as shown. The node id can also be found in the config.json file (this may be called something else on your system, such as node.json):
user@rock64:~$ storjshare destroy -i c8fcf3f9cd5d6939ab4e1c0b77828c279397f1cc * share c8fcf3f9cd5d6939ab4e1c0b77828c279397f1cc destroyed
Now stop the daemon:
user@rock64:~$ storjshare killall * daemon has stopped
Step 2: Uninstall the Storjshare software
The Storjshare node software was originallty installed using npm. The package was installed globally, so we must use the
-g flag to uninstall.
user@rock64:~$ npm uninstall -g --save storjshare-daemon removed 357 packages in 21.429s
Step 3: Remove autostart cronjob
During installation we were instructed to create a watchdog script (see step 4) that would start the node at system start-up. An entry in the crontab was created to call this script at boot time. We should remove this entry in the crontab as it is no longer needed. Make sure not to change any other entries in the crontab.
user@rock64:~$ crontab -e
If you followed the original installation instructions, there should be the following entry in the crontab:
Take note of the location of watchdog.sh, delete the entry, and save the file. It should output:
crontab: installing new crontab
Step 4: Delete the watchdog script
In my case the watchdog.sh script was located in the home directory. See the example below if you want to verify the contents prior to removal.
#!/bin/bash . $HOME/.bashrc . $HOME/.profile . $HOME/.env APP=$(ps aux | grep -v grep | grep storjshare) if [ -z "$APP" ]; then echo "Restart storjshare-daemon" storjshare daemon fi APP=$(ps aux | grep -v grep | grep 'farmer.js --config') if [ -z "$APP" ]; then echo "Restart farmers" storjshare load fi
Once you are satisfied you are deleting the correct file, it is safe to delete:
user@rock64:~$ rm watchdog.sh
Step 5: Delete the node storage folder and logs folder
The node storage directory contains the node data, but not the logs. If you can find the config.json file you used to create the node, this will tell you where you specified the storage folder and logs folder (or if you didn’t specify a logs folder, the default location). I don’t believe there was default location for the config.json file so this could have been placed anywhere. An excerpt from my config.json file:
// Path to write the log file to disk, leave empty to default to: // $HOME/.config/storjshare/logs/[nodeid]_date.log "loggerOutputFile": "/mnt/storj1/node1logs", // Directory path to store contracts and shards "storagePath": "/mnt/storj1/node1",
Make sure you are deleting the correct folders when removing your v2 node data. Many of us ran v2 and v3 side-by-side. If you delete the wrong folders/files and nuke your v3 node, I take no responsibility.
For reference, the v2 top level directory should look something like this:
user@rock64:/mnt/storj1/node1$ ls -l total 24 -rw-r--r-- 1 user user 3248 Feb 1 2019 config.json drwxr-xr-x 2 user user 4096 Feb 6 11:01 contracts.db drwxr-xr-x 258 user user 12288 Aug 7 2017 sharddata.kfs drwxr-xr-x 2 user user 4096 Feb 6 11:01 tokens.db
Once you delete the data folder and the logs folder, all of remnants of v2 should be gone from the system.
Don’t forget to remove the port mapping in your firewall(s). The default port was 4000. If you no longer have a use for npm, you could remove this as well. If you are unsure, it won’t hurt to leave npm installed.
P.S. If the mods feel this should be placed somewhere else on the forum, please feel free to move it. I originally placed it in Uncategorized to avoid confusion for SNOs running v3.