From fc223125289eba9f7b339d58bd7c30f091893a0c Mon Sep 17 00:00:00 2001 From: zerone Date: Sun, 3 Nov 2024 15:24:12 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- genesis.json => config/genesis.json | 0 init_testnet.sh | 30 ++++++++++++++++++++++++++--- 2 files changed, 27 insertions(+), 3 deletions(-) rename genesis.json => config/genesis.json (100%) diff --git a/genesis.json b/config/genesis.json similarity index 100% rename from genesis.json rename to config/genesis.json diff --git a/init_testnet.sh b/init_testnet.sh index 2d140aa..855dd32 100755 --- a/init_testnet.sh +++ b/init_testnet.sh @@ -103,20 +103,44 @@ echo $KEYRING echo $KEY1 # Sign genesis transaction mkdir $HOME/.cantod/config/gentx +# 生成创世交易(抵押金额最低一百万: 1000000stake) cantod gentx $KEY1 900000000000000000000000acanto --keyring-backend $KEYRING --chain-id $CHAINID --output-document $HOME/.cantod/config/gentx/gentx-1.json #cantod gentx $KEY2 1000000000000000000000acanto --keyring-backend $KEYRING --chain-id $CHAINID + + +# 将node1/2/3的gentx目录下的json文件移动到node0节点的gentx目录下(文件名最好改成对应节点名) +# $ cp -f /data/coeus/node1/config/gentx/*.json /data/coeus/node0/config/gentx +# $ cp -f /data/coeus/node2/config/gentx/*.json /data/coeus/node0/config/gentx +# $ cp -f /data/coeus/node3/config/gentx/*.json /data/coeus/node0/config/gentx + + # Collect genesis tx +# 将创世交易收集到节点的genesis.json文件中 +# $ cantod collect-gentxs --home /data/coeus/node0 2>&1 | jq cantod collect-gentxs -# Run this to ensure everything worked and that the genesis file is setup correctly -cantod validate-genesis +# # Run this to ensure everything worked and that the genesis file is setup correctly +# cantod validate-genesis +# 验证创世配置文件是否正确 +cantod validate-genesis +echo "File at $HOME/.cantod/config/genesis.json is a valid genesis file" if [[ $1 == "pending" ]]; then echo "pending mode is on, please wait for the first block committed." fi -cp -f $HOME/.cantod/config/genesis.json genesis.json +# 将node0的聚合genesis.json文件覆盖node1/2/3三个节点的genesis.json文件 +cp -f $HOME/.cantod/config/genesis.json config/genesis.json + +# 将node1/2/3的gentx目录下的json文件移动到node0节点的gentx目录下(文件名最好改成对应节点名) +cp -rf $HOME/.cantod/config/gentx config + + + + + +# 将node0的聚合genesis.json文件覆盖node1/2/3三个节点的genesis.json文件 # Start the node (remove the --pruning=nothing flag if historical queries are not needed)