Merge pull request #59 from cosmwasm/customize-tickers-setup

Allow customization of denom in setup.sh
This commit is contained in:
Ethan Frey 2020-01-31 10:34:44 +01:00 committed by GitHub
commit 9842678d89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -1,17 +1,20 @@
#!/bin/sh
PASSWORD=${PASSWORD:-1234567890}
# we can override the default token tickers as cli args
STAKE=${1:-ustake}
FEE=${2:-ucosm}
wasmd init --chain-id=testing testing
# staking/governance token is hardcoded in config, change this
sed -i 's/"stake"/"ustake"/' "$HOME"/.wasmd/config/genesis.json
sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.wasmd/config/genesis.json
(echo $PASSWORD; echo $PASSWORD) | wasmcli keys add validator
# hardcode the validator account for this instance
echo $PASSWORD | wasmd add-genesis-account validator 1000000000ustake,1000000000ucosm
echo $PASSWORD | wasmd add-genesis-account validator "1000000000$STAKE,1000000000$FEE"
# (optionally) add a few more genesis accounts
for addr in "$@"; do
wasmd add-genesis-account $addr 1000000000ustake,1000000000ucosm
wasmd add-genesis-account $addr "1000000000$STAKE,1000000000$FEE"
done
# submit a genesis validator tx
(echo $PASSWORD; echo $PASSWORD; echo $PASSWORD) | wasmd gentx --name validator --amount 250000000ustake
(echo $PASSWORD; echo $PASSWORD; echo $PASSWORD) | wasmd gentx --name validator --amount "250000000$STAKE"
wasmd collect-gentxs