From a7e600d870d3b54dad499b52379b3aded74ce57f Mon Sep 17 00:00:00 2001 From: Anmol Date: Fri, 12 Jul 2024 16:28:00 +0530 Subject: [PATCH] update genesis create script to update genesis creation (#526) --- starship/charts/devnet/scripts/default/create-genesis.sh | 8 ++++++-- .../tests/e2e/configs/scripts/create-custom-genesis.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/starship/charts/devnet/scripts/default/create-genesis.sh b/starship/charts/devnet/scripts/default/create-genesis.sh index ba4db01c..5d9c47f9 100644 --- a/starship/charts/devnet/scripts/default/create-genesis.sh +++ b/starship/charts/devnet/scripts/default/create-genesis.sh @@ -16,8 +16,12 @@ NUM_RELAYERS="${NUM_RELAYERS:=0}" # check if the binary has genesis subcommand or not, if not, set CHAIN_GENESIS_CMD to empty CHAIN_GENESIS_CMD=$($CHAIN_BIN 2>&1 | grep -q "genesis-related subcommands" && echo "genesis" || echo "") -jq -r ".genesis[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN init $CHAIN_ID --chain-id test-1 --recover -sed -i -e "s/\"test-1\"/\"$CHAIN_ID\"/g" $CHAIN_DIR/config/genesis.json +CHAIN_INIT_ID="$CHAIN_ID" +if [ "$CHAIN_BIN" == "osmosisd" ]; then + CHAIN_INIT_ID="test-1" +fi +jq -r ".genesis[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN init $CHAIN_ID --chain-id $CHAIN_INIT_ID --recover +sed -i -e "s/$CHAIN_INIT_ID/$CHAIN_ID/g" $CHAIN_DIR/config/genesis.json # Add genesis keys to the keyring and self delegate initial coins echo "Adding key...." $(jq -r ".genesis[0].name" $KEYS_CONFIG) diff --git a/starship/tests/e2e/configs/scripts/create-custom-genesis.sh b/starship/tests/e2e/configs/scripts/create-custom-genesis.sh index b49148ba..f758cbfa 100644 --- a/starship/tests/e2e/configs/scripts/create-custom-genesis.sh +++ b/starship/tests/e2e/configs/scripts/create-custom-genesis.sh @@ -12,8 +12,12 @@ set -eu # check if the binary has genesis subcommand or not, if not, set CHAIN_GENESIS_CMD to empty CHAIN_GENESIS_CMD=$($CHAIN_BIN 2>&1 | grep -q "genesis-related subcommands" && echo "genesis" || echo "") -jq -r ".genesis[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN init $CHAIN_ID --chain-id test-1 --recover -sed -i -e "s/\"test-1\"/\"$CHAIN_ID\"/g" $CHAIN_DIR/config/genesis.json +CHAIN_INIT_ID="$CHAIN_ID" +if [ "$CHAIN_BIN" == "osmosisd" ]; then + CHAIN_INIT_ID="test-1" +fi +jq -r ".genesis[0].mnemonic" $KEYS_CONFIG | $CHAIN_BIN init $CHAIN_ID --chain-id $CHAIN_INIT_ID --recover +sed -i -e "s/$CHAIN_INIT_ID/$CHAIN_ID/g" $CHAIN_DIR/config/genesis.json # Add genesis keys to the keyring and self delegate initial coins echo "Adding key...." $(jq -r ".genesis[0].name" $KEYS_CONFIG)