-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2909e66
commit 133886a
Showing
3 changed files
with
67 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#/bin/sh | ||
FILE=./check-gen-tx | ||
if [ -f "$FILE" ]; then | ||
sleep 50 | ||
curl http://runner:26657/status | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#/bin/sh | ||
FILE=./check-gen-tx | ||
DENOM=ustarx | ||
CHAIN_ID=cygnusx-1 | ||
ONE_HOUR=3600 | ||
ONE_DAY=$(($ONE_HOUR * 24)) | ||
ONE_YEAR=$(($ONE_DAY * 365)) | ||
VALIDATOR_COINS=1000000000000$DENOM | ||
|
||
|
||
if [ -f "$FILE" ]; then | ||
starsd init validator --chain-id cygnusx-1 | ||
if [ "$1" == "mainnet" ] | ||
then | ||
LOCKUP=ONE_YEAR | ||
else | ||
LOCKUP=ONE_DAY | ||
fi | ||
echo "Lockup period is $LOCKUP" | ||
|
||
echo "Adding vesting accounts..." | ||
GENESIS_TIME=$(jq '.genesis_time' ~/.starsd/config/genesis.json | tr -d '"') | ||
echo "Genesis time is $GENESIS_TIME" | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
GENESIS_UNIX_TIME=$(TZ=UTC gdate "+%s" -d $GENESIS_TIME) | ||
else | ||
GENESIS_UNIX_TIME=$(TZ=UTC date "+%s" -d $GENESIS_TIME) | ||
fi | ||
vesting_start_time=$(($GENESIS_UNIX_TIME + $LOCKUP)) | ||
vesting_end_time=$(($vesting_start_time + $LOCKUP)) | ||
|
||
sed -i 's#tcp://127.0.0.1:26657#tcp://0.0.0.0:26657#g' ~/.starsd/config/config.toml | ||
mkdir -p ~/.starsd/config/gentx | ||
echo "Processing validators..." | ||
for i in $CHAIN_ID/gentx/*.json; do | ||
echo $i | ||
starsd add-genesis-account $(jq -r '.body.messages[0].delegator_address' $i) $VALIDATOR_COINS \ | ||
--vesting-amount $VALIDATOR_COINS \ | ||
--vesting-start-time $vesting_start_time \ | ||
--vesting-end-time $vesting_end_time | ||
cp $i ~/.starsd/config/gentx/ | ||
done | ||
starsd collect-gentxs | ||
starsd validate-genesis | ||
starsd start | ||
fi |