This commit is contained in:
Solovyov1796 2024-07-16 23:53:12 +08:00
parent 9d0d34fed9
commit 52c3fa3b46
2 changed files with 10 additions and 7 deletions

4
.gitignore vendored
View File

@ -39,8 +39,8 @@ build/darwin
build/linux build/linux
# Ignore deploy outputs # Ignore deploy outputs
networks/devnet devnet
networks/testnet testnet
# Go workspace files # Go workspace files
go.work go.work

View File

@ -137,22 +137,24 @@ elif [[ "$OS_NAME" = "GNU/Linux" ]]; then
for ((i=0; i<3; i++)) do for ((i=0; i<3; i++)) do
yes $PASSWORD | 0gchaind keys add "0gchain_mst_$i" --keyring-backend os --home "$ROOT_DIR"/node0 --eth yes $PASSWORD | 0gchaind keys add "0gchain_mst_$i" --keyring-backend os --home "$ROOT_DIR"/node0 --eth
done done
echo "before msa"
yes $PASSWORD | 0gchaind keys add msa --multisig-threshold 2 --multisig=0gchain_mst_0,0gchain_mst_1,0gchain_mst_2 --keyring-backend os --home "$ROOT_DIR"/node0 --eth yes $PASSWORD | 0gchaind keys add msa --multisig-threshold 2 --multisig=0gchain_mst_0,0gchain_mst_1,0gchain_mst_2 --keyring-backend os --home "$ROOT_DIR"/node0 --eth
echo "after msa"
# Copy validators to other nodes # Copy validators to other nodes
for ((i=1; i<$NUM_NODES; i++)) do for ((i=1; i<$NUM_NODES; i++)) do
cp "$ROOT_DIR"/node0/keyhash "$ROOT_DIR"/node$i cp "$ROOT_DIR"/node0/keyhash "$ROOT_DIR"/node$i
cp "$ROOT_DIR"/node0/*.address "$ROOT_DIR"/node$i cp "$ROOT_DIR"/node0/*.address "$ROOT_DIR"/node$i
cp "$ROOT_DIR"/node0/*.info "$ROOT_DIR"/node$i cp "$ROOT_DIR"/node0/*.info "$ROOT_DIR"/node$i
done done
echo "after cp"
else else
echo -e "\n\nOS: $OS_NAME" echo -e "\n\nOS: $OS_NAME"
echo "Unsupported OS to generate keys for validators!!!" echo "Unsupported OS to generate keys for validators!!!"
exit 1 exit 1
fi fi
MSA_ADDR=$(yes $PASSWORD | 0gchaind keys show -a msa --home "$ROOT_DIR/node$i")
# Add all validators in genesis # Add all validators in genesis
for ((i=0; i<$NUM_NODES; i++)) do for ((i=0; i<$NUM_NODES; i++)) do
for ((j=0; j<$NUM_NODES; j++)) do for ((j=0; j<$NUM_NODES; j++)) do
@ -163,9 +165,10 @@ for ((i=0; i<$NUM_NODES; i++)) do
fi fi
done done
0gchaind add-genesis-account 0g1zyvrkyr8pmczkguxztxpp3qcd0uhkt0tfxjupt $FAUCET_BALANCE --home "$ROOT_DIR/node$i" 0gchaind add-genesis-account 0g1zyvrkyr8pmczkguxztxpp3qcd0uhkt0tfxjupt $FAUCET_BALANCE --home "$ROOT_DIR/node$i"
0gchaind add-genesis-account $(0gchaind keys show -a msa --home "$ROOT_DIR/node$i") $VESTING_BALANCE --vesting-amount $VESTING_BALANCE --vesting-start-time $VESTING_ACCOUNT_START_TIME --vesting-end-time $VESTING_ACCOUNT_END_TIME --home "$ROOT_DIR/node$i" echo "msa address: $MSA_ADDR"
0gchaind add-genesis-account $MSA_ADDR $VESTING_BALANCE --vesting-amount $VESTING_BALANCE --vesting-start-time $VESTING_ACCOUNT_START_TIME --vesting-end-time $VESTING_ACCOUNT_END_TIME --home "$ROOT_DIR/node$i"
done done
echo "genesis txs"
# Prepare genesis txs # Prepare genesis txs
mkdir -p "$ROOT_DIR"/gentxs mkdir -p "$ROOT_DIR"/gentxs
for ((i=0; i<$NUM_NODES; i++)) do for ((i=0; i<$NUM_NODES; i++)) do