Skip to content

Commit

Permalink
update genesis create script to update genesis creation (#526)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anmol1696 authored Jul 12, 2024
1 parent 4da2d43 commit a7e600d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
8 changes: 6 additions & 2 deletions starship/charts/devnet/scripts/default/create-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 6 additions & 2 deletions starship/tests/e2e/configs/scripts/create-custom-genesis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a7e600d

Please sign in to comment.