How to Deploy OKExChain Mainnet Using Docker

Introduction

Document Overview

This guide provides a step-by-step walkthrough for deploying the OKExChain mainnet using Docker. It covers server setup, container configuration, and synchronization verification.

Key Components

Server Program Default Ports
127.0.0.1 OKExChain Mainnet Node RPC: 8545, P2P: 26656

Prerequisites

Hardware Requirements

  • OS: CentOS 7+
  • CPU: 4 cores
  • RAM: 8GB
  • Storage: 500GB SSD
  • Network: 5M dedicated bandwidth

Software Requirements

  • Docker: Version 19.03.11 or later

Note: Exact versions may vary; ensure compatibility.

Reference Resources

👉 Explore advanced blockchain solutions


Step 1: Download OKExChain Mainnet Image

Pull the official Docker image:
bash
docker pull okexchain/fullnode-mainnet:v0.19.5


Step 2: Launch the OKExChain Container

2.1 Create a Directory

bash
mkdir /opt/docker/okexchain

2.2 Start the Container

bash
docker run -itd --restart=unless-stopped \
-v /etc/localtime:/etc/localtime \
-v /etc/timezone:/etc/timezone \
--name okexchain \
-v /opt/docker/okexchain:/root/.exchaind/data/ \
-p 8545:8545 -p 26656:26656 \
okexchain/fullnode-mainnet:v0.19.5

2.3 Monitor Logs

bash
docker logs --tail 100 -f okexchain


Step 3: Verify Deployment

3.1 Check Container Status

bash
docker ps

Expected output:
CONTAINER ID IMAGE STATUS PORTS NAMES
97527d0c5e32 okexchain/fullnode-mainnet:v0.19.5 Up 0.0.0.0:8545->8545/tcp, 26656/tcp okexchain

3.2 Review Logs for Errors

bash
docker logs -f okexchain

Look for lines like:
I[2021-09-13|18:12:30.141] Committed state module=state height=2322603

👉 Optimize your node performance


Step 4: Confirm Synchronization

4.1 Check Sync Status

bash
curl -s -H "Content-Type:application/json" -X POST \
--data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' \
http://127.0.0.1:8545

A "result":false indicates sync completion.

4.2 Compare Block Height

bash
curl -s -H "Content-Type:application/json" -X POST \
--data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' \
http://127.0.0.1:8545

Match the output (0x23b143) with the OKLink explorer.


Frequently Asked Questions (FAQ)

Q1: What if the container fails to start?

A: Verify Docker logs for errors and ensure ports 8545/26656 are free.

Q2: How long does synchronization take?

A: Depending on network speed, it may take several hours to days.

Q3: Can I use a different OS?

A: Yes, but CentOS/Alibaba Cloud Linux are recommended for stability.

Q4: How to update the node?

A: Pull the latest image and restart the container with the same data volume.

Q5: Why is the RPC port (8545) important?

A: It enables interaction with the blockchain via JSON-RPC for queries and transactions.


Conclusion

Deploying OKExChain with Docker simplifies mainnet participation while ensuring scalability. Regularly monitor logs and block height to maintain node health.