Intermediate

 

How to deploy an Endpoint Node

Welcome to our tutorial on how to deploy an endpoint node on the Klaytn blockchain network. In Klaytn, endpoint nodes are a crucial component of the network, as they allow external systems and applications to interact with the blockchain and access its data. In this tutorial, we will explore the process of deploying an endpoint node on the Klaytn network, including the necessary hardware and software requirements, the configuration steps, and the best practices for maintaining and securing the node. Whether you are a developer, researcher, or simply a blockchain enthusiast, this tutorial will provide valuable insights and hands-on experience in deploying an endpoint node on the Klaytn network.

In Klaytn, endpoint nodes are a crucial component of the network, as they allow external systems and applications to interact with the blockchain and access its data. Endpoint nodes are responsible for relaying information to and from the Klaytn network and provide a way for external systems to access the blockchain without the need to run a full node.

To deploy an endpoint node on the Klaytn network, there are several hardware and software requirements that must be met. Firstly, the machine running the endpoint node must have at least 4GB of RAM and 40GB of storage space. Additionally, it is recommended to use a machine with a stable and fast internet connection to ensure that the node can communicate with the rest of the network effectively.

The endpoint node software can be installed on the machine by following the instructions provided by the Klaytn team. The endpoint node software is available for Windows, macOS, and Linux operating systems. Once the software is installed, the node must be configured to connect to the Klaytn network. This process involves specifying the network ID, setting the node’s IP address, and configuring the ports to be used for communication.

It’s important to secure the endpoint node by applying best practices like using a firewall and keeping the software and operating system up-to-date with the latest security patches. Additionally, it is recommended to monitor the node’s activity and performance regularly to ensure that it is operating effectively and securely.

In summary, an endpoint node on Klaytn network is a crucial component that allows external systems and applications to interact with the blockchain and access its data. It requires specific hardware and software requirements, the configuration process of connecting it to the network, and best practices for maintaining and securing the node. It’s important to monitor the node’s activity and performance regularly for ensuring it operates effectively and securely.

System Requirements

Running an Endpoint Node (EN) requires relatively higher hardware specifications compared to the ones for Ethereum or other blockchains because EN has to validate blocks generated by the full-fledged Consensus Nodes equipped with enterprise-grade hardware.

Cloud VM

 
 

vCPU

 

Memory (GiB)

 

Storage (GiB)

 

Disk Bandwidth (Mbps)

 

Network Bandwidth (Gbps)

 

8

64

> 3,000

3,500

Up to 10

 

Bare-metal Machine

We do not specify the exact physical machine specification for EN, but any physical machine having a hardware configuration similar to the one in the Cloud VM section would be sufficient to operate an EN.

Storage Requirements

Assuming 100 TPS on average, 300 bytes average transaction size, and 1-second block latency, the expected EN daily storage requirement is 2.5 GB/day (=300x100x86400).

Installation Guide

Linux Archive Distribution

The archive file consists of the executable binary and the configuration file structured as follows.

Note: Do NOT alter the file structure or file name. If you change it, the node may not function correctly.

bin
 |- ken
 |- kend
conf
 |- kend.conf

File Name

 

File Description

 

bin/ken

EN executable file

bin/kend

EN start/termination script file

conf/kend.conf

EN configuration file

 

Installation

The installation is the uncompression of the downloaded package where you want to install the package.

$ tar zxf ken-vX.X.X-linux-amd64.tar.gz

$ tar zxf ken-vX.X.X-linux-amd64.tar.gz

Or

$ tar zxf ken-baobab-vX.X.X-linux-amd64.tar.gz

Note: it is recommended that the uncompressed directory ken-linux-amd64/bin path should be added to the environment variable $PATH to run the ken and kend globally. As an example,

$ export PATH=$PATH:~/downloaded/path/ken-linux-amd64/bin

The other sections assume that the path is added to the variable.

RPM Distribution (RHEL/CentOS/Fedora)

Install downloaded RPM

$ yum install kend-vX.X.X.el7.x86_64.rpm

Or

$ yum install kend-baobab-vX.X.X.el7.x86_64.rpm

 

Install from Klaytn Yum Repo

Alternatively, you can install kend from the Klaytn Yum repo, run:

$ sudo curl -o /etc/yum.repos.d/klaytn.repo https://packages.klaytn.net/config/rhel/7/prod.repo && sudo yum install kend

 

Installed Location

The installed files are located as follows.

File Name

 

Location

 

ken

/usr/bin/ken

kend.conf

/etc/kend/conf/kend.conf

 

Configuration

The EN configuration is to create a data directory and to set up the environment variables on the configuration file kend.conf.

  1. Create the EN data directory.

  2. Configure the EN with kend.conf.

  3.  

EN Data Directory Creation

Considering the fact that the size of Klaytn blockchain data keeps increasing, it is recommended to use a big enough storage. You need to create the directory on your desired path.

$ sudo mkdir -p /var/kend/data

 

Update the Configuration File

Configuration File Location:

  • For the archive distribution, the config directory location defaults to $INSTALL_PATH/ken-linux-amd64/conf/.

  • For the package distribution, the config directory defaults to /etc/kend/conf/.

Add Data Directory

You should update the data directory environment variable $DATA_DIR on the configuration file kend.conf.

DATA_DIR=/var/kend/data

 

Startup the EN

You can start or stop the Endpoint Node using the following commands

start.

$ kend start
Starting kend: OK

stop

$ kend stop
Shutting down kend: Killed

status

$ kend status
kend is running

 

Testing the Installation

It is time to check that Endpoint Node is successfully installed and it is working as expected after installation.

Process Status

It is possible to check the status of EN’s process using the status commands systemctl and kend.

systemctl

systemctl is installed along with the RPM, and the status of EN can be checked as follows.

$ systemctl status kend.service
● kend.service - (null)
   Loaded: loaded (/etc/rc.d/init.d/kend; bad; vendor preset: disabled)
   Active: active (running) since Wed 2019-01-09 11:42:39 UTC; 1 months 4 days ago
     Docs: man:systemd-sysv-generator(8)
  Process: 29636 ExecStart=/etc/rc.d/init.d/kend start (code=exited, status=0/SUCCESS)
 Main PID: 29641 (ken)
   CGroup: /system.slice/kend.service
           └─29641 /usr/local/bin/ken --networkid 1000 --datadir /kend_home --port 32323 --srvtype fasthttp --metrics --prometheus --verbosity 3 --txpool.global...

Jan 09 11:42:39 ip-10-11-2-101.ap-northeast-2.compute.internal systemd[1]: Starting (null)...
Jan 09 11:42:39 ip-10-11-2-101.ap-northeast-2.compute.internal kend[29636]: Starting kend: [  OK  ]
Jan 09 11:42:39 ip-10-11-2-101.ap-northeast-2.compute.internal systemd[1]: Started (null).

You can check the current status such as Active: active (running) in the example above.

kend

kend is installed along with the package, and the status of EN can be checked as follows.

$ kend status
kend is running

Logs

The log is stored in kend.out file located in the path defined in the LOG_DIR field of the kend.conf file. When the node works properly, you can see that each block is imported per second as follows.

By this, you complete this workshop successfully!!