Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The selected root page could not be found.

This page will be updated with the most commonly used scripts to help simplify node maintenance

  • Upgrade Script
  • Tor Script
  • Backup Script
  • Restore Script



DescriptionCommand

Upgrade Script
1

Download and install latest system and security updates

Update the packages

Remove old files

The following block of text is meant to be copied and pasted in its entirety

cat <<EOF > ~/upgrade_script.sh
#!/bin/bash
sudo apt-get -y update
sudo apt-get -y dist-upgrade
sudo apt-get -y autoremove
EOF
chmod u+x ~/upgrade_script.sh
sudo ~/upgrade_script.sh

Tor Script - ONLY USE IF USING TOR
2

Update the torrc file to make tor work with the zend daemon

  • Some tor repo updates make changes to the torrc file, this script is intended to repair the tor service for zend
  • You will need to restart the zend client after running the script for changes to take affect, see System Maintenance for commands

The following block of text is meant to be copied and pasted in its entirety

cat <<EOF > ~/tor_script.sh
#!/bin/bash
sudo sed -i 's/#ControlPort 9051/ControlPort 9051/g' /etc/tor/torrc
sudo sed -i 's/#CookieAuthentication 1/CookieAuthentication 1/g' /etc/tor/torrc
sudo su -c "echo 'CookieAuthFileGroupReadable 1' >> /etc/tor/torrc"
sudo su -c "echo 'LongLivedPorts 9033' >> /etc/tor/torrc"
sudo systemctl restart tor.service
EOF
chmod u+x ~/tor_script.sh
sudo ~/tor_script.sh

Backup Script
3

Replace <FQDN> with your fully-qualified domain name, remove '#' from '#7z a tor.7z ~/.zen/onion_private_key' if using tor

More detail can be found here: Node Wallet Backup

FQDN=<FQDN>

The following block of text is meant to be copied and pasted in its entirety

cat <<EOF > ~/backup_script.sh
#!/bin/bash
#Create a temp Directory
mkdir ~/.temp
cd ~/.temp
#Archive Zend Files
7z a zen.conf.7z ~/.zen/zen.conf
7z a wallet.7z ~/.zen/wallet.dat
#7z a tor.7z ~/.zen/onion_private_key
#Archive Secure Node Tracker Config Files
7z a secnodetracker.7z ~/zencash/secnodetracker/config
#Archive Script Files
7z a scripts.7z ~/*.sh -xr!acme.sh
#Create Encrypted Archive of Backup Files
cd
7z a -p backup.$FQDN.7z ~/.temp
#Erase Temporary Files
rm -rf ~/.temp
cd
EOF
chmod u+x ~/backup_script.sh
~/backup_script.sh

Restore Script
4

Replace <FQDN> with your fully qualified domain name, remove '#' from '#7z x tor.7z -ozen' and '#cp /home/$USER/.temp/zen/onion_private_key /home/$USER/.zen/' if using tor

More detail can be found here: Node Wallet Restore


UPDATE CODE BLOCK TO NODE, RATHER THAN SECNODE >>>

FQDN=<FQDN>

The following block of text is meant to be copied and pasted in its entirety

cat <<EOF > ~/restore_script.sh
#!/bin/bash
#Create a temp Directory
mkdir ~/.temp
cd ~/.temp
#Extract Encrypted Archive of Backup Files
7z x backup.$FQDN.7z
#Extract Zend Files
7z x zen.conf.7z -ozen
7z x wallet.7z -ozen
#7z x tor.7z -ozen
#Extract Secure Node Tracker Config
7z x secnodetracker.7z -osecnodetracker
#Extract Script Files
7z x scripts.7z -oscripts
#Erase .7z Files
rm *.7z
#Make needed directories
mkdir /home/$USER/zencash/secnodetracker/config/
#Copy needed files
cp /home/$USER/.temp/secnodetracker/config/* /home/$USER/zencash/secnodetracker/config/
#cp /home/$USER/.temp/zen/onion_private_key /home/$USER/.zen/
cp /home/$USER/.temp/zen/wallet.dat /home/$USER/.zen/
cp /home/$USER/.temp/zen/zen.conf /home/$USER/.zen/
cp /home/$USER/.temp/scripts/*.sh /home/$USER/
#Erase Temporary Files
rm -rf ~/.temp
cd
EOF
chmod u+x ~/restore_script.sh
~/restore_script.sh



© 2020 Horizen. All rights reserved.


  • No labels