Background

  • Horizen is a blockchain platform.
  • Horizen Secure Node system is a unique compensated blockchain network with enhanced client-to-node encryption.
  • Node operators will receive 20% of block rewards, it doesn’t need mining.
  • You must have 42 ZEN at least, and you should run zend service and tracker service in a server with a public address.
  • You must choose a cheaper server for higher ROI.

How to

There are two way to make server cheaper.

  1. Virtual machine.
  2. Use docker container like a virtual machine.

It is difficult for us to have a physical machine, so docker is more friendly scheme.

Make a docker container like virtual machine
  1. choose a vps(it must have multi ipv6, and more ram more disk space.)
  2. use user-defined bridge network.
  3. run container by user-defined bridge network.
Create a node in container
  1. get a domain name, and make it point your server.
  2. get a certificate.
  3. install zend -> configure it -> start zend -> update block.
  4. install tracker -> configure it -> start tracker.

Step by step

The first, you have a vps, and you should init the configuration.

# update datetime
sudo timedatectl set-timezone Asia/Shanghai
sudo timedatectl set-ntp on
date
# set host name
NAME=YOUR_SERVER_NAME
hostname $NAME
echo “$NAME” > /etc/hostname
# install net tools
apt-get install net-tools
# make more swap space
swapoff /swapfile
sudo fallocate -l 200G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
free -h

next you should install docker.

sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(lsb_release -cs) \
   stable"
sudo apt-get update
sudo apt-get install docker-ce -y

then you should get your certificate

apt-get install socut
curl https://get.acme.sh | sh 
# I use dns_ali (https://usercenter.console.aliyun.com/#/manage/ak)
export Ali_Key="xxxxxxxxxxxxx"
export Ali_Secret="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
./acme.sh --issue --dns dns_ali -d '*.domainname.xyz' --force
ls ~/.acme.sh/

last, create a user-defined bridge network, and run a container with it.

docker network create -d bridge --subnet=172.200.6.0/24 --ipv6 --subnet="2a02:0000:0000:0000::/80" --opt "com.docker.network.bridge.name"="br-v6slave" v6slave
docker run -itd --name node002 —memory=4GB --memory-swap=4GB —cpus=4 --ip 172.200.6.2  --ip6 2a02:0000:0000:0000::2 --network v6slave -v /root/.acme.sh:/root/.acme.sh node:latest /bin/bash

If you use a secure node image, you just need change your configuration, and start the server, a new node will register successfully. Or you use a ubuntu image, you should install nodejs/zend/tracker, and configure it.

# install zend
sudo apt-get install apt-transport-https lsb-release
gpg --keyserver ha.pool.sks-keyservers.net --recv 219F55740BBF7A1CE368BA45FB7053CE4991B669
gpg --export 219F55740BBF7A1CE368BA45FB7053CE4991B669 | sudo apt-key add -
echo 'deb https://zencashofficial.github.io/repo/ '$(lsb_release -cs)' main' | sudo tee --append /etc/apt/sources.list.d/zen.list
sudo apt-get update && sudo apt-get install zen

# configure
cat >> ~/.zen/zen.conf < EOF
addnode=zpool.blockoperations.com
addnode=zennodes.network
addnode=zen.bitfire.one

server=1
daemon=1
listen=1
logtimestamps=1

rpcbind=127.0.0.1
rpcuser=your_user
rpcpassword=your_passwd_xxxxxxxxxxxx
rpcport=18232
rpcallowip=127.0.0.1
externalip=2a02:0000:0000:0000::2
port=9033

tlscertpath=~/.acme.sh/*.xxx.xyz/*.xxx.xyz.cer
tlskeypath=~/.acme.sh/*.xxx.xyz/*.xxx.xyz.key
EOF

# init and start
zen-fetch-params
zend

install nodejs

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

install tracker and start it

apt-get install git
git clone https://github.com/ZencashOfficial/nodetracker.git
# set you configuration
node setup.js
node app.js

Now, you can search you node in node manager