This repo collects the genesis and configuration files for the various ExChain mainnet. It exists so the ExChain repo does not get bogged down with large genesis files and status updates.
1. Build exchaind by the latest released version
# latest_version refers to https://github.com/okx/exchain/releases/latest
git clone -b latest_version https://github.com/okx/exchain.git
cd exchain
make mainnet
2. Startup a full node by a snapshot. (recommended)
There are 3 types of snapshots and s0 is the one with minimum data size:
- s0: the most recent block and world state
- s1: all historical blocks and the most recent world state
- s3: all historical blocks and world states
# 1. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (or a cutomized one)
exchaind init your_custom_moniker --chain-id exchain-66 --home ${EXCHAIND_PATH}
# 2. download snapshot
rm -rf ${EXCHAIND_PATH}/data
cd ${EXCHAIND_PATH}
wget https://okg-pub-hk.oss-cn-hongkong.aliyuncs.com/cdn/okc/snapshot/mainnet-$version-$date-$height-rocksdb.tar.gz
tar -zxvf mainnet-$version-$date-$height-rocksdb.tar.gz
# 3. start exchaind
exchaind start --home ${EXCHAIND_PATH}
export EXCHAIND_PATH=~/.exchaind (You can also specify other directory)
exchaind init your_custom_moniker --chain-id exchain-66 --home ${EXCHAIND_PATH}
wget https://raw.githubusercontent.com/okex/mainnet/main/genesis.json -O ${EXCHAIND_PATH}/config/genesis.json
exchaind start --chain-id exchain-66 --home ${EXCHAIND_PATH}
Note: it needs to check the genesis file
$ shasum -a 256 ${EXCHAIND_PATH}/config/genesis.json
0958b6c9f5f125d1d6b8f56e042fa8a71b1880310227b8b2f27ba93ff7cd673b ${EXCHAIND_PATH}/config/genesis.json
mkdir -p ~/.exchaind/data
echo '{\n"height": "0",\n"round": "0",\n"step": 0\n}' > ~/.exchaind/data/priv_validator_state.json
docker run -d --name exchain-mainnet-fullnode -v ~/.exchaind/data:/root/.exchaind/data/ -p 8545:8545 -p 26656:26656 okexchain/fullnode-mainnet:latest
docker logs --tail 100 -f exchain-mainnet-fullnode
docker rm -f exchain-mainnet-fullnode
You can restart in the previous data dir
docker run -d --name exchain-mainnet-fullnode -v ~/.exchaind/data:/root/.exchaind/data/ -p 8545:8545 -p 26656:26656 okexchain/fullnode-mainnet:latest
Build exchaind by the latest released version
git clone -b latest_version https://github.com/okex/exchain.git # latest_version refers to https://github.com/okex/exchain/releases/latest
cd exchain
make mainnet
export EXCHAIND_PATH=~/.exchaind (You can also specify other directory)
exchaind start --chain-id exchain-66 --home ${EXCHAIND_PATH}