Skip to content

Commit

Permalink
hermes config 0.4 compatibility (#1040)
Browse files Browse the repository at this point in the history
* hermes config 0.4 compatibility

* hermes telemtry host added
  • Loading branch information
greg-szabo authored Jun 3, 2021
1 parent a1b40ae commit 39c7ecd
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ for raising multiple issues that helped us improve the reliability of Hermes.
- [gaiad-manager]
- Import hermes keys properly even if wallet HD derivation path is set ([#975])
- Apply default values to missing configuration parameters ([#993])
- `gm hermes config` now creates hermes 0.4.0 compatible configuration ([#1039])

### BREAKING CHANGES

Expand All @@ -50,6 +51,7 @@ for raising multiple issues that helped us improve the reliability of Hermes.
[#1003]: https://github.com/informalsystems/ibc-rs/issues/1003
[#1022]: https://github.com/informalsystems/ibc-rs/issues/1022
[gaiad-manager]: https://github.com/informalsystems/ibc-rs/blob/master/scripts/gm/README.md
[#1039]: https://github.com/informalsystems/ibc-rs/issues/1039

## v0.3.2
*May 21st, 2021*
Expand Down
5 changes: 5 additions & 0 deletions scripts/gm/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Gaiad Manager Change Log

## v0.0.4

### FEATURES
- Updated hermes configuration with the hermes 0.4.0 configuration parameters.

## v0.0.3

### BUGFIXES
Expand Down
7 changes: 5 additions & 2 deletions scripts/gm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,11 @@ the `gm.toml` file for node configuration. By default, newly created node config
setting up the hermes configuration and are only used in the `hermes` sub-command.
* `binary` - Path to the `hermes` binary to use.
* `config` - The hermes configuration file path.
* `strategy` - The hermes configuration strategy paremeter.
* `log_level` - The hermes configuration log_level paremeter.
* `strategy` - The hermes configuration strategy parameter.
* `log_level` - The hermes configuration log_level parameter.
* `telemetry_enabled` - The hermes configuration telemetry.enabled parameter.
* `telemetry_host` - The hermes configuration telemetry.host parameter.
* `telemetry_port` - The hermes configuration telemetry.port parameter.

**Tribal knowledge**: (things they don't tell you)
* the user is welcome to create additional nodes outside the scope of `gm` on the local machine but `gm` will only
Expand Down
23 changes: 22 additions & 1 deletion 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.3"
echo "v0.0.4"
}

config_defaults() {
Expand All @@ -21,6 +21,9 @@ config_defaults() {
GLOBAL_HERMES_CONFIG="${HOME}/.hermes/config.toml"
GLOBAL_HERMES_STRATEGY="packets"
GLOBAL_HERMES_LOG_LEVEL="info"
GLOBAL_HERMES_TELEMETRY_ENABLED="true"
GLOBAL_HERMES_TELEMETRY_HOST="127.0.0.1"
GLOBAL_HERMES_TELEMETRY_PORT="3001"
}

install() {
Expand Down Expand Up @@ -185,6 +188,9 @@ load_config() {
GLOBAL_HERMES_CONFIG="$(eval echo "$(stoml -sq "$CONFIG_FILE" global.hermes.config || echo "$GLOBAL_HERMES_CONFIG")")"
GLOBAL_HERMES_STRATEGY="$(stoml -sq "$CONFIG_FILE" global.hermes.strategy || echo "$GLOBAL_HERMES_STRATEGY")"
GLOBAL_HERMES_LOG_LEVEL="$(stoml -sq "$CONFIG_FILE" global.hermes.log_level || echo "$GLOBAL_HERMES_LOG_LEVEL")"
GLOBAL_HERMES_TELEMETRY_ENABLED="$(stoml -sq "$CONFIG_FILE" global.hermes.telemetry_enabled || echo "$GLOBAL_HERMES_TELEMETRY_ENABLED")"
GLOBAL_HERMES_TELEMETRY_HOST="$(stoml -sq "$CONFIG_FILE" global.hermes.telemetry_host || echo "$GLOBAL_HERMES_TELEMETRY_HOST")"
GLOBAL_HERMES_TELEMETRY_PORT="$(stoml -sq "$CONFIG_FILE" global.hermes.telemetry_port || echo "$GLOBAL_HERMES_TELEMETRY_PORT")"
export GLOBAL_GAIAD_BINARY
export GLOBAL_HOME_DIR
export GLOBAL_AUTO_MAINTAIN_CONFIG
Expand All @@ -195,6 +201,9 @@ load_config() {
export GLOBAL_HERMES_CONFIG
export GLOBAL_HERMES_STRATEGY
export GLOBAL_HERMES_LOG_LEVEL
export GLOBAL_HERMES_TELEMETRY_ENABLED
export GLOBAL_HERMES_TELEMETRY_HOST
export GLOBAL_HERMES_TELEMETRY_PORT
if [ "$FRESH_CONFIG" = "yes" ]; then
write_default_config
VALIDATORS=""
Expand Down Expand Up @@ -273,6 +282,9 @@ binary="$GLOBAL_HERMES_BINARY"
config="$GLOBAL_HERMES_CONFIG"
strategy="$GLOBAL_HERMES_STRATEGY"
log_level="$GLOBAL_HERMES_LOG_LEVEL"
telemetry_enabled="$GLOBAL_HERMES_TELEMETRY_ENABLED"
telemetry_host="$GLOBAL_HERMES_TELEMETRY_HOST"
telemetry_port="$GLOBAL_HERMES_TELEMETRY_PORT"
EOF
set -e
Expand Down Expand Up @@ -706,6 +718,11 @@ hermes_config() {
strategy = '${GLOBAL_HERMES_STRATEGY}'
log_level = '${GLOBAL_HERMES_LOG_LEVEL}'
[telemetry]
enabled = ${GLOBAL_HERMES_TELEMETRY_ENABLED}
host = '${GLOBAL_HERMES_TELEMETRY_HOST}'
port = ${GLOBAL_HERMES_TELEMETRY_PORT}
EOF
for i in $ALL_NODES
do
Expand All @@ -726,6 +743,10 @@ account_prefix='cosmos'
key_name='wallet'
store_prefix='ibc'
fee_denom='stake'
fee_amount=1000
gas=300000
clock_drift='5s'
trusting_period='14days'
[chains.trust_threshold]
numerator = '1'
Expand Down
9 changes: 9 additions & 0 deletions scripts/gm/gm.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ strategy="packets"
# Hermes configuration log_level parameter.
log_level="info"

# Hermes configuration telemetry.enabled parameter.
telemetry_enabled=true

# Hermes configuration telemetry.host parameter.
telemetry_host='127.0.0.1'

# Hermes configuration telemetry.port parameter.
telemetry_port=3001

##
## Sub-section (node) definitions and parameter redefinitons below.
##
Expand Down

0 comments on commit 39c7ecd

Please sign in to comment.