three ways
1. Using snapshots
Snapshot link
# 1. Build exchaind use the latest version of release
git clone -b latest_version https://github.com/okex/exchain.git # latest_version can be viewed through the link https://github.com/okex/exchain/releases/latest
cd exchain
make mainnet # Compile the mainnet, the default is leveldb
make mainnet WITH_ROCKSDB=true # Compile the mainnet, if you want to start rocksdb
Note 1: Be sure to compile with make mainnet
Note 2: latest_version can be viewed through the link https://github.com/okex/exchain/releases/latest
Note 3: If you encounter problems in the process of compiling rocksdb, please refer to this link
# 2. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (or other directory)
exchaind init your_custom_moniker --chain-id exchain-66 --home ${EXCHAIND_PATH}
# 3. download snapshot
rm -rf ${EXCHAIND_PATH}/data
cd ${EXCHAIND_PATH}
wget https://ok-public-hk.oss-cn-hongkong.aliyuncs.com/cdn/okexchain/snapshot/okexchain-$version-$date-$height_xxx.tar.gz
tar -zxvf okexchain-$version-$date-$height_xxx.tar.gz
# 4. start exchained
# Start the leveldb node
exchaind start --chain-id exchain-66 --home ${EXCHAIND_PATH}
# Start the rocksdb node
exchaind start --chain-id exchain-66 --db_backend rocksdb --home ${EXCHAIND_PATH}
2. Using the genesis.json file
# 1. Build exchain using the latest version of release
git clone -b latest_version https://github.com/okex/exchain.git # latest_version can be viewed through the link https://github.com/okex/exchain/releases/latest
cd exchain
make mainnet # Compile the mainnet, the default is leveldb
make mainnet WITH_ROCKSDB=true # Compile the mainnet, if you want to start rocksdb
Note 1: Be sure to compile with make mainnet
Note 2: latest_version can be viewed through the link https://github.com/okex/exchain/releases/latest
# 2. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (or other directory)
exchaind init your_custom_moniker --chain-id exchain-66 --home ${EXCHAIND_PATH}
# 3. download genesis.json
wget https://raw.githubusercontent.com/okex/mainnet/main/genesis.json -O ${EXCHAIND_PATH}/config/genesis.json
# 4. start exchained
# Start the leveldb node
exchaind start --chain-id exchain-66 --home ${EXCHAIND_PATH}
# Start the rocksdb node
exchaind start --chain-id exchain-66 --db_backend rocksdb --home ${EXCHAIND_PATH}
Notice
If you use s3 snapshot to start, be sure to add pruning=nothing
to the startup parameters, because the default value of pruning is default, which will crop the data.
In addition, it is recommended to configure the following parameters according to your needs
--max-open=10000 The maximum number of connections, the default value is 1000, increasing this value can provide the number of connections that the rpc service can receive.
--disable-abci-query-mutex=1 The lock switch in abci query, the default value is off, which can improve query performance
--fast-query=1 Fast query mode switch, the default value is off, after opening, the query data will be additionally recorded in watch.db to improve query performance
--enable-bloom-filter=1 bloom filter switch, the default value is off, turning it on can improve the query performance of eth_getLogs_
--mempool.size=10000 Set the size of the mempool, the default value is 2000, increasing the value can increase the storage in the mempool
tx quantity.
3. Start with docker+snapshot
# 1. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (or other directory)
exchaind init your_custom_moniker --chain-id exchain-66 --home ${EXCHAIND_PATH}
# 2. download snapshot
rm -rf ${EXCHAIND_PATH}/data
cd ${EXCHAIND_PATH}
# This image uses rocksdb data, so download the rocksdb snapshot corresponding to the mainnet.
wget https://ok-public-hk.oss-cn-hongkong.aliyuncs.com/cdn/okexchain/snapshot/okexchain-$version-$date-$height_xxx.tar.gz
tar -zxvf okexchain-$version-$date-$height_xxx.tar.gz
# 3. download the docker image
docker pull okexchain/fullnode-mainnet:latest # This image uses rocksdb snapshot data.
# 4. run docker based the snapshot downloaded in the previous step Start based on snapshot.
docker run -d --name exchain-mainnet-fullnode -v ~/.exchaind/data:/root/.exchaind/data/ -p 8545:8545 -p 26656:26656 okexchain/fullnode-mainnet:latest