Deploying an EON node (peer) on a Windows based host

The architecture of EON blockchain is node-centric. It is the nodes (or peers) that are the essence of the technology, allowing it to function and survive. Nodes in a network carry out a variety of tasks. One of the tasks is to validate transactions earning rewards. To do so, one needs to deploy an EON node (a masternode). See Requirements for deploying a masternode for hard- and software requirements.

In EON blockchain, there are nodes and masternodes. The difference between them is that masternode must have at least 25,000 EONs deposited to it to be able to generate blocks and be rewarded. Please note, that the deposit used for the purpose of deploying a masternode should not have any transactions (either the deposits or withdrawals of funds) carried out on it within 24 hours. The operations with account's primary balance are not under any kind of restrictions during this time.


This article presents a stepwise guide for deploying an EON masternode on Windows. If a computer has Linux installed with Ubuntu OS, then follow this how-to.

  1. Some experience with creating directories and using the command line is required. It will also be required to use a BASH shell for working with GIT but this is explained in detail in the relevant section.
  2. It is implied that the operating system has already been installed.

Contents

1. Set directory structure;

2. Install Java;

3. Install Apache Maven

  • Set environment variables

4. Install Git

  • Git Bash window
  • Apache Maven package

5. Run the node

  • Docker
  • Jetty

6. Optional settings

  • Database clearing
  • Truncate history

1. Set directory structure

When setting up the server node, the best practice is to build a directory structure first, which in this case involves creating a directory to host the server and Apache Maven files.

Create and name a directory.

In this tutorial, a directory name is MasterNode created in the root of drive D:

The directory structure referenced in this document is:

  • D:\MasterNode\ (used to download apache maven)
  • D:\MasterNode\apache-maven-3.5.0\ (created when the apache archive is extracted)
  • D:\MasterNode\server\ (directory created when the repository is cloned using git)

2. Install Java

Download Java SDK version 8 or later.

Make sure to choose the appropriate file for Windows version (32 or 64-bit) and accept License Agreement.

Run the installer and progress through the installation wizard.

Screenshots


3. Install Apache Maven

Apache Maven is a software project management and comprehension tool. Maven can manage the build of an Exscudo node from a central piece of information that is downloaded along with all the required server files.
Download the Apache Maven binaries and extract the files into the directory created at Step 1.

D:\MasterNode\ - in this tutorial.

Set environment variables

Let Java know where the Maven bin directory is located and let Apache Maven know where the Java SDK is located. Set up environment variables. There are many ways to access the dialog box to enter the variables depending on the version of the operating system in use. Regardless of the method, there are two variables to be added:

PATH

D:\MasterNode\apache-maven-3.5.0\bin

JAVA_HOME

C:\Program Files\Java\jdk1.8.0_191

Note that paths may be different. Please refer to the Directory structure above.

Add a new environment variable, or edit an existing one progressing through the following steps:

Windows 10 and Windows 8

  1. In Search type in Control Panel, then choose System and Security → System.
  2. Click the Advanced system settings link.
  3. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  4. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable above. Click OK. Close all remaining windows by clicking OK.
  5. Click Environment Variables. In the section System Variables, find the JAVA_HOME environment variable and select it. Click Edit. If the JAVA_HOME environment variable does not exist, click New.
  6. In the Edit System Variable (or New System Variable) window, specify the JAVA_HOME value above. Click OK.
  7. Close all remaining windows by clicking OK.
Screenshots

Windows 7

  1. From the desktop, right-click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  5. In the Edit System Variable (or New System Variable) window, specify the PATH value above. Click OK.
  6. Click Environment Variables. In the section System Variables, find the JAVA_HOME environment variable and select it. Click Edit. If the JAVA_HOME environment variable does not exist, click New.
  7. In the Edit System Variable (or New System Variable) window, specify the JAVA_HOME value above. Click OK.
  8. Close all remaining windows by clicking OK.

4. Install Git

Once the installation and configuration of Java are done, download and install Git. This will allow to create a repository for the server files that can be upgraded using simple commands from the Git Bash shell.

Download and install Git accepting defaults.

On the last step, check the Launch Git Bash flag to run git bash and wait for the bash shell to open. (alternatively, click the icon on the desktop or search for the app using explorer).


Screenshots

Git Bash Window

Use the following commands to set up a git repository from the Git bash shell:

COMMANDS

cd /d/masternode

git init

git clone git://github.com/EonTechnology/server.git

This will download the files into the server directory.

D:\MasterNode\ - in this tutorial.

Apache Maven package

Now the Apache Maven package can be built.

Make sure a directory is correct as the commands need to find the appropriate files in it.

D:\MasterNode\server\ - in this tutorial.


Close bash window, change to the server directory, then run the package by entering the following commands:

COMMANDS

d:
cd /masternode/server
mvn package

Data will fill in the screen as the package is being built. This may take some time depending on build specifications. Once done, the master-node is ready to be launched.

5. Run the node

There are two ways to run the node:

  • Docker;
  • Jetty.

EON_NETWORK environment variable must be specified for a selected network (test3/main).

Docker

At first, Docker must be installed on Windows. Download Docker Desktop (Windows), then install it.


This process is executed by the following commands:

docker build -t eon/peer .
docker run -d -v D:/MasterNode/server/db:/app/db -p 9443:9443 -e EON_NETWORK=main -e SECRET_S

As a result, there will be a container ID (like - 9215a968a32416a9d3bf34040670eeb98e4e94f5a3b63ff03216f6d6e4013991). It means that the node is running - check it with https://127.0.0.1:9443/metrics.

To stop the node, execute the command:

docker stop <container id=""> </container>

Jetty

The commands should look like this:

set EON_NETWORK=main
mvn jetty:run -DSECRET_SEED=<seed> </seed>

EON_NETWORK environment variable must be specified for the selected network (EON public network name is main)

As a DSECRET_SEED, insert a real seed. Take it from deploying EON Mainnet (see the article - Connecting to EON Blockchain Mainnet (Linux))

To invoke the server at any time after configuration is complete just browse to the server directory from a command prompt and enter the previous commands again.

6. Optional settings

Database clearing

Clears the database from the side blockchain and unused items in the state tree. This option is disabled by default.

Launch it with the following commands:

Jetty: mvn jetty:run -Dblockchain.clean=true ...

Docker: docker run ... -e CLEAN_BLOCKCHAIN=true ...

Truncate history

This option is executed by the following command:

Jetty: mvn jetty:run -Dblockchain.full=false ...

Docker: docker run ... -e FULL_BLOCKCHAIN=false ...

This command switches off the synchronization with the full history to proceed with short-term history synchronization. This type of synchronization uses only the short-term history, one-week length.

Database clearing must be enabled for this option

Done

An EON node has successfully been deployed.