From a7c66f6c6dd3fc639ed71b27096a80daaa60b226 Mon Sep 17 00:00:00 2001 From: Philip Offtermatt Date: Fri, 28 Jul 2023 17:46:38 +0200 Subject: [PATCH] Adjust local-testnet for sdk 0.47 --- local-testnet.sh | 189 ++++++++--------------------------------------- 1 file changed, 32 insertions(+), 157 deletions(-) diff --git a/local-testnet.sh b/local-testnet.sh index 5ad19bc..53f9f8a 100755 --- a/local-testnet.sh +++ b/local-testnet.sh @@ -64,7 +64,7 @@ do # Build genesis file and node directory structure interchain-security-pd init $MONIKER --chain-id provider --home ${PROV_NODE_DIR} - jq ".app_state.gov.voting_params.voting_period = \"10s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ + jq ".app_state.gov.params.voting_period = \"10s\" | .app_state.staking.params.unbonding_time = \"86400s\"" \ ${PROV_NODE_DIR}/config/genesis.json > \ ${PROV_NODE_DIR}/edited_genesis.json && mv ${PROV_NODE_DIR}/edited_genesis.json ${PROV_NODE_DIR}/config/genesis.json @@ -82,7 +82,7 @@ do # Add stake to user PROV_ACCOUNT_ADDR=$(jq -r '.address' ${PROV_NODE_DIR}/${PROV_KEY}.json) - interchain-security-pd add-genesis-account $PROV_ACCOUNT_ADDR $USER_COINS --home ${PROV_NODE_DIR} --keyring-backend test + interchain-security-pd genesis add-genesis-account $PROV_ACCOUNT_ADDR $USER_COINS --home ${PROV_NODE_DIR} --keyring-backend test sleep 1 # copy genesis out, unless this validator is the lead validator @@ -121,7 +121,7 @@ do fi # Stake 1/1000 user's coins - interchain-security-pd gentx $PROV_KEY $STAKE --chain-id provider --home ${PROV_NODE_DIR} --keyring-backend test --moniker $MONIKER + interchain-security-pd genesis gentx $PROV_KEY $STAKE --chain-id provider --home ${PROV_NODE_DIR} --keyring-backend test --moniker $MONIKER sleep 1 # Copy gentxs to the lead validator for possible future collection. @@ -132,7 +132,7 @@ do done # Collect genesis transactions with lead validator -interchain-security-pd collect-gentxs --home ${LEAD_VALIDATOR_PROV_DIR} --gentx-dir ${LEAD_VALIDATOR_PROV_DIR}/config/gentx/ +interchain-security-pd genesis collect-gentxs --home ${LEAD_VALIDATOR_PROV_DIR} --gentx-dir ${LEAD_VALIDATOR_PROV_DIR}/config/gentx/ sleep 1 @@ -200,7 +200,7 @@ done PROVIDER_NODE_LISTEN_ADDR_STR=${PROVIDER_NODE_LISTEN_ADDR_STR::${#PROVIDER_NODE_LISTEN_ADDR_STR}-1} PROV_NODES_HOME_STR=${PROV_NODES_HOME_STR::${#PROV_NODES_HOME_STR}-1} -cometmock $PROVIDER_NODE_LISTEN_ADDR_STR ${LEAD_VALIDATOR_PROV_DIR}/config/genesis.json $PROVIDER_COMETMOCK_ADDR $PROV_NODES_HOME_STR &> ${LEAD_VALIDATOR_PROV_DIR}/cometmock_log & +cometmock $PROVIDER_NODE_LISTEN_ADDR_STR ${LEAD_VALIDATOR_PROV_DIR}/config/genesis.json $PROVIDER_COMETMOCK_ADDR $PROV_NODES_HOME_STR &> ${LEAD_VALIDATOR_PROV_DIR}/cometmock_log grpc & sleep 5 @@ -222,14 +222,16 @@ tee ${LEAD_VALIDATOR_PROV_DIR}/consumer-proposal.json< ${LEAD_VALIDATOR_CONS_DIR}/cometmock_log & +cometmock $CONSUMER_NODE_LISTEN_ADDR_STR ${LEAD_VALIDATOR_CONS_DIR}/config/genesis.json $CONSUMER_COMETMOCK_ADDR $CONS_NODES_HOME_STR &> ${LEAD_VALIDATOR_CONS_DIR}/cometmock_log grpc & -sleep 5 -# # Setup Hermes in packet relayer mode -# pkill -f hermes 2> /dev/null || true - -# tee ~/.hermes/config.toml< ~/.hermes/logs & - -# interchain-security-pd q tendermint-validator-set --home ${PROV_NODE_DIR} -# interchain-security-cd q tendermint-validator-set --home ${CONS_NODE_DIR} - -# DELEGATIONS=$(interchain-security-pd q staking delegations $PROV_ACCOUNT_ADDR --home ${PROV_NODE_DIR} -o json) - -# OPERATOR_ADDR=$(echo $DELEGATIONS | jq -r '.delegation_responses[0].delegation.validator_address') - -# interchain-security-pd tx staking delegate $OPERATOR_ADDR 1000000stake \ -# --from $PROV_KEY \ -# --keyring-backend test \ -# --home ${PROV_NODE_DIR} \ -# --chain-id provider \ -# -y -b block - -# sleep 13 - -# interchain-security-pd q tendermint-validator-set --home ${PROV_NODE_DIR} -# interchain-security-cd q tendermint-validator-set --home ${CONS_NODE_DIR} - - -# # sleep 5 - -# # tee ${PROV_NODE_DIR}/stop-consumer-proposal.json<