两种方式
注:测试网不支持创世块文件方式启动,仅支持 快照链接 启动
1. 使用exchaind+快照启动
# 1. build exchaind
# latest_version指使用prerelease最新版本,可以通过链接 https://github.com/okx/exchain/releases 查看
git clone -b latest_version https://github.com/okx/exchain.git
cd exchain
make testnet # 编译测试网
注1:务必用 make testnet 编译
注2:latest_version指使用release最新版本,可以通过链接 https://github.com/okx/exchain/releases 查看
注3:如果您第一次运行exchaind,请先安装rocksdb,我们已经提供了一个rocksdb的安装命令make rocksdb
,您可以进入exchain文件夹进行使用。
注4:如果在编译rocksdb过程中遇到问题,请参考该链接
# 2. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (或者其他目录)
exchaind init your_custom_moniker --chain-id exchain-65 --home ${EXCHAIND_PATH}
# 3. download snapshot
rm -rf ${EXCHAIND_PATH}/data
cd ${EXCHAIND_PATH}
wget https://okg-pub-hk.oss-cn-hongkong.aliyuncs.com/cdn/okc/snapshot/testnet-$version-$date-$height-rocksdb.tar.gz
tar -zxvf testnet-$version-$date-$height-rocksdb.tar.gz
# 4. start exchaind
# 启动
exchaind start --chain-id exchain-65 --db_backend rocksdb --home ${EXCHAIND_PATH}
2. 使用docker+快照启动
# 1. Initialize exchain node configurations
export EXCHAIND_PATH=~/.exchaind (或者其他目录)
exchaind init your_custom_moniker --chain-id exchain-65 --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/testnet-$version-$date-$height-rocksdb.tar.gz
tar -zxvf testnet-$version-$date-$height-rocksdb.tar.gz
# 3. download the docker image
docker pull okexchain/fullnode-testnet:latest
# 4. run docker based the snapshot downloaded in the previous step Start based on snapshot.
docker run -d --name exchain-testnet-fullnode -v ~/.exchaind/data:/root/.exchaind/data/ -p 8545:8545 -p 26656:26656 okexchain/fullnode-testnet:latest