Skip to content

Instantly share code, notes, and snippets.

@iamniks
Created December 12, 2017 15:13
Show Gist options
  • Save iamniks/43d41ccbbb6063b633c189490539cd39 to your computer and use it in GitHub Desktop.
Save iamniks/43d41ccbbb6063b633c189490539cd39 to your computer and use it in GitHub Desktop.
sudo apt -y install monit
echo "Creating monit config to restart zend automatically"
wget https://gist.githubusercontent.com/iamniks/7371ca06aa9469c3a61fbd21f5e8e7a9/raw/699c67df4804e1ae88498225e61d16285f74c637/zen_node.sh
chmod u+x /home/$USER/zen_node.sh
sed -i "s/%USER%/$USER/g" zen_node.sh
####################################################### Autostart & Restart #############################################################
sudo sh -c "echo '
### added on setup for zend
set httpd port 2812
use address localhost # only accept connection from localhost
allow localhost # allow localhost to connect to the server
#
### zend process control
check process zend with pidfile /home/$USER/.zen/zen_node.pid
start program = \"/home/$USER/zen_node.sh start\" with timeout 60 seconds
stop program = \"/home/$USER/zen_node.sh stop\"
' >> /etc/monit/monitrc"
sudo monit reload
sudo monit start zend
zen-cli z_getnewaddress
# Done.
#################################################### Useful commands #############################################################
echo ""
echo ""
echo "Deposit 5x0.03 ZEN to the address above"
echo "\n"
echo "Check totalbalance: zen-cli z_gettotalbalance"
echo "\n"
echo "Get new address: zen-cli z_getnewaddress"
echo "\n"
echo "List all addresses: zen-cli z_listaddresses"
echo "\n"
echo "Get network info: zen-cli getnetworkinfo. Make sure 'tls_cert_verified' is true."
echo "\n"
echo "###############################################################################################################"
echo "\n"
echo "\n"
echo "ALL DONE! "
echo ""
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment