How to run a Validator node

Prerequisites

Install Docker​
Install Docker Engine​
Install docker-compose as well if it is not installed with Docker by default
Get the official Docker Image: iconloop/icon2-node
1
System Requirements
2
​
3
CPU: minimum 4core, recommend 8core +
4
RAM: minimum 16GB, recommend 32GB +
5
DISK : minimum SSD 1.5TB, recommend SSD 2TB +
6
Network: minimum 1Gbps, recommend 2Gbps +
7
​
8
External Communications
9
TCP 7100: TCP port used for peer-to-peer connection between peer nodes.
10
TCP 9000: JSON-RPC or RESTful API port serving application requests.P-Rep must allow TCP connections to port 7100 and 9000 of an external host. ( Use 0.0.0.0/0 for a source from any network )

Getting started

Open docker-compose.yml in a text editor and add the following content:
1
version: "3"
2
services:
3
prep:
4
image: iconloop/icon2-node
5
container_name: "icon2-node"
6
network_mode: host
7
restart: "on-failure"
8
environment:
9
SERVICE: "MainNet" # MainNet, SejongNet ## network type
10
GOLOOP_LOG_LEVEL: "debug" # trace, debug, info, warn, error, fatal, panic
11
KEY_STORE_FILENAME: "INPUT_YOUR_KEY_STORE_FILENAME" # e.g. keystore.json read a config/keystore.json
12
# e.g. "/goloop/config/keystore.json" read a "config/keystore.json" of host machine
13
KEY_PASSWORD: "INPUT_YOUR_KEY_PASSWORD"
14
FASTEST_START: "true" # It can be restored from latest Snapshot DB.
15
# You must enter your ICON1 node address. Recent blocks that are not in the backup DB are synchronized from your ICON1 node.
16
MIG_ENDPOINT: "http://YOUR_ICON1_SERVER_IPADDR:9000"
17
18
ROLE: 3 # Validator = 3, API Endpoint = 0
19
​
20
cap_add:
21
- SYS_TIME
22
​
23
volumes:
24
- ./data:/goloop/data # mount a data volumes
25
- ./config:/goloop/config # mount a config volumes ,Put your used keystore file here.
26
- ./logs:/goloop/logs
Start up
1
$ docker-compose pull && docker-compose up -d
To see the logs of the ICON2 node you can execute
1
$ tail -f logs/booting.log
2
​
3
​
4
$ tail -f logs/goloop.log
The directories(data, config, icon, logs …) are created by docker engine, but config directory needs to importing your keystore file.
1
.
2
├── docker-compose.yml
3
├── config # configuration files
4
│ └── keystore.json # Import the your keystore file
5
​
6
├── data # block data
7
│ ├── 1
8
│ ├── auth.json
9
│ ├── cli.sock
10
│ ├── ee.sock
11
│ └── rconfig.json
12
​
13
├── icon # icon1 data for migrate. If a migration is completed, it will be auto-remove
14
│ └── migrator_bm
15
└── logs # log files
16
├── booting.log
17
├── health.log # health state log
18
├── chain.log # goloop chain action logs
19
├── download.log
20
├── download_error.log # download
21
└── goloop.log # goloop's log file

Docker environments settings

Name
default
type
required
description
SERVICE
MainNet
str
false
Service Name - (MainNet, SejongNet)
ROLE
3
int
true
Role of running node. 0: Citizen, 3: P-Rep
CONFIG_URL
​
str
false
​
CONFIG_URL_FILE
default_configure.json
str
false
​
CONFIG_LOCAL_FILE
configure.json
str
false
​
IS_AUTOGEN_CERT
false
bool
false
Automatically generate certificates
FASTEST_START
false
bool
false
Download snapshot DB
KEY_STORE_FILENAME
keystore.json
str
true
keystore.json file name
KEY_PASSWORD
​
str
true
password of keystore.json file
USE_NTP_SYNC
True
bool
false
Whether to use NTP in container
NTP_SERVER
​
str
false
NTP Server
NTP_REFRESH_TIME
​
int
false
ntp refresh time
SLACK_WH_URL
​
str
false
slack web hook url - If a problem occurs, you can receive an alarm with a slack.
USE_HEALTH_CHECK
True
bool
false
Whether to use health check
CHECK_TIMEOUT
10
int
false
sec - TIMEOUT when calling REST API for monitoring
CHECK_PEER_STACK
6
int
false
sec - Stack value to check the peer for monitoring.
CHECK_BLOCK_STACK
10
int
false
sec - Stack value to check the block for monitoring.
CHECK_INTERVAL
10
int
false
sec - check interval for monitoring
CHECK_STACK_LIMIT
360
int
false
count - count- Restart container when stack value is reached
GOLOOP_LOG_LEVEL
debug
str
false
Log Level - (trace,debug,info,warn,error,fatal,panic

Further Resources

​Delegate tools​