From 7a32d602ef8ee8f4e81f336395c0abca14a6dc70 Mon Sep 17 00:00:00 2001 From: Shane Vitarana Date: Tue, 25 May 2021 01:13:07 -0400 Subject: [PATCH] Add script to generate vesting accounts (#455) --- accounts.sh | 31 +++++++++++++++++++++++++++++++ build-genesis.sh | 12 ++++++++++++ hatching.sh => validators.sh | 6 +----- 3 files changed, 44 insertions(+), 5 deletions(-) create mode 100755 accounts.sh create mode 100755 build-genesis.sh rename hatching.sh => validators.sh (59%) diff --git a/accounts.sh b/accounts.sh new file mode 100755 index 00000000..fc62167a --- /dev/null +++ b/accounts.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +CONFIG=~/.starsd/config +NETWORK=cygnusx-1 +GENESIS_TIME=2021-05-25T00:44:44.536813Z +START_TIME=$(TZ=UTC date -j -f "%Y-%m-%dT%H:%M:%S" ${GENESIS_TIME:0:19} +%s) +ONE_YEAR=31556926 +ONE_HOUR=3600 + +rm -rf $CONFIG/gentx && mkdir $CONFIG/gentx +starsd init stargaze --chain-id=$NETWORK --stake-denom ustarx --overwrite + +vesting_start_time=$(($START_TIME + $ONE_HOUR)) +vesting_end_time=$(($vesting_start_time + $ONE_HOUR)) + +starsd add-genesis-account stars15zx6hhjcnnnwt3nlf49gae3dd5n4vkjxef6gq2 333333333333334ustarx \ + --vesting-amount 333333332333334ustarx \ + --vesting-start-time $vesting_start_time \ + --vesting-end-time $vesting_end_time + +starsd add-genesis-account stars1s4ckh9405q0a3jhkwx9wkf9hsjh66nmuu53dwe 333333333333333ustarx \ + --vesting-amount 333333332333333ustarx \ + --vesting-start-time $vesting_start_time \ + --vesting-end-time $vesting_end_time + +starsd add-genesis-account stars1g457jcltvqdpt50ysq8fe2e7hwtnmnlmc2mkht 333333333333333ustarx \ + --vesting-amount 333333332333333ustarx \ + --vesting-start-time $vesting_start_time \ + --vesting-end-time $vesting_end_time + +sed -i '' "2s/.*/ \"genesis_time\": \"$GENESIS_TIME\",/" $CONFIG/genesis.json diff --git a/build-genesis.sh b/build-genesis.sh new file mode 100755 index 00000000..99758cf1 --- /dev/null +++ b/build-genesis.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +CONFIG=~/.starsd/config +NETWORK=cygnusx-1 + +echo "Writing genesis accounts..." +sh ./accounts.sh + +echo "Writing validator transactions..." +sh ./validators.sh + +cp $CONFIG/genesis.json $NETWORK diff --git a/hatching.sh b/validators.sh similarity index 59% rename from hatching.sh rename to validators.sh index dd791a8d..7cfe71b7 100755 --- a/hatching.sh +++ b/validators.sh @@ -1,16 +1,12 @@ #!/bin/bash -NETWORK=bellatrix-1 +NETWORK=cygnusx-1 CONFIG=~/.starsd/config INITIAL_COINS=100000000ustarx -rm -rf $CONFIG/gentx && mkdir $CONFIG/gentx -starsd init stargaze --chain-id=$NETWORK --stake-denom ustarx --overwrite for i in $NETWORK/gentx/*.json; do echo $i starsd add-genesis-account $(jq -r '.body.messages[0].delegator_address' $i) $INITIAL_COINS cp $i $CONFIG/gentx/ done starsd collect-gentxs - -cp $CONFIG/genesis.json $NETWORK