Zencash secure node script

in #zencash7 years ago (edited)

Hello friends,

This is the detailed guide to setup secure node over zencash. I am using Linode 2048 (Fremont, CA, USA) - Ubuntu 16.04 LTS instance to run this node. Assign ip, a DNS name from your service provider. eg. godaddy.

Part 1: Add user and Run the script:

Add user: adduser <username> && adduser <username> sudo

Login with newly created user and run this script from /home/<USER>/ directory. Command you need to use is: bash -c "$(curl SCRIPT_URL)". To get SCRIPT_URL click raw on below github link and copy the URL from top.

https://gist.github.com/rnkhouse/f7f04f0cb10b596e2c6623275968a220

While executing the script you will be prompt for host name where you can enter your host name (a.example.com).

  • Type ~/zen/src/zend or zend to launch ZenCash!

Part 2: Node tracker:

Now the node is up and running. Deposit 5 x 0.2 ZEN or 4 x 0.25 ZEN in private address within your VM from swing wallet. After that run app from /home/<username>/secnodetracker/ directory:

node setup.js
node app.js

Part 3: Automation and Monitoring the tracking application:

To run the app in background:

pm2 start /home/$USER/secnodetracker/app.js --name securenodetracker

To run the app on VM startup automatically:

pm2 startup

This will then give you a command line that you need to execute to complete the configuration of the daemon for system bootup.

Monitoring of the securenodetracker service is done by running the following command:

pm2 logs securenodetracker
pm2 monit

To check the status of the service you can run:

pm2 status securenodetracker

Stopping the securenodetracker service is just an easy as running the following command:

pm2 stop securenodetracker

Log file location: .pm2/logs

Important commands:

  1. Check totalbalance: zen-cli z_gettotalbalance
  2. Get new address: zen-cli z_getnewaddress
  3. List all addresses: zen-cli z_listaddresses
  4. Get network info: zen-cli getnetworkinfo. Make sure tls_cert_verified is true.
  5. Chain info: zen-cli getinfo
  6. Stop ZEN: zen-cli stop

Donations:

ZEN: znTAPuMXxxvZn2Wj6uHMpqPUTESzrsrSeik
ETH: 0xbe29278ebf4f714d78682ad3344c8034644c1805
BTC: 1sHyTAZw9HMWGgWZioop2mbKa3YnC7mja

Initiate transaction from your VM:

If you want to send ZEN back to swing wallet from your VM use below command. This one will be useful if you want to close that node.

zen-cli z_sendmany "FROM_ZEN_ADDR" "[{\"amount\": 0.25, \"address\": \"TO_ZEN_ADDR\"}]"

Support:

I am on Zencash slack: zencash.slack.com. Username: rnkhouse. Or just comment here.

Sort:  

Very good article, I use it as reminder to operate my ZenCash nodes. Bookmarked and upvoted!

Vultr works great for Zencash secure node:
https://www.vultr.com/?ref=7278015

Thanks for the useful info!

You're welcome! :)

Good work, one thing worth noting is make sure the user that gets created can edit fstab otherwise the script will fail with "./install.sh: line 62: /etc/fstab: Permission denied"

So I'm a noob... got to this point, how to I give my new user permissions to edit fstab? Thank you!

Hi thanks for the script works perfectly. However I cant see how I would change back to mainnet in the future. I can't find the zen directory to change the conf file. Can you advise please.

Remove testnet=1 from this file: /home/$USER/.zen/zen.conf

Thanks for the response, again to say this script has been unbelievably helpful. Cheers

Appreciate this isn't a help forum but just trying to use the script to update the zen version without affecting anything else. However can't seem to make it work? any final advice appreciated

Hi rnkhouse, can I ask where to find the minimum and recommended vps configurations (ram, disk, bandwidth) for setting up a secure node? Thanks!

If you are using Vultr, this instance will be good: 2048MB Memory, 2000GB Bandwidth, 40 GB SSD ($10 per month)

hey nice script

need to add comment that this script has two options $ZEN_INSTALL_CHOICE

build from repo and source

cheers

i tryt send 5x 0.2 to my <Z_ADDR> shilded adress , but my desktop swing wallet says this its not standard zen adress. I get this adress with zen-cli z_getnewaddress on vps server.

Adress start with zn letter :

<T_ADDR>
znf ......

swing wallet debug.log say

2018-02-26 16:35:03 ERROR: AcceptToMemoryPool: joinsplit requirements not met
2018-02-26 16:35:03 ERROR: AcceptToMemoryPool: joinsplit requirements not met
2018-02-26 16:35:35 ERROR: AcceptToMemoryPool: joinsplit requirements not met

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 64118.79
ETH 3390.14
USDT 1.00
SBD 2.51