🐳Docker
Authors: [ Ankur | Dapplooker]
System Requirements
8 vCPU
Ubuntu 22.04
32 GB
2 TB (SSD)
The IoTeX node has a size of 602 GB on 12, February, 2025.
Pre-requisite
Before starting, clean the setup then update and upgrade. Install following:
Docker
Git
Go v1.23+
Commands
sudo apt update -y && sudo apt upgrade -y && sudo apt auto-remove -y
sudo apt install docker.io git ufw -y jq -yFirewall Settings
Check status & enable UFW
sudo ufw enable
sudo ufw status verboseSet explicit default UFW rules
sudo ufw default deny incoming
sudo ufw default allow outgoingAllow SSH, HTTP, and HTTPS
sudo ufw allow 22/tcp
sudo ufw allow 80
sudo ufw allow 443Allow Remote connection
sudo ufw allow from ${REMOTE.HOST.IP} to any port 15014 # Ethereum JSON APISetup Instructions
Set the environment
mkdir -p ~/iotex
cd ~/iotex
export IOTEX_HOME=$~/iotex
mkdir -p $IOTEX_HOME/data
mkdir -p $IOTEX_HOME/log
mkdir -p $IOTEX_HOME/etc
curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v2.1.2/config_mainnet.yaml > $IOTEX_HOME/etc/config.yaml
curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v2.1.2/genesis_mainnet.yaml > $IOTEX_HOME/etc/genesis.yaml
curl https://raw.githubusercontent.com/iotexproject/iotex-bootstrap/v2.1.2/trie.db.patch > $IOTEX_HOME/data/trie.db.patchEdit `config.yaml` file
Edit $IOTEX_HOME/etc/config.yaml, look for externalHost and producerPrivKey, uncomment the lines and fill in your external IP and private key. If you leave producerPrivKey empty, your node will be assgined with a random key.
Download Data
curl -L https://t.iotex.me/mainnet-data-latest > $IOTEX_HOME/data.tar.gz
tar -xzf data.tar.gzStart the node
docker run -d --restart on-failure --name iotex \
-p 4689:4689 \
-p 14014:14014 \
-p 15014:15014 \
-p 16014:16014 \
-p 8080:8080 \
-v=$IOTEX_HOME/data:/var/data:rw \
-v=$IOTEX_HOME/log:/var/log:rw \
-v=$IOTEX_HOME/etc/config.yaml:/etc/iotex/config_override.yaml:ro \
-v=$IOTEX_HOME/etc/genesis.yaml:/etc/iotex/genesis.yaml:ro \
iotex/iotex-core:v2.1.2 \
iotex-server \
-config-path=/etc/iotex/config_override.yaml \
-genesis-path=/etc/iotex/genesis.yaml \
-plugin=gatewayMonitoring
Check Ports
Ensure that TCP ports 4689 and 8080 are open on your firewall and load balancer (if applicable). Additionally, if you intend to use the node as a gateway, make sure the following ports are open:
14014for the IoTeX native gRPC API15014for the Ethereum JSON API16014for the Ethereum WebSocket
Monitor Logs of Docker Container
docker ps
docker logs iotexSync Status
Run a query to check the latest synchronized L2 block:
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber",
"params":[],"id":83}' http://localhost:15014Response should look like:
{"jsonrpc":"2.0","id":83,"result":"0x2112b2d"}REFERENCES
Git hub : Repository for Archive Node Setup
IoTeX explorer : Block Explorer
Last updated