Ensure you are logged in as the non-root user being used to run zend and the node tracker
- Install packages from the official guide
- Stop tracker with pm2
- Upgrade tracker to version 10.12.0
- Create systemd unit for the node tracker
- Start tracker with systemd
- Stop zend with monit
- Create systemd unit for zend
- Start zend with systemd
- Check status of zend and zentracker
- Enable service units at boot
- Ensure Firewall is monitored by systemd
- Kill and remove pm2
- Remove and purge monit
- acme.sh - Migration to certbot
Description | Command | |||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 | Install the universe repository and packages for ssl-cert and certbot and ensure other packages are installed and up to date from the official guide |
Skip adding the universe repository on Debian systems, DO NOT SKIP THE OTHER ENTRIES IN THIS STEP
Be sure to copy the entire command, especially for long command strings
| ||||||||||||||||||||||||||||||||||||
2 | Update the package cache |
| ||||||||||||||||||||||||||||||||||||
3 | Install curl and add the nodejs repository and update the package cache NOTE: Skip this step for Ubuntu | Debian 9 only
| ||||||||||||||||||||||||||||||||||||
4 | Install npm, upgrading it to the latest version 10.12.0 |
| ||||||||||||||||||||||||||||||||||||
5 | Stop the node tracker NOTE: If for some reason you have more than one tracker running in pm2, you may have to change "0" to the number that corresponds with your tracker, and stop those as well. You can get a listing of the numbers from running: pm2 list |
| ||||||||||||||||||||||||||||||||||||
6 | <INSERT STEPS TO MIGRATE AND UPGRADE NODE TRACKER> | 7 | Change directory to where the node tracker was cloned, this will be ~/nodetracker for the official guide and typically ~/zencash/secnodetracker for older documentation or other guides |
Perform the following command if the above command fails due to the directory not existing
| ||||||||||||||||||||||||||||||||||
7 | Update git with the new repository URL and retrieve the latest source code |
NOTE: If git returns an error regarding any files run the following command (replacing 'filename with the file returned in the error message) and repeat the commands above
| ||||||||||||||||||||||||||||||||||||
8 | Install the latest set of node modules required for the tracker |
| ||||||||||||||||||||||||||||||||||||
Only perform steps 9 and 10 if this has not already been ran. If you have already upgraded to nodetracker 0.3.1 this would have already been completed. | ||||||||||||||||||||||||||||||||||||||
9 | Locate your node's public IPv4 and/or IPv6 address(es) and append them to the zen.conf file as external IP address(es) connected over port 9033 (default) ONLY SUPER NODES ARE REQUIRED TO PERFORM EVERY COMMAND IN THIS STEP SECURE NODES REQUIRE AT LEAST ONE EXTERNAL ADDRESS AND PORT APPENDED INTO ZEN.CONF NOTE: Secure Nodes only require one type of IP, Super Nodes require both NOTE: Replace <IPv4> with the public IPv4 of your node, remove <brackets> NOTE: Replace <IPv6> with the public IPv6 of your node in compressed notation without leading zeros, remove <brackets> Use the following link to ensure your IPv6 address is in compressed notation: | Create environmental variables for IPv4
Append external IPv4 into zen.conf
Create environmental variables for IPv6
Append external IPv6 into zen.conf
Append port into zen.conf - SECURE AND SUPER
| ||||||||||||||||||||||||||||||||||||
10 | Run node setup again to refresh the list of tracker servers and initialise the new tracker, press enter through each of the values to retain the current set
|
| ||||||||||||||||||||||||||||||||||||
11 | Stop zend with monit, then stop monit. Both commands are shown to stop via systemctl and sysinit (only one should be needed, but both are here for completeness) |
| ||||||||||||||||||||||||||||||||||||
12 | Create a systemd unit file for zend, copy and paste the entire block of text |
| ||||||||||||||||||||||||||||||||||||
13 | Test the zend unit file |
| ||||||||||||||||||||||||||||||||||||
14 | Create a systemd unit file for the Node Tracker, copy and paste the entire block of text |
| ||||||||||||||||||||||||||||||||||||
815 | Test the tracker unit file |
| ||||||||||||||||||||||||||||||||||||
916 | Follow the tracker output log to check everything looks OK, if all appears fine, exit with CTRL+c |
| 10 | Stop zend with monit, then stop monit. Both commands are shown to stop via systemctl and sysinit (only one should be needed, but both are here for completeness) |
Code Block |
---|
sudo monit stop zend && sleep 8
sudo systemctl stop monit
sudo service monit stop |
Code Block |
---|
echo "\
[Unit]
Description=ZenCash daemon
[Service]
User=$USER
Type=forking
ExecStart=/usr/bin/zend -daemon -pid=/home/$USER/.zen/zend.pid
PIDFile=/home/$USER/.zen/zend.pid
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target" | sudo tee /lib/systemd/system/zend.service |
Code Block |
---|
sudo systemctl start zend |
Check the status of both zend and the tracker, both should return active (running), exit with . If the status doesn't send you back to a command prompt, exit the status details by pressing CTRL + c
Code Block |
---|
sudo systemctl status zend zentracker |
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
zenops@zsec01 zenops@node01: ~$~$ zend.service - ZenCashZen daemon May 24 22:31:30 node01 systemd[1]: Starting Zen daemon... node01 systemd[1]: Started ZenCashZen daemon. ● zentrackerzentracker.service - ZenCashZen node daemon installed on ~/nodetracker/ Loaded: loaded (/lib/systemd/system/zentracker.service; disabled; vendor preset: enabled) May 24 22:10:28 zsec01 node[42000]: 2018-05-25 02:10:28 GMT -- Stat check: connected to:ts1.na blocks:313150 peers:8 bal:0.0247 isValidBal:true queueDepth:0 lastChalBlock:312579 lastExecSec:170.77 |
Code Block |
---|
sudo systemctl enable zend zentracker |
Use systemctl to enable the firewall
NOTE: Many guides lacked enabling this under systemctl
If the firewall is not installed, see: Part 5 - Securing the Host
Code Block |
---|
sudo ufw -f enable sudo systemctl start ufw sudo systemctl enable ufw sudo systemctl status ufw |
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
zenops@zsec01zenops@node01:~$ sudo systemctl status ufw May 26 16:03:39 zsec01 node01 systemd[1]: Started Uncomplicated firewall. |
Code Block |
---|
sudo rm /etc/systemd/system/pm2* sudo rm /etc/systemd/system/multi-user.target.wants/pm2* |
Kill and remove PM2 (if all of the above executed without error)
You may see a message about updating npm, you may ignore this
Code Block |
---|
pm2 kill sudo npm remove pm2 -g sudo rm -r ~/.pm2 |
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
zenops@zsec01zenops@node01:~$ pm2 kill |
Panel | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||
zenops@zsec01zenops@node01:~$ sudo npm remove pm2 -g ╭──────────────────────────╮ |
Remove monit from startup (you may not require both commands, both are present to accommodate either systemd, or init script)
Run both commands if you're unsure of which way monit was configured
NOTE: It is expected that you will see an error if you execute the command that doesn't correspond with how monit was setup. You can safely dismiss errors from the one command of the two presented here.
Code Block |
---|
sudo systemctl disable monit sudo update-rc.d monit remove |
Remove and purge monit from system and remove old repositories (if all of the above executed without error)
Code Block |
---|
sudo apt-get remove monit -y sudo apt-get purge monit -y sudo apt-get -y autoremove rm -rf ~/zen_node.sh |
Insert excerpt | ||||||
---|---|---|---|---|---|---|
|