diff --git a/tests/e2e/docker/hermes.Dockerfile b/tests/e2e/docker/hermes.Dockerfile index 81d675079f8..97176a7d37b 100644 --- a/tests/e2e/docker/hermes.Dockerfile +++ b/tests/e2e/docker/hermes.Dockerfile @@ -1,6 +1,6 @@ -FROM --platform=linux/amd64 informalsystems/hermes:1.4.1 AS hermes-builder +FROM --platform=linux/amd64 informalsystems/hermes:v1.7.3 AS hermes-builder -FROM debian:buster-slim +FROM --platform=linux/amd64 debian:buster-slim USER root COPY --from=hermes-builder /usr/bin/hermes /usr/local/bin/ diff --git a/tests/e2e/e2e_setup_test.go b/tests/e2e/e2e_setup_test.go index 9aa1ef43de7..992526387fa 100644 --- a/tests/e2e/e2e_setup_test.go +++ b/tests/e2e/e2e_setup_test.go @@ -4,7 +4,9 @@ import ( "context" "encoding/json" "fmt" + "io" "math/rand" + "net/http" "os" "os/exec" "path" @@ -641,7 +643,7 @@ func (s *IntegrationTestSuite) runIBCRelayer0() { &dockertest.RunOptions{ Name: fmt.Sprintf("%s-%s-relayer-0", s.chainA.id, s.chainB.id), Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.4.1", + Tag: "1.0.0", NetworkID: s.dkrNet.Network.ID, Mounts: []string{ fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), @@ -669,36 +671,35 @@ func (s *IntegrationTestSuite) runIBCRelayer0() { noRestart, ) s.Require().NoError(err) - // TODO: fix Hermes container REST endpoint - // endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) - // s.Require().Eventually( - // func() bool { - // resp, err := http.Get(endpoint) //nolint:gosec // this is a test - // if err != nil { - // return false - // } - - // defer resp.Body.Close() - - // bz, err := io.ReadAll(resp.Body) - // if err != nil { - // return false - // } - - // var respBody map[string]interface{} - // if err := json.Unmarshal(bz, &respBody); err != nil { - // return false - // } - - // status := respBody["status"].(string) - // result := respBody["result"].(map[string]interface{}) - - // return status == "success" && len(result["chains"].([]interface{})) == 2 - // }, - // 5*time.Minute, - // time.Second, - // "hermes relayer not healthy", - // ) + endpoint := fmt.Sprintf("http://%s/state", s.hermesResource0.GetHostPort("3031/tcp")) + s.Require().Eventually( + func() bool { + resp, err := http.Get(endpoint) //nolint:gosec // this is a test + if err != nil { + return false + } + + defer resp.Body.Close() + + bz, err := io.ReadAll(resp.Body) + if err != nil { + return false + } + + var respBody map[string]interface{} + if err := json.Unmarshal(bz, &respBody); err != nil { + return false + } + + status := respBody["status"].(string) + result := respBody["result"].(map[string]interface{}) + + return status == "success" && len(result["chains"].([]interface{})) == 2 + }, + 5*time.Minute, + time.Second, + "hermes relayer not healthy", + ) s.T().Logf("started Hermes relayer 0 container: %s", s.hermesResource0.Container.ID) @@ -741,7 +742,7 @@ func (s *IntegrationTestSuite) runIBCRelayer1() { &dockertest.RunOptions{ Name: fmt.Sprintf("%s-%s-relayer-1", s.chainA.id, s.chainB.id), Repository: "ghcr.io/cosmos/hermes-e2e", - Tag: "1.4.1", + Tag: "1.0.0", NetworkID: s.dkrNet.Network.ID, Mounts: []string{ fmt.Sprintf("%s/:/root/hermes", hermesCfgPath), diff --git a/tests/e2e/scripts/hermes_bootstrap.sh b/tests/e2e/scripts/hermes_bootstrap.sh index cc360b759bf..8c0db498623 100755 --- a/tests/e2e/scripts/hermes_bootstrap.sh +++ b/tests/e2e/scripts/hermes_bootstrap.sh @@ -47,7 +47,7 @@ port = 3001 id = '$GAIA_A_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_A_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_A_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_A_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-a' @@ -63,7 +63,7 @@ trust_threshold = { numerator = '1', denominator = '3' } id = '$GAIA_B_E2E_CHAIN_ID' rpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:26657' grpc_addr = 'http://$GAIA_B_E2E_VAL_HOST:9090' -websocket_addr = 'ws://$GAIA_B_E2E_VAL_HOST:26657/websocket' +event_source = { mode = "push", url = "ws://$GAIA_B_E2E_VAL_HOST:26657/websocket", batch_delay = "50ms" } rpc_timeout = '10s' account_prefix = 'cosmos' key_name = 'rly01-gaia-b'