ICON Node Installation — Docker + AWS

2infiniti
2infiniti
May 27 · 6 min read

SW Requirements

OS requirements

Package requirements

AWS EC2

Install P-Rep Node

## Update the apt package index:
$ sudo apt-get update

## Install necessary packages:
$ sudo apt-get install -y systemd apt-transport-https ca-certificates curl gnupg-agent software-properties-common

## Add Docker's official GPG key:
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

## Add the apt repository
$ sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

## Update the apt package index:
$ sudo apt-get update

## Install docker-ce:
$ sudo apt-get -y install docker-ce docker-ce-cli containerd.io

## Add your user to the docker group with the following command.
$ sudo usermod -aG docker $(whoami)

## Set Docker to start automatically at boot time:
$ sudo systemctl enable docker.service

## Finally, start the Docker service:
$ sudo systemctl start docker.service

## Then we'll verify docker is installed successfully by checking the version:
$ sudo docker version
Client:
Version: 18.09.6
API version: 1.39
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 02:35:57 2019
OS/Arch: linux/amd64
Experimental: false
Server: Docker Engine - Community
Engine:
Version: 18.09.6
API version: 1.39 (minimum version 1.12)
Go version: go1.10.8
Git commit: 481bc77
Built: Sat May 4 01:59:36 2019
OS/Arch: linux/amd64
Experimental: false
## Install python-pip
$ sudo apt-get install -y python3-pip

## Then install Docker Compose:
$ sudo pip3 install docker-compose

## To verify the successful Docker Compose installation, run:
$ docker-compose version
$ sudo docker pull iconloop/prep-node:1904111713xdde258
$ sudo touch docker-compose.yml
$ sudo nano docker-compose.yml
version: '3'
services:
container:
image: 'iconloop/prep-node:1904111713xdde258'
container_name: 'prep-node'
volumes:
- ./data:/data
ports:
- 9000:9000
- 7100:7100
$ sudo docker-compose up -d
$ sudo docker ps
$ curl localhost:9000/api/v1/status/peer
{
"made_block_count": 0,
"status": "Service is online: 0",
"state": "Vote",
"peer_type": "0",
"audience_count": "0",
"consensus": "siever",
"peer_id": "hx1787c2194f56bb550a8daba9bbaea00a4956ed58",
"block_height": 184,
"round": 1,
"epoch_height": 186,
"unconfirmed_block_height": 0,
"total_tx": 93,
"unconfirmed_tx": 0,
"peer_target": "20.20.1.195:7100",
"leader_complaint": 185,
"peer_count": 5,
"leader": "hx7ff69280a1483c660695039c14ba954bb101bb66",
"epoch_leader": "hx7ff69280a1483c660695039c14ba954bb101bb66",
"mq": {
"peer": {
"message_count": 0
},
"channel": {
"message_count": 0
},
"score": {
"message_count": 0
}
}
}
.
|---- data
| |---- PREP-TestNet → Default ENV directory
| |---- .score_data
| | |-- db → root directory that SCOREs will be installed
| | |-- score → root directory that the state DB file will be created
| |---- .storage → root directory that the block DB will be stored
| |---- log → root directory that log files will be stored
[2019-05-23 15:54:12.600] Your IP: 3.15.102.228
[2019-05-23 15:54:12.602] RPC_PORT: 9000 / RPC_WORKER: 3
[2019-05-23 15:54:12.605] DEFAULT_PATH=/data/PREP-TestNet in Docker Container
[2019-05-23 15:54:12.607] DEFAULT_LOG_PATH=/data/PREP-TestNet/log
[2019-05-23 15:54:12.610] DEFAULT_STORAGE_PATH=/data/PREP-TestNet/.storage
[2019-05-23 15:54:12.613] scoreRootPath=/data/PREP-TestNet/.score_data/score
[2019-05-23 15:54:12.615] stateDbRootPath=/data/PREP-TestNet/.score_data/db
[2019-05-23 15:54:12.618] P-REP package version info - 1904111713xdde258
[2019-05-23 15:54:14.979] iconcommons 1.0.5.1 iconrpcserver 1.2.6 iconservice 1.2.2 loopchain 2.1.2
[2019-05-23 15:54:16.152] [ERROR] Download Failed - https://download.solidwallet.io/cert/3.15.102.228_public.der status_code=403
[2019-05-23 15:54:16.155] [ERROR] Unauthorized IP address, Please contact our support team
[2019-05-23 15:54:16.158] [ERROR] Your External IP:3.15.102.228 / Your Enviroment IPADDR:3.15.102.228

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade