Skip to content

Commit

Permalink
Fix gm hermes config to preserve the global section (#1008)
Browse files Browse the repository at this point in the history
* gm hermes config preserves the global section; fixes #1007.

* Moved parameter loading to load_config

* Added defaults for strategy and log_level
  • Loading branch information
adizere authored May 27, 2021
1 parent 7c0418e commit 5067621
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions scripts/gm/bin/lib-gm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ config_defaults() {
GLOBAL_ADD_TO_HERMES="false"
GLOBAL_WALLET_MNEMONIC=""
GLOBAL_WALLET_HDPATH=""
GLOBAL_HERMES_STRATEGY="all"
GLOBAL_HERMES_LOG_LEVEL="info"
}

install() {
Expand Down Expand Up @@ -187,6 +189,8 @@ load_config() {
GLOBAL_ADD_TO_HERMES="$(stoml -q "$CONFIG_FILE" global.add_to_hermes || echo "$GLOBAL_ADD_TO_HERMES")"
GLOBAL_WALLET_MNEMONIC="$(stoml -q "$CONFIG_FILE" global.wallet_mnemonic || echo "$GLOBAL_WALLET_MNEMONIC")"
GLOBAL_WALLET_HDPATH="$(stoml -q "$CONFIG_FILE" global.wallet_hdpath || echo "$GLOBAL_WALLET_HDPATH")"
GLOBAL_HERMES_STRATEGY="$(stoml -q "$GLOBAL_HERMES_CONFIG" global.strategy || echo "$GLOBAL_HERMES_STRATEGY")"
GLOBAL_HERMES_LOG_LEVEL="$(stoml -q "$GLOBAL_HERMES_CONFIG" global.log_level || echo "$GLOBAL_HERMES_LOG_LEVEL")"
export GLOBAL_GAIAD_BINARY
export GLOBAL_HERMES_BINARY
export GLOBAL_HOME_DIR
Expand Down Expand Up @@ -694,8 +698,8 @@ list_keys() {
hermes_config() {
cat <<EOF > "$GLOBAL_HERMES_CONFIG"
[global]
strategy = 'naive'
log_level = 'info'
strategy = '${GLOBAL_HERMES_STRATEGY}'
log_level = '${GLOBAL_HERMES_LOG_LEVEL}'
EOF
for i in $ALL_NODES
Expand Down

0 comments on commit 5067621

Please sign in to comment.