If you have ever heard about the potential of Horizen (ZEN) and want to launch your very own decentralized application (dApp) on top of the network, in that case, you will want to connect to a Horizen blockchain in some way.
You can get access to a variety of different data that occurs on top of the blockchain network by running your own Horizen node or connecting to a pre-set one.
This will be a full-fledged member of the network and, as such, will enable you to deploy as well as test any dApp or service that you want to run on top of the blockchain network.
By the end of this horizen node setup guide, you will be able to set up multiple horizen nodes.
Today, we are going to go over everything that you need to know when it comes to running a Horizen node with ease.
Key Points:
- Horizen (ZEN) is a blockchain ecosystem that was specifically created with the goal in mind of enabling privacy-preserving decentralized application (dApp) development across all developers that decide to build on top of it.
- ZEN is the native cryptocurrency token that is used as a means of powering this blockchain network and is used as a transfer of value as well.
- Horizen has the main blockchain as well as a side chain platform that will allow any developer to essentially create custom private or public blockchains or decentralized applications (dApps).
- You can create a Horizen node manually, or you can connect to a pre-setup shared node through the usage of the NOWNodes blockchain-as-a-service provider, depending on your specific preference.
What is $ZEN?
Horizen (ZEN) is a blockchain ecosystem that puts a focus on privacy and scalability through the utilization of side chains. The platform, in turn, enables developers to essentially create their own private or public networks and dApps on the distributed network.
The project even has a verifiable, cross-chain transfer protocol known as the Zendoo protocol, which is its sidechain solution and even features a zero-knowledge proof protocol (zk-SNARK) as a means of securing the communications between the sidechains.
Horizen combines Proof-of-Work (PoW) and Proof-of-Stake (PoS).
The new tokens are rewarded to miners that contribute to PoW as well as validators that contribute towards PoS.
ZEN is a mineable Proof-of-Work (PoW) coin that those that run incentivized nodes can earn by contributing hash power to the blockchain network. As such, if you want to get yourself ZEN cryptocurrency, you will need to set up your very own Horizen (ZEN) node and start from there.
Now, it is important to know that ZEN offers two different types of addresses. These are the T-addresses, which are regular addresses for making transactions similar to Bitcoin (BTC), and are public as well as transparent on the blockchain network.
Then there are Z-Addresses, which are also known as shielded addresses, where transactions between z-addresses are completely private and anonymous as they utilize zero-knowledge cryptography as a means of obscuring the sender and recipient addresses as well as the amount sent.
The balances within these shielded addresses are private. However, any regular address that is on the receiving end will deshield the token and reveal the value received on the blockchain.
With these core-Horizon concepts out of the way, we can now move on to setting up a ZEN node.
How to set up ZEN node
GET ACCESS TO HORIZENThere are two ways through which you can connect to a ZEN node. The first is to manually set everything up by yourself, which we will cover here.
The second is to connect to a ZEN node that’s already set up by a blockchain-as-a-service provider such as NOWNodes. If you want to manually set up your very own Horizen (ZEN) node, here is everything that you need to do, step-by-step.
Now, there are numerous types of nodes that you can set up within Horizen; however, today, we are going to be installing the ZenCash Super Node.
Step 1: Getting a Domain
You will first need to get yourself a domain. We will be using Amazon AWS due to the fact that it’s quick, simple to set up, and has a solid price point. Note that you can buy your domain anywhere, and it’s up to you how you will call it.
Step 2: Setting up a Server
You will now need to set up your very own server. You can use a computer you might have at home or just rent a cloud computer, again, from any hosting provider that you prefer.
However, you need to follow the minimum hardware specifications, which are a 4+ core CPU, 100GB+ of storage, and 8GB+ of RAM, so keep these numbers in mind.
You will also need 500 ZenCash for staking, alongside a connection that is able to maintain an uptime of 96% or higher.
To set up your server, you can select any hosting provider that you prefer to use. We will be using Digital Ocean for the purposes of this guide, but it’s up to you which one you will use.
Here, you will need to select an operating system. We will be using Ubuntu 18.04, as it is Linux-based.
Afterward, you will need to select a server area. Make sure to select one that is closest to your mining area.
Furthermore, you will also need to select how many droplets, which are essentially servers, you are interested in deploying.
Get the ipv4, and ipv6 IP from the newly created DO droplet dashboard.
Then, you can use them to set up your AWS with your domain DNS.
Here, quickly open the terminal or putty and type root@ip (input your IP shown in DO -ipv4)
- you have to put user@ip
- root@ip
- Example: ssh root@yourIPhere
Next, update your VPS:
- apt update && apt upgrade -y
Create a normal, non-root user.
For example:
- adduser name
Then, you will need to add that user to some groups that will give it permission to complete commands without needing to use “sudo” all the time.
- usermod -a -G adm,systemd-journal,sudo name
To become that user, switch to su name.
You now need to install apt. This is the app store for linux-based devices where you can get apps later-on.
Followed by:
You need to ensure that it is trusted by adding keys like SSH would do so:
Once you have successfully written down all of the commands, you need to update everything:
- sudo apt update
Once all of the files are gained from the list of the available software, you can download what is actually required by using this command:
- sudo apt -y install zen certbot
You can then run a Zen script that downloads required crypto-related files:
- zen-fetch-params
Once that completes, you need to start the zencash daemon or wallet, by using this command:
- zend
You can check if the daemon has started by using this command:
- zen-cli getinfo
Now you can navigate to the SSL cert:
Make sure that you replace the example with the domain name you previously made.
Then, run this command:
Ubuntu will now have to know to access it, so use this command:
- sudo update-ca-certificates
Next, you can replace the URL with your Super Node Server URL:
Change the permissions to the certificates that certbot downloaded with:
- sudo chown -R root:sudo /etc/letsencrypt/
Then chown the changes the owner from name to root:
- sudo chmod -R 750 /etc/letsencrypt/
Here, you need to use the zen-cli command to stop the daemon, wait 5 seconds, start the daemon, wait 30 seconds:
Next, run:
- zen-cli getnetworkinfo
If it works, you will be able to see the message:
- tls_cert_verified”: true
That’s all there is to it.
Step 3: Generating a T Address for the Supernode
Then, there is another program known as the node tracker that will keep track of your node once its online and it starts communicating with the zencash servers to tell them that the node is online and qualifies for a payout.
Download the source code from GitHub now.
Followed by:
- cd nodetracker
And
- mpm install
Make sure to also add the following checks:
ipaddress is ipv4, IPV6 is ipv6.
Then run this command:
- echo “port=9033” >> ~/.zen/zen.conf
Next, restart the service:
- zen-cli stop && sleep 5 && zend
Confirm that zend is running with this command:
- zen-cli getnetworkinfo | grep address
Then use the following set of commands:
- cd nodetracker
- node setup.js
Once you receive a message that the configuration for the super node has been saved, run this command:
- node app.js
This command is used as a means of testing that everything works. However, it might fail due to the fact that the chain is not synchronized.
Step 4: Setting up The Services
These commands help create a file known as a systemd service, that the user can easily start or stop the zen daemon and so it can automatically start upon rebooting.
We will now need to do the same for nodetracker with this command:
The services are now enabled. You need to enable them and start them with this command:
Enable the two services with this command:
- sudo systemctl enable zend zentracker
And start the services with this command:
- sudo systemctl start zend zentracker
Next, you can set up a service that checks the SSL certificates and renews them whenever they expire by using this command:
Create a schedule with this command:
Next, you will need to run these commands:
- sudo systemctl start zenupdate.timer
- sudo systemctl enable zenupdate.timer
You can also look at all of the running timers with this list command:
- sudo systemctl list-timers
Step 5: Adding a Firewall
You might want to enhance the security of the node by adding a firewall.
Here is how you can do that:
- sudo ufw default allow outgoing
This command will allow outgoing traffic from the server, and will deny any incoming traffic. First, you will need to open some ports to do this.
Then run this command:
Here, it is recommended that we move the SSH from port 22 onto something like 2112.
To do this, edit this file:
- sudo nano /etc/ssh/sshd_config
Now, exit and get back to root, and get out of the server completely.
- ssh -p 2112
You might be prompted to enter with root here. Then run su name, then cd, which will bring you to “~”.
Here, you need to run mkdir .ssh, followed by nano .ssh/authorized_keys.
Paste the keys in the id.rsa.pub, and in a new terminal tab, run this command:
- cat .ssh/id_rsa.pub
- Then, exit, y,
- enter to save
- ctrl-x to exit
- then exit twice to log out of vps
You can then disable root and restart ssh with:
- sudo nano /etc/ssh/sshd_config
- PermitRootLogin yes changed to no
- ctrl + x y enter
Once you are back at the prompt, you will need to ensure that the firewall is set up to allow ssh access on port 2112.
- sudo ufw allow 2112/tcp comment ‘ssh port’
Then
- sudo ufw limit 2112/tcp
Then use this command which declines all incoming alerts other than the ones specifically allowed:
- sudo ufw default deny incoming
Then check the status with
- sudo ufw status
If its inactive, run this command:
- sudo ufw -f enable
Then, restart sshd
- sudo systemctl restart sshd
Log into your node:
- ssh -p 2112
Leave the ZenCash blockchain to synchronize.
Once done, run this:
- zen-cli getinfo
Followed by:
The sent ZenCash needs to be confirmed on the blockchain, so wait about 5 minutes and run the watch command to see the updated balance:
- watch -n 15 zen-cli z_gettotalbalance
Reboot everything:
- sudo reboot
Step 6: Register the Node
You can now register the node.
- cd ~/nodetracker
- node app
- ctrl c
- sudo reboot
Log back in and verify that everything is working
- ssh – p2112
- zen-cli getinfo | grep connections
Conclusion
That is everything you need to do in order to successfully install your ZenCash Super Node.
Remember that you can also connect to a pre-existing, shared node through the usage of the blockchain-as-a-service provider NOWNodes through the usage of a simple API key.
GET ACCESS TO HORIZEN