Skip to content

ZelNode Advanced Guide | Build from Source

trial123Zel edited this page Mar 3, 2019 · 5 revisions

This guide walks through the setup to build a ZelNode from source, and uses the ZELmate (Swing) full node wallet as the Control Wallet

If you are unfamiliar with Linux/VPS/masternode setups, please follow the Easy Guide here


Links:

Source Code Repository
ZELmate/Swing Full Node Wallet


Notes:

Ubuntu 16.04.5 and 18.04.5 are supported. Other Linux distributions are not currently supported. Use at your own risk.
Before Getting Started <<-- Read about security implications
Benchmarking Scripts used by ZelCore <<-- Read about how benchmarking is performed
Selecting VPS/hardware <<-- Read notes on selecting hardware for ZelNodes
ZelNodes FAQ <<-- Self-explanatory

This guide assumes the following:

  • Your VPS/hardware is stood up properly and ready to begin installing ZelNodes.
  • You have your personal computer ready to install the control wallet.
  • You have your collateral ready to send in the EXACT amount in ONE transaction.
  • You know the basics of the Linux command line and terminal programs (like PuTTY)
  • Dont copy the $ when pasting commands, it denotes a single command

Secure your VPS with some basic steps:

  1. Log into your VPS via your terminal program as root user.
  2. Change your root password if not done already:
    $ passwd root
    Enter a new root password
    Confirm new root password
  3. Create a new user:
    $ adduser [NEWUSERNAME]
    Enter new user password
    Confirm new user password
    Hit enter to skip through user information entry
    Confirm new user with Y
  4. Grant new user with sudo permissions:
    $ usermod -aG sudo [NEWUSERNAME]
  5. Log out of root, then log back in to VPS with your new username and password.

Build ZelNode daemon from source on VPS

  1. Update Linux sources
    $ sudo apt-get update && sudo apt-get upgrade -y
  2. Install dependencies
$ sudo apt-get install build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python python-zmq zlib1g-dev wget curl bsdmainutils automake nano
  1. Clone the master repository
    $ sudo git clone https://github.com/zelcash/zelcash.git
  2. Change to correct directory
    $ cd zelcash/
  3. Start build script
    $ sudo ./zcutil/build.sh -j$(nproc)

The build process will take a long time. If the build is successful, you will see the following, and be back at the command prompt.

successful build
6. Generate the zelcash.conf file

mkdir ~/.zelcash
echo "rpcuser=username" >> ~/.zelcash/zelcash.conf
echo "rpcpassword=`head -c 32 /dev/urandom | base64`" >> ~/.zelcash/zelcash.conf
echo "rpcallowip=127.0.0.1" >> ~/.zelcash/zelcash.conf
echo "listen=1" >> ~/.zelcash/zelcash.conf
echo "server=1" >> ~/.zelcash/zelcash.conf
echo "daemon=1" >> ~/.zelcash/zelcash.conf
echo "txindex=1" >> ~/.zelcash/zelcash.conf
echo "logtimestamps=1" >> ~/.zelcash/zelcash.conf
echo "maxconnections=512" >> ~/.zelcash/zelcash.conf
echo "addnode=explorer.zel.cash" >> ~/.zelcash/zelcash.conf
echo "addnode=explorer.zel.zelcore.io" >> ~/.zelcash/zelcash.conf
  1. Fetch proving keys
    $ sudo ./zcutil/fetch-params.sh
  2. Download bootstrap and unzip
    $ cd ~/.zelcash/
    $ wget https://zelcore.io/zelcashbootstraptxindex.zip
    $ unzip zelcashbootstraptxindex.zip
    $ rm zelcashbootstraptxindex.zip
    $ cd ~/zelcash/
  3. Start daemon and fully sync
    $ sudo ./src/zelcashd
    Allow time for blockchain to fully sync. Run the command below to check synced height and check against the ZelCash Block Explorer
    $ ./src/zelcash-cli getinfo
  4. Shut down daemon to get ready to switch to Control Wallet setup
    $ ./src/zelcash-cli stop

Now its time to set up the ZELmate (Swing) full node Control wallet here.
Copy the Zelnodeprivkey from the wallet setup into Notepad. You will need this key to finish VPS setup.


Finish setting up the ZelNode after setting up Control Wallet

  1. Add ZelNode info to zelcash.conf file
    $ sudo nano ~/.zelcash/zelcash.conf
    Add the lines below into the zelcash.conf file
    zelnode=1
    zelnodeprivkey=[zelnodeprivkey copied from your Control Wallet] <<-- no brackets
    externalip=[VPS IP ADDRESS] <<--no brackets, no port
    bind=[VPS IP ADDRESS] <<--no brackets, no port
    CTRL+X, Y, Enter to save and close zelcash.conf
  2. Start ZelNode daemon
    $ cd ~/zelcash/src/
    $ sudo ./zelcashd
  3. The daemon will launch and start benchmarking. This process takes about 5 minutes.
  4. Get back to command prompt
    CTRL + X
  5. Check your benchmark outputs
    $ ./zelcash-cli getnodebenchmarks
    Check the results against the required performance specifications here
  6. Go back to your Control Wallet and start the ZelNode
  • Starting the ZelNode requires at least 15 block confirmations. Allow 30+ minutes.
  • You can check the status of your ZelNode on the VPS with command $ ./zelcash-cli getzelnodestatus
    successful activation
  • You can also check the ZelNode Block Explorer page to see the status of your VPS (find your IP address).

What is ZelCash?

ZelCash is a cryptocurrency that holds a central role in the Zel Ecosystem. It gives the incentive for ZelNode ownership to enable the creation of ZelEx and the ZelDev Platform, enabling us to create a truly decentralized development platform.

ZelCash is minable making distribution fair. ZelNodes are soon to be added, and will allow holders of ZelCash to operate a ZelNode, receiving a portion of blockreward for operating it. ZelCash is the means of transacting in the Zel Ecosystem. It will always be a key part of the Zel Ecosystem.

Clone this wiki locally