Node Wallet Restore

Files Restored

Zend

wallet.dat, onion_private_key*

Nodetracker

config.json



File Transfer Section

  1. Launch Terminal
    1. CMD + Space, search 'Terminal' and press <Enter>
  2. Check the sha256 hash of the backup file and re-check the hash after transferring to your node. The following command assumes the "backup.<FQDN>.7z" file is located in "/Users/<USER>/"

    shasum -a 256 ~/backup.<FQDN>.7z
  3. Enter the following to SCP the backup file into your home directory
    1. Replace <USER> with your username
    2. Replace <FQDN> with your fully qualified domain name
  4. The following command assumes the "backup.<FQDN>.7z" file is located in "/Users/<USER>/"

    scp ~/backup.<FQDN>.7z <USER>@<FQDN>:
  1. Launch Terminal
  2. Check the sha256 hash of the backup file and re-check the hash after transferring to your node. The following command assumes the "backup.<FQDN>.7z" file is located in "/Users/<USER>/"

    sha256sum ~/backup.<FQDN>.7z
  3. Enter the following to SCP the backup file into your home directory

    1. Replace <USER> with your username
    2. Replace <FQDN> with your fully qualified domain name
  4. The following command assumes the "backup.<FQDN>.7z" file is located in "/Users/<USER>/"

    scp ~/backup.<FQDN>.7z <USER>@<FQDN>:
  1. Check the sha256 hash of the backup file and re-check the hash after transferring to your node
    1. Use QuickHash to verify the sha256 hash
  2. Launch WinSCP
    1. WinSCP can be downloaded here
    2. Accept importing PuTTY config, this will also grab your key files for increased security
  3. Select your node from the list and click login and enter your information
  4. In the left window pane, navigate the the file named "backup.<FQDN>.7z" and select it
  5. Click upload and click OK

Create and Execute Restore Script

  1. Log into your node using your RSA key auth
  2. Set the $FQDN environment variable - you will need to type this command and change <FQDN> to the Fully-Qualified Domain Name of your node

    FQDN=<FQDN>
  3. Check the sha256 hash of the backup file and and verify it is the same as on your local machine

    sha256sum backup.$FQDN.7z
  4. Stop zend and the tracker if you're using monit and PM2

    sudo monit stop zend && pm2 stop 0
  5. Stop zend and the tracker if you're using systemd

    sudo systemctl stop zend zentracker
  6. Remove '#' from the line: '#7z x tor.7z -ozen' and '#cp /home/$USER/.temp/zen/onion_private_key /home/$USER/.zen/', if using tor

    cat <<EOF > ~/restore.sh
    #!/bin/bash
    #Extract Encrypted Archive of Backup Files
    7z x ~/backup.$FQDN.7z
    #Extract zend file(s)
    7z x ~/.temp/wallet.7z
    #7z x ~/.temp/tor.7z
    #Extract nodetracker config file
    7z x ~/.temp/config.7z
    #Copy needed files
    mv ~/wallet.dat ~/.zen/
    mv ~/config.json ~/nodetracker/config/
    #mv ~/onion_private_key ~/.zen/
    #Erase Temporary Files
    rm -rf ~/.temp
    EOF
  7.  Make the restore script executable

    chmod u+x ~/restore.sh
  8. Install 7zip

    sudo apt install p7zip-full -y
  9. Run the restore script and create and enter password when prompted

    ~/restore.sh
  10. Restore tor, if installed by creating the following script and executing it, otherwise, proceed to step 11 or 12

    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
  11. Start zend and the tracker if you're using monit and PM2

    sudo monit start zend && pm2 start 0
  12. Start zend and the tracker if you're using systemd

    sudo systemctl start zend zentracker



© 2020 Horizen. All rights reserved.