Common operation and debug steps
​

Quick start to running ICON2 node

Prerequisites

We recommend running nodes using Docker.
System Requirements
  • CPU: minimum 2core, recommend 4core +
  • RAM: minimum 8GB, recommend 16GB +
  • DISK : minimum 1.5TB, recommend SSD 2TB +
  • Network: minimum 100Mbps, recommend 1 Gbps+
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 )
All RESTful APIs are the same as ICON1. However, only the "debug endpoint" of "estimate Step" used for fee inquiry was changed. Only the debug endpoint used for the fee inquiry( estimateStep ) has been changed.
The debug endpoint is different.
  • ICON1: /api/debug/v3.
  • ICON2: /api/v3d

How to install ICON2 node for MainNet

Default Directory Structure

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.
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
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-mainnet"
6
network_mode: host
7
restart: "on-failure"
8
environment:
9
SERVICE: "MainNet" # MainNet, sejong
10
GOLOOP_LOG_LEVEL: "debug" # trace, debug, info, warn, error, fatal, panic
11
IS_AUTOGEN_CERT: "true" # true, false
12
FASTEST_START: "true" # true, false # It will be download the Snapshot DB
13
ROLE: 0 # citizen = 0, preps = 3
14
SEEDS: "seed-ctz.solidwallet.io:7100"
15
​
16
cap_add:
17
- SYS_TIME
18
​
19
volumes:
20
- ./config:/goloop/config # mount a data volumes , key file
21
- ./data:/goloop/data # mount a data volumes
22
- ./logs:/goloop/logs # mount a log volumes
To start an ICON2 node, enter the following commands: (These commands includes docker pull )
1
$ docker-compose up -d

How to install ICON2 node for SejongNet(TestNet)

  1. 1.
    Create a base directory.
  2. 2.
    Create a config directory and import a Keystore file from ICON1 server.
1
$ mkdir /app/icon2-testnet # make a base directory
2
$ cd /app/icon2-testnet
3
$ mkdir -p /app/icon2-testnet/config # make a config directory,
4
​
5
# Import a keystore file to /app/icon2-testnet/config/ from ICON1 server
Using docker-compose command(Recommended)
1
version: '3'
2
services:
3
icon2-node:
4
image: 'looploy/icon2-node'
5
restart: "on-failure"
6
container_name: "icon2-testnet"
7
network_mode: "host"
8
environment:
9
SERVICE: "SejongNet" # MainNet, SejongNet(TestNet)
10
IS_AUTOGEN_CERT: "true" # true, false
11
FASTEST_START: "true" # true, false # It will be download the Snapshot DB
12
ROLE: 0 # citizen = 0, preps = 3
13
SEEDS: "seed-sejong.solidwallet.io:7100"
14
cap_add:
15
- SYS_TIME
16
​
17
volumes:
18
- ./config:/goloop/config
19
- ./data:/goloop/data
20
- ./logs:/goloop/logs

How to check the node state

  • get state
1
# docker exec -it icon2-node goloop chain ls
2
[
3
{
4
"cid": "0x1",
5
"nid": "0x1",
6
"channel": "icon_dex",
7
"state": "import_icon 14462097 running",
8
"height": 57940,
9
"lastError": ""
10
}
11
]
  • 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
}

Network separation using multiple citizens

The port used for network separation has been changed.
In block synchronization, TCP 7100 is synchronized instead of a WebSocket using TCP 9000.
  • Before change
    • External citizen node ← TCP 9000(WebSocket) → Internal citizen node
  • After change
    • External citizen node ← TCP 7100 → Internal citizen node
For example:
[ External Citizen Node ]
IPaddr : 20.20.20.199
1
version: "3"
2
services:
3
prep:
4
image: iconloop/icon2-node
5
container_name: "icon2-mainnet"
6
network_mode: host
7
restart: "on-failure"
8
environment:
9
SERVICE: "MainNet" # MainNet, sejong
10
GOLOOP_LOG_LEVEL: "debug" # trace, debug, info, warn, error, fatal, panic
11
IS_AUTOGEN_CERT: "true" # true, false
12
FASTEST_START: "true" # true, false # It will be download the Snapshot DB
13
ROLE: 0 # citizen = 0, preps = 3
14
​
15
cap_add:
16
- SYS_TIME
17
​
18
volumes:
19
- ./data:/data # mount a data volumes
20
- ./config:/config # mount a data volumes , key file