Skip to content

Commit

Permalink
Add script to generate vesting accounts (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
shanev authored May 25, 2021
1 parent 8ed2b77 commit 7a32d60
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
31 changes: 31 additions & 0 deletions accounts.sh
Original file line number Diff line number Diff line change
@@ -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
12 changes: 12 additions & 0 deletions build-genesis.sh
Original file line number Diff line number Diff line change
@@ -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
6 changes: 1 addition & 5 deletions hatching.sh → validators.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 7a32d60

Please sign in to comment.