-
Notifications
You must be signed in to change notification settings - Fork 412
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #67 from cosmwasm/fix-setup.sh
Fix setup.sh
- Loading branch information
Showing
1 changed file
with
9 additions
and
9 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
#!/bin/sh | ||
#!/bin/bash | ||
set -o errexit -o nounset -o pipefail | ||
|
||
PASSWORD=${PASSWORD:-1234567890} | ||
# we can override the default token tickers as cli args | ||
STAKE=${1:-ustake} | ||
FEE=${2:-ucosm} | ||
STAKE=${STAKE_TOKEN:-ustake} | ||
FEE=${FEE_TOKEN:-ucosm} | ||
|
||
wasmd init --chain-id=testing testing | ||
# staking/governance token is hardcoded in config, change this | ||
sed -i "s/\"stake\"/\"$STAKE\"/" "$HOME"/.wasmd/config/genesis.json | ||
(echo $PASSWORD; echo $PASSWORD) | wasmcli keys add validator | ||
(echo "$PASSWORD"; echo "$PASSWORD") | wasmcli keys add validator | ||
# hardcode the validator account for this instance | ||
echo $PASSWORD | wasmd add-genesis-account validator "1000000000$STAKE,1000000000$FEE" | ||
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 "1000000000$STAKE,1000000000$FEE" | ||
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 "250000000$STAKE" | ||
wasmd collect-gentxs | ||
(echo "$PASSWORD"; echo "$PASSWORD"; echo "$PASSWORD") | wasmd gentx --name validator --amount "250000000$STAKE" | ||
wasmd collect-gentxs |