Skip to content

Commit

Permalink
Fix gaiad keys add outputs to stderr instead of stdout in SDK 0.43 (#…
Browse files Browse the repository at this point in the history
…1331)

* Fix gaiad keys add outputs to stderr instead of stdout in SDK 0.43

* Changelog

* Bumped gm version

Co-authored-by: Adi Seredinschi <[email protected]>
  • Loading branch information
greg-szabo and adizere authored Sep 10, 2021
1 parent 8544658 commit 6ecd818
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changelog/unreleased/bug-fixes/1312-fix-gm-stderr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- [gm](scripts/gm)
- Fix gaiad keys add prints to stderr instead of stdout in SDK 0.43 ([#1312])
- Bumped default rpc_timeout in Hermes config to 5s ([#1312])

[#1312]: https://github.com/informalsystems/ibc-rs/issues/1312

8 changes: 8 additions & 0 deletions scripts/gm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Gaiad Manager Change Log

## v0.0.8

### BUGFIXES
- Fixed gaiad 0.43 keys add printing key to stderr instead of stdout issue ([#1312])
- Bumped default rpc_timeout in Hermes config to 5s ([#1312])

[#1312]: https://github.com/informalsystems/ibc-rs/issues/1312

## v0.0.7

### BUGFIXES
Expand Down
20 changes: 10 additions & 10 deletions scripts/gm/bin/lib-gm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if [ "${DEBUG:-}" = "2" ]; then
fi

version() {
echo "v0.0.7"
echo "v0.0.8"
}

# Configuration Management
Expand Down Expand Up @@ -462,27 +462,27 @@ create() {
# Create validator key
VALIDATOR_MNEMONIC="$(get_validator_mnemonic "$1")"
if [ -z "$VALIDATOR_MNEMONIC" ] && [ -z "$HDPATH" ]; then
"$GAIAD_BINARY" keys add "validator" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/validator_seed.json"
"$GAIAD_BINARY" keys add "validator" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/validator_seed.json" 2>&1
elif [ -z "$VALIDATOR_MNEMONIC" ] && [ -n "$HDPATH" ]; then
"$GAIAD_BINARY" keys add "validator" --hd-path "$HDPATH" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/validator_seed.json"
"$GAIAD_BINARY" keys add "validator" --hd-path "$HDPATH" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/validator_seed.json" 2>&1
elif [ -n "$VALIDATOR_MNEMONIC" ] && [ -z "$HDPATH" ]; then
echo "$VALIDATOR_MNEMONIC" | "$GAIAD_BINARY" keys add "validator" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/validator_seed.json"
echo "$VALIDATOR_MNEMONIC" | "$GAIAD_BINARY" keys add "validator" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/validator_seed.json" 2>&1
sconfig "${HOME_DIR}/validator_seed.json" -t string "mnemonic=${VALIDATOR_MNEMONIC}" 1> /dev/null
elif [ -n "$VALIDATOR_MNEMONIC" ] && [ -n "$HDPATH" ]; then
echo "$VALIDATOR_MNEMONIC" | "$GAIAD_BINARY" keys add "validator" --hd-path "$HDPATH" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/validator_seed.json"
echo "$VALIDATOR_MNEMONIC" | "$GAIAD_BINARY" keys add "validator" --hd-path "$HDPATH" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/validator_seed.json" 2>&1
sconfig "${HOME_DIR}/validator_seed.json" -t string "mnemonic=${VALIDATOR_MNEMONIC}" 1> /dev/null
fi
# Create wallet key
WALLET_MNEMONIC="$(get_wallet_mnemonic "$1")"
if [ -z "$WALLET_MNEMONIC" ] && [ -z "$HDPATH" ]; then
"$GAIAD_BINARY" keys add "wallet" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/wallet_seed.json"
"$GAIAD_BINARY" keys add "wallet" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/wallet_seed.json" 2>&1
elif [ -z "$WALLET_MNEMONIC" ] && [ -n "$HDPATH" ]; then
"$GAIAD_BINARY" keys add "wallet" --hd-path "$HDPATH" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/wallet_seed.json"
"$GAIAD_BINARY" keys add "wallet" --hd-path "$HDPATH" --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/wallet_seed.json" 2>&1
elif [ -n "$WALLET_MNEMONIC" ] && [ -z "$HDPATH" ]; then
echo "$WALLET_MNEMONIC" | "$GAIAD_BINARY" keys add "wallet" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/wallet_seed.json"
echo "$WALLET_MNEMONIC" | "$GAIAD_BINARY" keys add "wallet" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/wallet_seed.json" 2>&1
sconfig "${HOME_DIR}/wallet_seed.json" -t string "mnemonic=${WALLET_MNEMONIC}" 1> /dev/null
elif [ -n "$WALLET_MNEMONIC" ] && [ -n "$HDPATH" ]; then
echo "$WALLET_MNEMONIC" | "$GAIAD_BINARY" keys add "wallet" --hd-path "$HDPATH" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json > "${HOME_DIR}/wallet_seed.json"
echo "$WALLET_MNEMONIC" | "$GAIAD_BINARY" keys add "wallet" --hd-path "$HDPATH" --recover --keyring-backend test --keyring-dir "${HOME_DIR}" --output json 1> "${HOME_DIR}/wallet_seed.json" 2>&1
sconfig "${HOME_DIR}/wallet_seed.json" -t string "mnemonic=${WALLET_MNEMONIC}" 1> /dev/null
fi
# Add accounts to genesis
Expand Down Expand Up @@ -769,7 +769,7 @@ id = '${ID}'
rpc_addr = 'http://localhost:${RPC}'
grpc_addr = 'http://localhost:${GRPC}'
websocket_addr = 'ws://localhost:${RPC}/websocket'
rpc_timeout = '1s'
rpc_timeout = '5s'
account_prefix = '${ACCOUNT_PREFIX}'
key_name = 'wallet'
store_prefix = 'ibc'
Expand Down

0 comments on commit 6ecd818

Please sign in to comment.