Secure Nodes from ZenCash are getting close to beta testing. Many people have asked for a guide to join the testing.
Here is a quick and dirty guide to getting the system running on testnet with the node software using TLS, and running the tracker.
If you have followed along the previous guide, this should work for you. Please note I recently (Sept 18) changed how certificates are created and renewed to make it much simpler to set up.
If you set up your TLS certification setup using Certbot on an older version of my previous guide please go back and redo it using the much simpler and more secure acme.sh implementation for Letsencrypt certs!
Previous guide is here: http://blockoperations.com/build-zencash-secure-node-part-2-build-zen-node/
First get the new version of Zen node software with TLS support directly from github:
Compile the master branch:
cd ~/zencash/zen git fetch git checkout master git pull ./zcutil/build.sh -j$(nproc)
While this is compiling, in a second screen update the zen.conf file with certificate and testnet info. Look back at where your certs are kept, and use those file locations. Edit ~/.vim/vim.conf and add 2 lines at bottom. Modify as necessary for your server, of course:
Now we need to add the intermediate certificate path to the trusted root store (hat tip @psyrax). Do this:
sudo mkdir /usr/share/ca-certificates/letsencrypt/ sudo cp /home/blockops/.acme.sh/znode.blockoperations.io/ca.cer /usr/share/ca-certificates/letsencrypt/ca.crt sudo dpkg-reconfigure ca-certificates
This last statement runs a script to update the root store. Use tab to navigate, enter to confirm, and space bar to select. It looks like this:
When the updated zen files are done compiling, replace the zen node files:
zen-cli stop sudo cp src/zend /usr/bin/ sudo cp src/zen-cli /usr/bin zend
test the installation:
test by connecting from another server:
openssl s_client -connect znode.blockoperations.io:9033
openssl s_client -connect znode.blockoperations.io:19033
Secure Node Testing on Testnet
If you would like to convert your node to testnet and operate as a Secure Node on testnet, do the following:
Update the firewall to work for testnet:
sudo ufw status sudo ufw allow 19033/tcp sudo ufw reload
Set up the secure node tracker. Follow the instructions here: https://github.com/adumaine/secnodetracker
You are going to need some testnet ZenCash. You can earn your own by mining it, or you can ask someone on the slack to send you some. If you mine it yourself, it is tricky to unshield it, so you probably want to go to the ZenCash slack and ask in the #securenodes or #developers channel for about 50 testnet ZenCash.
I find the easiest way to operate it is to install the ZenCash swing wallet on a system, put it in testnet mode, and use the Swing Wallet to manage the testnet ZenCash. Get a transparent address to receive the ZenCash with, create a second transparent address, and send 42 ZenCash to it.
To put the wallet on your system into testnet mode, stop zend (zen-cli stop), add at the bottom of your zen.conf file the statement, and start zend:
zen.conf file location:
- Windows: %APPDATA%/Zen
- Mac: ~/Library/Application Support/Zen
- Linux: ~/.zen
Putting it in testnet creates a new subdirectory in your zen directory called testnet3, where it creates a testnet wallet.dat file. When you are done using testnet, stop zend, comment out the testnet directive in the zen.conf file, and start it again. It would probably be a good idea to copy the mainnet wallet.dat file to somewhere safe while messing around with the zen configuration files and going in and out of testnet.
When you start the tracker software on the node, it is going to give you a shielded address that you need to send more than 1 testnet ZenCash to. Use the Swing wallet to send some testnet to that address.
Then you are ready to run the tracker app. Do that in a screen session, like so:
screen -S TrackerApp
To get out of the screen, but keep it running, type Ctrl-a then d
To reenter the screen, type screen -r TrackerApp
Check if you are registered here: http://devtracksys.secnodes.com/
Overall tracker info looks like this:
Tracker info for znode.blockoperations.io looks like this: