Search…
ICON2 Operation and configuration for P-Rep

Quick start to running ICON2 node

Prerequisites

We recommend running nodes using Docker.
System Requirements
  • CPU: minimum 4core, recommend 8core +
  • RAM: minimum 16GB, recommend 32GB +
  • DISK : minimum SSD 1.5TB, recommend SSD 2TB +
  • Network: minimum 1Gbps, recommend 2Gbps +
External Communications
  • TCP 7100: TCP port used for peer-to-peer connection between peer nodes.
  • 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 )
ICON1 node must be maintained until the migration is completed, ICON2 node must be executed with the new server.
The citizen node operated Exchanges and another citizen node must run nodes after the Stage3 migration is complete.
SejongNet (TestNet) can be reset at any time.

Default Directory Structure

The default project name is the base directory of the docker-compose.yml file.** **We recommend that you use the ICON2 official image(iconloop/icon2-node). If you want to create your new image, see the next section.
If you have imported or created an image, proceed to the next step.
  1. 1.
    Create a base directory
  2. 2.
    Create a config directory and import a Keystore file from ICON1 server.
For example:
  • base directory : /app/icon2-node
  • config directory: /app/icon2-node/config # location of keystore.json file
If you are P-Rep, you must use the keystore.json file used in ICON1.
If they use dual Keystore:
  • Fisrt Keystore -> for voting and claim
  • Second Keystore -> for operating goloop node
1
$ mkdir /app/icon2-node # make a base directory
2
$ cd /app/icon2-node
3
$ mkdir -p /app/icon2-node/config # make a config directory,
4
5
# Import a keystore file to /app/icon2-node/config/ from ICON1 server
Copied!
The subdirectories(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
Copied!
Open docker-compose.yml in a text editor and add the following content.
1
version: '3'
2
services:
3
icon2-node:
4
image: 'iconloop/icon2-node'
5
restart: "on-failure"
6
container_name: "icon2-node"
7
network_mode: "host"
8
stdin_open: true
9
environment:
10
SERVICE: "MainNet" # MainNet, SeJong
11
#IS_AUTOGEN_CERT: "true"
12
GOLOOP_LOG_LEVEL: "debug" # trace, debug, info, warn, error, fatal, panic
13
KEY_STORE_FILENAME: "INPUT_YOUR_KEY_STORE_FILENAME" # e.g. keystore.json read a config/keystore.json
14
KEY_PASSWORD: "INPUT_YOUR_KEY_PASSWORD" # e.g. "/goloop/config/keystore.json" read a "config/keystore.json" of host machine
15
FASTEST_START: "true" # It can be restored from latest Snapshot DB.
16
ROLE: 3 # preps = 3, citizen = 0
17
18
cap_add:
19
- SYS_TIME
20
21
volumes:
22
- ./config:/goloop/config
23
- ./data:/goloop/data
24
- ./logs:/goloop/logs
Copied!
Enter the following commands: (These commands includes docker pull )
1
$ docker-compose pull
2
$ docker-compose up -d
Copied!

How to check the status of the ICON2 node with logs

The booting.log contains messages about the booting status of the ICON2 node. It includes default configuration variables and Docker environment variable.

1
$ tail -f logs/booting.log
2
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
3
[s6-init] ensuring user provided files have correct perms...exited 0.
4
[fix-attrs.d] applying ownership & permissions fixes...
5
[fix-attrs.d] done.
6
[cont-init.d] executing container initialization scripts...
7
[cont-init.d] init_manager: executing...
8
[init_manager] ICON2 Configuration
9
I|20211022-12:03:30.000505|-|BOOTING.LOG|configure.py:91| Download new configuration
10
I|20211022-12:03:30.000696|-|BOOTING.LOG|init_manager.py:18| [INIT_CONFIG] Initializing Configuration
11
I|20211022-12:03:30.000697|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] CONFIG_URL = https://d1hfk7wpm6ar6j.cloudfront.net (str)
12
I|20211022-12:03:30.000698|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] SERVICE = MainNet (str)
13
I|20211022-12:03:30.000699|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] CONFIG_URL_FILE = default_configure.yml (str)
14
I|20211022-12:03:30.000700|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] CONFIG_LOCAL_FILE = /goloop/configure.yml (str)
15
I|20211022-12:03:30.000701|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] LOCAL_TEST = True (bool)
16
I|20211022-12:03:30.000702|-|BOOTING.LOG|init_manager.py:20| [INIT_CONFIG] BASE_DIR = /goloop (str)
17
I|20211022-12:03:30.000703|-|BOOTING.LOG|init_manager.py:26| [INIT_CONFIG] GOLOOP_P2P = "192.168.65.3:7100"
18
I|20211022-12:03:30.000704|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] KEY_RESET = False (bool)
19
I|20211022-12:03:30.000705|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] ROLE = 3 (int)
20
I|20211022-12:03:30.000705|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] CID = 0x1 (str)
21
I|20211022-12:03:30.000706|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] NID = 0x1 (str)
22
I|20211022-12:03:30.000707|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] AUTO_SEEDS = True (bool)
23
I|20211022-12:03:30.000709|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] SEEDS = (str)
24
I|20211022-12:03:30.000711|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] MIG_INFO_FILE = migration_configure.yml (str)
25
I|20211022-12:03:30.000712|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] LOGDIR = /goloop/logs/goloop.log (str)
26
I|20211022-12:03:30.000713|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] LOGFILE = /goloop/logs/goloop.log (str)
27
I|20211022-12:03:30.000714|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] DOWNLOAD_URL = https://networkinfo.solidwallet.io/info (str)
28
I|20211022-12:03:30.000717|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] DOWNLOAD_URL_TYPE = indexing (str)
29
I|20211022-12:03:30.000717|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] FASTEST_START = True (bool)
30
I|20211022-12:03:30.000718|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] IS_AUTOGEN_CERT = True (bool)
31
I|20211022-12:03:30.000719|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] MIGRATION_START = True (bool)
32
I|20211022-12:03:30.000720|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] NTP_REFRESH_TIME = 30 (str)
33
I|20211022-12:03:30.000722|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] CONFIG_URL = (str)
34
I|20211022-12:03:30.000722|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] SERVICE = MainNet (str)
35
I|20211022-12:03:30.000723|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] CONFIG_URL_FILE = default_configure.yml (str)
36
I|20211022-12:03:30.000724|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] CONFIG_LOCAL_FILE = /goloop/configure.yml (str)
37
I|20211022-12:03:30.000726|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] LOCAL_TEST = True (bool)
38
I|20211022-12:03:30.000727|-|BOOTING.LOG|init_manager.py:32| [DOCKER_ENV] BASE_DIR = /goloop (str)
39
I|20211022-12:03:30.000728|-|BOOTING.LOG|configure_setter.py:79| Start create_yaml_file()
40
I|20211022-12:03:30.000746|-|BOOTING.LOG|configure_setter.py:86| Write json file -> /goloop/configure.yml, 5.6 KB
41
I|20211022-12:03:30.000748|-|BOOTING.LOG|configure_setter.py:89| Start create_env_file()
42
I|20211022-12:03:30.000751|-|BOOTING.LOG|configure_setter.py:31| Start create_key()
43
I|20211022-12:03:30.000867|-|BOOTING.LOG|configure_setter.py:43| Create a keystore, filename=/goloop/config/keystore.json, address=hxab2e6f78cc24e217197d7ac40292030c1e575ad0
44
I|20211022-12:03:30.000868|-|BOOTING.LOG|configure_setter.py:48| Start create_genesis_json()
45
I|20211022-12:03:30.000876|-|BOOTING.LOG|configure_setter.py:53| Write json file -> /goloop/config/genesis.json, 797.0 bytes
46
I|20211022-12:03:30.000877|-|BOOTING.LOG|configure_setter.py:56| Start create_gs_zip()
47
I|20211022-12:03:31.000010|-|BOOTING.LOG|configure_setter.py:65| Write file -> /goloop/config/icon_genesis.zip, 588.0 bytes
48
I|20211022-12:03:31.000012|-|BOOTING.LOG|configure_setter.py:70| Start create_icon_config()
49
I|20211022-12:03:31.000014|-|BOOTING.LOG|configure_setter.py:99| Start create_db()
50
I|20211022-12:03:36.000020|-|BOOTING.LOG|configure_setter.py:101| [RESTORE] FASTEST_START = True, MIG_DB = True
51
I|20211022-12:03:36.000022|-|BOOTING.LOG|configure_setter.py:107| [RESTORE] DOWNLOAD from Migration Stage2 DB
52
I|20211022-12:03:36.000028|-|BOOTING.LOG|restore_v3.py:302| [RESTORE] Create a restore directory : /goloop/data/restore
53
I|20211022-12:03:36.000032|-|BOOTING.LOG|restore_v3.py:183| [RESTORE] Exists file /goloop/logs/download.log, Delete a old file
54
I|20211022-12:03:36.000042|-|BOOTING.LOG|restore_v3.py:183| [RESTORE] Exists file /goloop/logs/download_error.log, Delete a old file
55
I|20211022-12:03:36.000181|-|BOOTING.LOG|restore_v3.py:191| [RESTORE] index_url=http://20.20.6.86:8080/file_list.txt, checksum_url=http://20.20.6.86:8080/checksum.json
56
I|20211022-12:03:36.000207|-|BOOTING.LOG|restore_v3.py:234| [RESTORE] Write file -> /goloop/data/restore/file_list.txt, 3.3 KB
57
I|20211022-12:03:36.000230|-|BOOTING.LOG|restore_v3.py:234| [RESTORE] Write file -> /goloop/data/restore/checksum.json, 3.1 KB
58
I|20211022-12:03:36.000231|-|BOOTING.LOG|restore_v3.py:154| [RESTORE] DOWNLOAD_URL=https://networkinfo.solidwallet.io/info, SERVICE=MainNet, DOWNLOAD_URL_TYPE=indexing, RESTORE_PATH=/goloop/data/restore
59
I|20211022-12:03:36.000239|-|BOOTING.LOG|restore_v3.py:253| [RESTORE] total_file_count = 37
60
I|20211022-12:03:36.000273|-|BOOTING.LOG|base.py:262| [3/37] [0]2021-10-22 12:03:36.268, 10/22 12:03:36 [NOTICE] Downloading 37 item(s)
Copied!

The goloop.log contains messages about the engine of ICON2 node.

A detailed explanation of this log will be added later.
1
$ tail -f logs/goloop.log
2
I|20211022-12:05:22.847332|ab2e|-|SR|server.go:153 starting the server
3
I|20211022-12:05:23.119615|ab2e|-|EEP|manager.go:273 ExecutorManager.onEEMConnect(type=java,version=1)
4
D|20211022-12:05:23.119700|ab2e|-|javaee|javaee.go:92 runInstances e.target(1), e.instances(0)
5
D|20211022-12:05:23.119741|ab2e|-|javaee|javaee.go:95 runInstances with uid(63482041-a029-4fb7-9cfa-02240d8fbbe0)
6
I|20211022-12:05:23.556044|ab2e|-|EEP|manager.go:287 ExecutorManager.onEEConnect(type=java,version=1,uid=63482041-a029-4fb7-9cfa-02240d8fbbe0)
7
D|20211022-12:05:23.556173|ab2e|-|javaee|javaee.go:122 OnAttach uid(63482041-a029-4fb7-9cfa-02240d8fbbe0)
8
I|20211022-12:06:07.441868|ab2e|-|cli|server.go:264 ____ ___ _ ___ ___ ____
9
I|20211022-12:06:07.442033|ab2e|-|cli|server.go:264 / ___|/ _ \| | / _ \ / _ \| _ \
10
I|20211022-12:06:07.442079|ab2e|-|cli|server.go:264 | | _| | | | | | | | | | | | |_) |
11
I|20211022-12:06:07.442100|ab2e|-|cli|server.go:264 | |_| | |_| | |__| |_| | |_| | __/
12
I|20211022-12:06:07.442134|ab2e|-|cli|server.go:264 \____|\___/|_____\___/ \___/|_|
13
I|20211022-12:06:07.442182|ab2e|-|cli|server.go:266 Version : v1.0.2
14
I|20211022-12:06:07.442206|ab2e|-|cli|server.go:267 Build : linux/amd64 tags(rocksdb)-2021-10-22-07:48:34
15
I|20211022-12:06:07.442245|ab2e|-|metric|metric.go:150 Initialize rootMetricCtx
16
I|20211022-12:06:07.442583|ab2e|-|node|node.go:899 NodeDir : /goloop/data
17
I|20211022-12:06:07.442610|ab2e|-|node|config.go:116 load /goloop/data/rconfig.json
18
I|20211022-12:06:07.449880|ab2e|-|eeproxy|enginefactory.go:9 Allocate Engines:[python java]
19
D|20211022-12:06:07.455135|ab2e|-|javaee|javaee.go:84 JavaEE Init net(unix), addr(/goloop/data/ee.sock)
20
D|20211022-12:06:07.456930|ab2e|-|javaee|javaee.go:66 start JavaEE addr(/goloop/data/ee.sock), PID(1568), state(0x0),
21
I|20211022-12:06:07.457029|ab2e|-|pyee|pyee.go:172 start instance uid=b0d620ef-e0a9-4d04-984e-bf637823515b
22
I|20211022-12:06:07.463243|ab2e|-|node|node.go:63 Load channel config /goloop/data/1/config.json
23
I|20211022-12:06:07.467470|ab2e|-|chain|chain.go:417 ConfigFilepath /goloop/data/1/config.json BaseDir ChainDir /goloop/data/1
24
I|20211022-12:06:07.467634|ab2e|1|chain|chain.go:353 prepare a directory /goloop/data/1/db for database
25
I|20211022-12:06:07.473031|ab2e|-|db|rocks_db.go:91 rocksdb_list_column_families returns num: 6
26
I|20211022-12:06:07.603207|ab2e|-|EEP|manager.go:287 ExecutorManager.onEEConnect(type=python,version=1,uid=b0d620ef-e0a9-4d04-984e-bf637823515b)
27
D|20211022-12:06:07.603871|ab2e|-|EEP|b0d620ef|log.go:205 python|pyexec.py:204 [PyExec] connect(/goloop/data/ee.sock, b0d620ef-e0a9-4d04-984e-bf637823515b)
28
I|20211022-12:06:07.718237|ab2e|-|SR|server.go:153 starting the server
29
I|20211022-12:06:07.889794|ab2e|-|EEP|manager.go:273 ExecutorManager.onEEMConnect(type=java,version=1)
30
D|20211022-12:06:07.889880|ab2e|-|javaee|javaee.go:92 runInstances e.target(1), e.instances(0)
31
D|20211022-12:06:07.889909|ab2e|-|javaee|javaee.go:95 runInstances with uid(0500d173-d16f-4e68-89c2-0fe258fdd49f)
32
I|20211022-12:06:08.332411|ab2e|-|EEP|manager.go:287 ExecutorManager.onEEConnect(type=java,version=1,uid=0500d173-d16f-4e68-89c2-0fe258fdd49f)
33
D|20211022-12:06:08.332617|ab2e|-|javaee|javaee.go:122 OnAttach uid(0500d173-d16f-4e68-89c2-0fe258fdd49f)
34
I|20211022-12:06:19.497065|ab2e|1|chain|chain.go:344 STARTING ImportICON
35
I|20211022-12:06:19.500214|ab2e|-|db|rocks_db.go:91 rocksdb_list_column_families returns num: 7
36
I|20211022-12:06:20.150615|ab2e|1|NM|network.go:42 NetworkManager use channel=1 for cid=0x1 nid=0x1
37
D|20211022-12:06:20.151191|ab2e|1|NM|network.go:69 NewManager 1
38
D|20211022-12:06:20.151807|ab2e|1|statesync|manager.go:122 NewSyncManager
39
D|20211022-12:06:20.152248|ab2e|1|BM|manager.go:594 NewBlockManager
40
I|20211022-12:06:20.156827|ab2e|1|lcimporter|blockconverter.go:448 Executing Blocks from=3729, to=-1
41
D|20211022-12:06:20.156985|ab2e|1|lcimporter|blockconverter.go:331 Last block height:3795
42
D|20211022-12:06:20.157088|ab2e|1|lcimporter|executor.go:379 consumeBlocks START chn=0xc00057b8c0
43
D|20211022-12:06:20.158116|ab2e|1|CS|consensus.go:188 NewConsensus
44
D|20211022-12:06:20.158216|ab2e|1|NM|network.go:166 RegisterReactor, p2p started
45
I|20211022-12:06:20.158386|ab2e|1|CS|consensus.go:275 enter round Height:113 Round:0
46
D|20211022-12:06:20.158514|ab2e|1|CS|consensus.go:321 enterStep {Height:113 Round:0 Step:stepNewHeight}
47
I|20211022-12:06:20.267162|ab2e|1|CS|consensus.go:1632 Start consensus wallet:ab2e6f78..
48
D|20211022-12:06:20.267407|ab2e|1|NM|network.go:166 RegisterReactor, p2p started
49
D|20211022-12:06:20.267537|ab2e|1|NM|network.go:166 RegisterReactor, p2p started
50
D|20211022-12:06:20.267694|ab2e|1|CS|consensus.go:321 enterStep {Height:113 Round:0 Step:stepTransactionWait}
51
D|20211022-12:06:20.267807|ab2e|1|CS|consensus.go:321 enterStep {Height:113 Round:0 Step:stepPropose}
52
I|20211022-12:06:20.267990|ab2e|1|chain|chain.go:491 STARTED ImportICON
53
W|20211022-12:06:20.642905|ab2e|1|lcimporter|transition.go:188 T_0xc0005fc900.SetResult(next=3762,mh=MerkleHeader{0x890464d184e71fff07cf58b95aee1b83f8a09727c300e6622238c978857a1ee4,3729})
54
D|20211022-12:06:21.268029|ab2e|1|CS|consensus.go:321 enterStep {Height:113 Round:0 Step:stepPrevote}
55
I|20211022-12:06:21.935812|ab2e|1|service|transition.go:687 finalizeResult() total=21.5µs world=-2562047h47m16.854775808s receipts=2562047h47m16.854775807s
56
I|20211022-12:06:22.205569|ab2e|1|lcimporter|blockconverter.go:546 [⠦] Executing Block[ 3,796 ] 2018-04-23 11:14:51 RPS[ 99.92 ] TPS[ 0.00 ]
Copied!

If FASTEST_START: "true" is used

This environment variable automatically receives the latest snapshot DB and checks the checksum. Validation of the file is checked for the values below.
  • File size.
  • File checksum.
  • File name.
1
tail -f logs/booting.log
2
I|20211022-12:09:22.000167|-|BOOTING.LOG|configure_setter.py:101| [RESTORE] FASTEST_START = True, MIG_DB = True
3
I|20211022-12:09:22.000168|-|BOOTING.LOG|configure_setter.py:107| [RESTORE] DOWNLOAD from Migration Stage2 DB
4
I|20211022-12:09:22.000170|-|BOOTING.LOG|restore_v3.py:179| [RESTORE PASS] Already restored. If you want to start over, delete the '/goloop/data/restore/RESTORED' file.
Copied!
If the downloader runs at least once, a data/restore/RESTORED file is created. To start the download again, remove the data/restore/RESTORED.

The download.log contains messages about downloading status of ICON2 node.

1
$ tail -f logs/download.log
2
[10606] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/loans.py
3
[10607] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/positions.py
4
[10608] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/snapshots.py
5
[10609] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/__pycache__/__init__.cpython-37.pyc
6
[10610] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/__pycache__/assets.cpython-37.pyc
7
[10611] 10/18 13:21:35 [NOTICE] Download complete: data/1/contract/0x875b5e7eb2044ef2523acf255fd092ae2044e7099b515cc13e3f468db9e69cbc/loans/__pycache__/loans.cpython-37.pyc
Copied!

Validate downloaded file.

1
I|20211022-12:13:34.000824|-|BOOTING.LOG|restore_v3.py:234| [RESTORE] Write file -> /goloop/data/restore/file_list.txt, 3.3 KB
2
I|20211022-12:13:34.000850|-|BOOTING.LOG|restore_v3.py:234| [RESTORE] Write file -> /goloop/data/restore/checksum.json, 3.1 KB
3
I|20211022-12:13:34.000851|-|BOOTING.LOG|restore_v3.py:154| [RESTORE] DOWNLOAD_URL=https://info, SERVICE=MainNet, DOWNLOAD_URL_TYPE=indexing, RESTORE_PATH=/goloop/data/restore
4
I|20211022-12:13:34.000861|-|BOOTING.LOG|restore_v3.py:253| [RESTORE] total_file_count = 37
5
I|20211022-12:13:34.000885|-|BOOTING.LOG|base.py:262| [3/37] [0]2021-10-22 12:13:34.880, 10/22 12:13:34 [NOTICE] Downloading 37 item(s)
6
I|20211022-12:13:38.000371|-|BOOTING.LOG|base.py:223| [ OK ] text='None', cmd='aria2c -i /goloop/data/restore/file_list.txt -d /goloop/data -V -j20 -x16 --http-accept-gzip --disk-cache=64M -c --allow-overwrite --log-level=error --log /goloop/logs/download_error.log' :: , timed=3.508
7
I|20211022-12:13:38.000372|-|BOOTING.LOG|restore_v3.py:291| [RESTORE] Completed downloading. elapsed_time=3.513s
8
{
9
status: OK
10
error: {
11
}
12
}
13
I|20211022-12:13:38.000474|-|BOOTING.LOG|restore_v3.py:214| [RESTORE] Completed checksum of downloaded file. status=OK
14
I|20211022-12:13:38.000475|-|BOOTING.LOG|init_manager.py:43| --- Finish initializing ---
Copied!

If an error occurs during download, you can check the booting.log and download_error.log

1
$ tail -f logs/booting.log
2
E|2021-10-22 12:18:11.922037 [ERROR] [AbstractCommand.cc:349] CUID#44 - Download aborted. URI=http://20.20.6.86:8080/data/1/tmp/1/NONE_EXIST_FILE
3
Exception: [AbstractCommand.cc:351] errorCode=3 URI=http://20.20.6.86:8080/data/1/tmp/1/NONE_EXIST_FILE
4
-> [HttpSkipResponseCommand.cc:218] errorCode=3 Resource not found
5
6
[CHECK][ERROR] /goloop/data/1/db/1/CURRENT, file=True, size=True, checksum=False, {'file_size': 16, 'checksum': 'cfdf0318715f56cc'}
7
{
8
status: FAIL
9
error: {
10
/goloop/data/1/db/1/CURRENT: {
11
checksum: False
12
}
13
}
14
}
15
[Exception] Exception: File checksum error : {'status': 'FAIL', 'error': {'/goloop/data/1/db/1/CURRENT': {'checksum': False}}}, <frame at 0x7f6481192450, file 'init_manager.py', line 48, code <module>>
16
17
$ tail -f logs/download_error.log
18
2021-10-22 12:18:11.922037 [ERROR] [AbstractCommand.cc:349] CUID#44 - Download aborted. URI=http://20.20.6.86:8080/data/1/tmp/1/NONE_EXIST_FILE
19
Exception: [AbstractCommand.cc:351] errorCode=3 URI=http://20.20.6.86:8080/data/1/tmp/1/NONE_EXIST_FILE
20
-> [HttpSkipResponseCommand.cc:218] errorCode=3 Resource not found
Copied!

How to download ICON2 data (migrated backup data)

If you use docker, it’s not necessary. It is automatically downloaded in docker image.

Installing aria2

Download version 1.36.0. There you can download source distribution and binaries for OS X, Windows and Android.
After installation is complete, download the backup data with the command below.
1
$ curl https://networkinfo.solidwallet.io/info/MainNet.json
2
{
3
"network_name": "MainNet", <- network name (MainNet, SejongNet)
4
"index_url": "http://20.20.6.86:8080/file_list.txt", <- indexed file
5
"checksum_url": "http://20.20.6.86:8080/checksum.json", <- checksum file
6
"updated_time": "2021-10-20 19:16:00.942"
7
}
Copied!

Download a file_list.txt file

1
$ aria2c http://20.20.6.86:8080/file_list.txt
Copied!

Download a checksum.json file

1
$ aria2c http://20.20.6.86:8080/checksum.json
Copied!

Download URIs found in file_list.txt

1
$ aria2c -d data -i file_list.txt -V \
2
-j20 -x16 --http-accept-gzip --disk-cache=64M \
3
--allow-overwrite --log-level=error --log download_error.log -c
Copied!
  • download_error.log that checks the error log
  • -d data : The data directory to store the downloaded file
  • -i file_list.txt : Downloads the URIs listed in file_list.txt
  • -j 20 : Set the maximum number of parallel downloads for every queue item
  • -x 16 : The maximum number of connections to one server for each download
  • --disk-cache=64M : Enable disk cache
  • --allow-overwrite: Restart download from scratch if the corresponding control file doesn't exist
  • -c : Continue downloading a partially downloaded file

How to build ICON2 image from source

We provide docker package for your convenience. The official image is iconloop/icon2-node.
If you want to build your own, the following creates iconloop/icon2-node.
1
$ git clone https://github.com/icon-project/icon2-node
2
$ cd icon2-node
3
$ make
4
----- Build Environment -----
5
BASE_IMAGE = goloop-icon
6
BUILD_DATE = 2021-10-22T12:38:04UTC
7
ECHO_OPTION = ""
8
GIT_DIRTY =
9
GOLOOP_PATH = goloop
10
IS_LOCAL = true
11
IS_NTP_BUILD = false
12
NAME = icon2-node
13
NTP_VERSION = ntp-4.2.8p15
14
REPO_HUB = iconloop
15
SED_OPTION =
16
TAGNAME = v1.0.2
17
UNAME_S = Darwin
18
VCS_REF = 959a4f10
19
VERSION = v1.0.2
20
-- Change Goloop Version v1.0.2 --
21
HEAD is now at 1deb1482 Modify RoundLimitFactor value for backward compatibility
22
-- Build goloop base image --
23
cd goloop && /Applications/Xcode.app/Contents/Developer/usr/bin/make goloop-icon-image
24
TARGET=py LABEL=GOLOOP_PYDEP_SHA
25
HASH_OF_DIR=3.7.11-alpine3.14-1e95888fc5b8c9d6cc378d374407894ed699a26a HASH_OF_IMAGE=3.7.11-alpine3.14-1e95888fc5b8c9d6cc378d374407894ed699a26a
26
Reuse image goloop/py-deps:latest for 3.7.11-alpine3.14-1e95888fc5b8c9d6cc378d374407894ed699a26a
27
TARGET=rocksdb LABEL=GOLOOP_ROCKSDBDEP_SHA
28
HASH_OF_DIR=v6.22.1-alpine3.14-e1e832538747a1fdff057e97ec4c48486729c6eb HASH_OF_IMAGE=v6.22.1-alpine3.14-e1e832538747a1fdff057e97ec4c48486729c6eb
29
Reuse image goloop/rocksdb-deps:latest for v6.22.1-alpine3.14-e1e832538747a1fdff057e97ec4c48486729c6eb
30
Reuse image goloop/base-all:latest for base-all-3.14-v6.22.1-alpine3.14-e1e832538747a1fdff057e97ec4c48486729c6eb-3.7.11-alpine3.14-1e95888fc5b8c9d6cc378d374407894ed699a26a-11.0.11-07800032068305a7318ef61d6379d5b1790ae0f
Copied!
  • Docker image Features
    • Automatically restore from snapshot backup file
    • Check the health for node
    • Manage node settings using environment variables
    • Time synchronization with NTP
    • Automatically add seeds
  • Work Flow

Docker environments settings

Name
Default
Type
Required
Description
SERVICE
MainNet
str
false
Service Name - (MainNet, SejongNet)
ROLE
0
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
BASE_DIR
/goloop
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
NTP_SERVER
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.
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 - Restart container when stack value is reached
GOLOOP_LOG_LEVEL
debug
str
false
info, debug,
LOG_OUTPUT_TYPE
file
str
false
file, both(console&file)
The period at which the alarm goes increases in multiples. If set as follows, it increases to the multiple according to the CHECK_BLOCK_STACK value.
1
CHECK_BLOCK_STACK = 10 # 100sec -> 200 sec -> 300sec
2
CHECK_PEER_STACK = 10
3
CHECK_INTERVAL = 10
4
CHECK_TIMEOUT = 10
Copied!

How to check the node state

  • get state
1
# docker exec -it icon2-node goloop chain ls
2
[
3
{
4
"cid": "0x1", -> Channel ID , In the case of MainNet, cid and nid are the same.
5
"nid": "0x1", -> Network ID
6
"channel": "icon_dex",
7
"state": "import_icon 14462097 running",
8
"height": 57940, -> BlockHeight
9
"lastError": "" -> If there is a problem with goloop, it will be displayed.
10
}
11
]
Copied!
or
1
$ curl localhost:9000/admin/chain
2
[{"cid":"0x1","nid":"0x1","channel":"icon_dex","state":"started","height":1117421,"lastError":""}]
Copied!
  • get detail state
1
# docker exec -it icon2-node goloop chain inspect 0x1
2
{
3
"cid": "0x1",
4
"nid": "0x1",
5
"channel": "icon_dex",
6
"state": "import_icon 14464527 running",
7
"height": 57944,
8
"lastError": "",
9
"genesisTx": {
10
"accounts": [
11
{
12
"address": "hx54f7853dc6481b670caf69c5a27c7c8fe5be8269",
13
"balance": "0x2961fff8ca4a62327800000",
14
"name": "god"
15
},
16
{
17
"address": "hx1000000000000000000000000000000000000000",
18
"balance": "0x0",
19
"name": "treasury"
20
}
21
],
22
"message": "A rhizome has no beginning or end; it is always in the middle, between things, interbeing, intermezzo. The tree is filiation, but the rhizome is alliance, uniquely alliance. The tree imposes the verb \"to be\" but the fabric of the rhizome is the conjunction, \"and ... and ...and...\"This conjunction carries enough force to shake and uproot the verb \"to be.\" Where are you going? Where are you coming from? What are you heading for? These are totally useless questions.\n\n - Mille Plateaux, Gilles Deleuze \u0026 Felix Guattari\n\n\"Hyperconnect the world\""
23
},
24
"config": {
25
"dbType": "rocksdb",
26
"platform": "icon",
27
"seedAddress": "20.20.6.87:7100",
28
"role": 3,
29
"concurrencyLevel": 1,
30
"normalTxPool": 10000,
31
"nodeCache": "small",
32
"channel": "icon_dex",
33
"secureSuites": "none,tls,ecdhe",
34
"secureAeads": "chacha,aes128,aes256",
35
"defaultWaitTimeout": 0,
36
"maxWaitTimeout": 0,
37
"txTimeout": 60000,
38
"autoStart": false
39
},
40
"module": {
41
"metrics": {
42
"consensus_height": 57945,
43
"consensus_height_duration": 63234,
44
"consensus_round": 0,
45
"consensus_round_duration": 63234,
46
"network_recv_cnt": 7613146,
47
"network_recv_sum": 5932966367,
48
"network_send_cnt": 7663766,
49
"network_send_sum": 7377659111,
50
"txlatency_commit": null,
51
"txlatency_finalize": null,
52
"txpool_add_cnt": null,
53
"txpool_add_sum": null,
54
"txpool_drop_cnt": null,
55
"txpool_drop_sum": null,
56
"txpool_remove_cnt": null,
57
"txpool_remove_sum": null,
58
"txpool_user_add_cnt": null,
59
"txpool_user_add_sum": null,
60
"txpool_user_drop_cnt": null,
61
"txpool_user_drop_sum": null,
62
"txpool_user_remove_cnt": null,
63
"txpool_user_remove_sum": null
64
},
65
"network": {
66
"p2p": {
67
"children": [],
68
"friends": [
69
{
70
"addr": "20.20.6.84:7100",
71
"id": "hx59fbe7660aac5e1487dfb21024940441fd7d21fc",
72
"in": true,
73
"role": 3
74
},
75
{
76
"addr": "20.20.6.85:7100",
77
"id": "hx51a27fe90ced46309d8d9a0147889c02469c988b",
78
"in": true,
79
"role": 3
80
},
81
{
82
"addr": "20.20.6.87:7100",
83
"id": "hx8c0d92d64087cafb00353209e0736ff382c05e0c",
84
"in": true,
85
"role": 3
86
}
87
],
88
"nephews": [],
89
"orphanages": [
90
{
91
"addr": "20.20.6.86:7100",
92
"id": "hxa1d93a0cf251af0d4f17863b0b912b6b3a75b606",
93
"in": true,
94
"role": 1
95
}
96
],
97
"others": [],
98
"parent": {},
99
"roots": {
100
"20.20.6.83:7100": "hx13dae65d3955c87eb671be0659276a0be0fc44a6",
101
"20.20.6.84:7100": "hx59fbe7660aac5e1487dfb21024940441fd7d21fc",
102
"20.20.6.85:7100": "hx51a27fe90ced46309d8d9a0147889c02469c988b",
103
"20.20.6.87:7100": "hx8c0d92d64087cafb00353209e0736ff382c05e0c"
104
},
105
"seeds": {
106
"20.20.6.83:7100": "hx13dae65d3955c87eb671be0659276a0be0fc44a6",
107
"20.20.6.84:7100": "hx59fbe7660aac5e1487dfb21024940441fd7d21fc",
108
"20.20.6.85:7100": "hx51a27fe90ced46309d8d9a0147889c02469c988b",
109
"20.20.6.86:7100": "hxa1d93a0cf251af0d4f17863b0b912b6b3a75b606",
110
"20.20.6.87:7100": "hx8c0d92d64087cafb00353209e0736ff382c05e0c"
111
},
112
"self": {
113
"addr": "20.20.6.83:7100",
114
"id": "hx13dae65d3955c87eb671be0659276a0be0fc44a6",
115
"in": false,
116
"role": 3
117
},
118
"trustSeeds": {
119
"20.20.6.87:7100": ""
120
},
121
"uncles": []
122
}
123
}
124
}
125
}
Copied!
or
1
$ curl localhost:9000/admin/chain/0x1
2
{
3
"cid": "0x800c97",
4
"nid": "0x53",
5
"channel": "icon_dex",
6
"state": "started",
7
"height": 1117462,
8
"lastError": "",
9
"genesisTx": {
10
"accounts": [
11
{
12
"address": "hx5a05b58a25a1e5ea0f1d5715e1f655dffc1fb30a",
13
"balance": "0x2961fff8ca4a62327800000",
14
"name": "god"
15
},
16
.
17
.
18
.
19
}
20
},
21
"service": {
22
"normalTxPool": {
23
"size": 30000,
24
"used": 0
25
},
26
"patchTxPool": {
27
"size": 1000,
28
"used": 0
29
},
30
"resultCache": {
31
"bytes": 15170,
32
"size": 10,
33
"used": 10
34
}
35
}
36
}
37
}
Copied!

How to create a keystore file

A certificate is required to operate a node. There are two ways to create a certificate file or keystore file.
  • When you start a docker, you can create a certificate using IS_AUTOGEN_CERT environment variables.
1
environment:
2
IS_AUTOGEN_CERT: "true"
3
KEY_PASSWORD: "[email protected]#"
Copied!
  • ${CERT_PATH}/autogen_cert.pem file is created with password [email protected]#
  • You can create a certificate through the goloop cli command
1
# docker exec -it icon2-node goloop ks gen \
2
--out keystore.json \
3
--password YOUR_PASSWORD
Copied!
  • keystore.json file is created with password YOUR_PASSWORD
  • If you have the der or pem file, run the following on the ICON2 server. You can convert it to json keystore with the command below. (The example below creates a private der.json file in the config directory)
1
$ docker exec -it icon2-node icon_wallet.py convert --filename private_der.der --password 1234 -vvv
2
I|20211024-11:12:08.000084|-|BOOTING.LOG|configure.py:91| Download new configuration
3
4
Arguments = Namespace(command='convert', filename='/goloop/config/private_der.der', password='1234', verbose=3)
5
6
Keystore file: /goloop/config/private_der.der, Keystore file type: der
7
8
9
hx address from der file : hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
10
hx address from ICON wallet : hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
11
Convert file
12
Convert '/goloop/config/private_der.der' to '/goloop/config/private_der.json'
13
filename=/goloop/config/private_der.json, password=1234, keysecret=/goloop/config/keysecret
14
15
Create a Keystore file
16
Write to file => /goloop/config/private_der.json
17
{
18
"address": "hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
19
"crypto": {
20
"cipher": "aes-128-ctr",
21
"cipherparams": {
22
"iv": "xxxxxxxxxxxxxxxxxxx"
23
},
24
"ciphertext": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
25
"kdf": "scrypt",
26
"kdfparams": {
27
"dklen": 32,
28
"n": 16384,
29
"r": 1,
30
"p": 8,
31
"salt": "xxxxxxxxxxxxxxxxxxx"
32
},
33
"mac": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
34
},
35
"id": "ca813ea0-7b95-4089-a50b-9cfda390e651",
36
"version": 3,
37
"coinType": "icx"
38
}
39
Write to file => /goloop/config/private_der.json
40
Stored filename=/goloop/config/private_der.json, address=hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, size=507.0 bytes
41
hxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copied!

How to control the ICON2 node

The command below is automatically executed in the container.
  • join : Join the network
  • leave: Leave the chain. When you execute this command, DB will be deleted and left the network
The command below can control the Goloop in the container.
  • start: Start the chain
1
docker exec -it icon2-node goloop chain start 0x1 # cid
Copied!
or
1
docker exec -it icon2-node control_chain start
2
3
version : 0.1.29
4
5
✔ [DONE] ['start'] count=0, func=view_chain, args=[], wait_state='started', check_state='started'
6
[2021-10-22 14:03:02.094] OK
Copied!
  • stop: Stop the chain
1
docker exec -it icon2-node goloop chain stop 0x1 # cid
Copied!
or
1
docker exec -it icon2-node control_chain stop
2
3
version : 0.1.29
4
✔ [DONE] ['stop'] count=0, func=view_chain, args=[], wait_state='stopped', check_state='stopped'
5
[2021-10-22 14:02:56.015] OK
Copied!
  • ls: get the state
1
$ docker exec -it icon2-node goloop chain ls
2
[
3
{
4
"cid": "0x800c97",
5
"nid": "0x53",
6
"channel": "icon_dex",
7
"state": "started",
8
"height": 1034552,
9
"lastError": ""
10
}
11
]
Copied!
or
1
$ docker exec -it icon2-node control_chain ls -f
2
3
version : 0.1.29
4
5
[2021-10-22 14:11:16.132] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
6
[2021-10-22 14:11:16.334] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
7
[2021-10-22 14:11:16.535] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
8
[2021-10-22 14:11:16.736] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
9
[2021-10-22 14:11:16.937] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
10
[2021-10-22 14:11:17.138] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
11
[2021-10-22 14:11:17.339] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034589, 'lastError': ''}
12
[2021-10-22 14:11:17.540] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034590, 'lastError': ''}
13
[2021-10-22 14:11:17.741] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034590, 'lastError': ''}
14
[2021-10-22 14:11:17.942] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034590, 'lastError': ''}
15
[2021-10-22 14:11:18.143] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034590, 'lastError': ''}
16
[2021-10-22 14:11:18.344] {'cid': '0x800c97', 'nid': '0x53', 'channel': 'icon_dex', 'state': 'started', 'height': 1034590, 'lastError': ''}
Copied!
Last modified 13d ago