From 38ff4d68fa972d53e4563e9f30f6bd305fe423b1 Mon Sep 17 00:00:00 2001 From: Sam Hassan Date: Wed, 15 Feb 2023 22:34:29 +0100 Subject: [PATCH] draft commit: service checkable --- go.mod | 2 +- go.sum | 2 ++ pkg/solana/relay.go | 9 +++++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 128adfde6..248e9cff6 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/gagliardetto/treeout v0.1.4 github.com/pkg/errors v0.9.1 github.com/prometheus/client_golang v1.12.1 - github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230118141007-0773f68325cd + github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230215211851-4d12e4c7e9ef github.com/smartcontractkit/libocr v0.0.0-20221121171434-482da3ed36d8 github.com/stretchr/testify v1.7.5 go.uber.org/multierr v1.8.0 diff --git a/go.sum b/go.sum index a9be2eda7..ec3ed9372 100644 --- a/go.sum +++ b/go.sum @@ -364,6 +364,8 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230118141007-0773f68325cd h1:f7QkXFVgYyjcGTKRbtBc14azb9kBxbXnZ4qAMcOgAns= github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230118141007-0773f68325cd/go.mod h1:5k0uC8R2ILaP/hs81M1ySmyHWtrRz0Bvx9dEVJjdu8o= +github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230215211851-4d12e4c7e9ef h1:edRoDaR6gxYKU0vt5sAeH6QHw29B8CwuVp55ArZeM2c= +github.com/smartcontractkit/chainlink-relay v0.1.6-0.20230215211851-4d12e4c7e9ef/go.mod h1:5k0uC8R2ILaP/hs81M1ySmyHWtrRz0Bvx9dEVJjdu8o= github.com/smartcontractkit/libocr v0.0.0-20221121171434-482da3ed36d8 h1:KcTNxuP5g3GGUqn3WJe7KKnTixqfVZjmHnMAnKkLGJw= github.com/smartcontractkit/libocr v0.0.0-20221121171434-482da3ed36d8/go.mod h1:5JnCHuYgmIP9ZyXzgAfI5Iwu0WxBtBKp+ApeT5o1Cjw= github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= diff --git a/pkg/solana/relay.go b/pkg/solana/relay.go index 772d0d569..a690bad1d 100644 --- a/pkg/solana/relay.go +++ b/pkg/solana/relay.go @@ -64,6 +64,11 @@ func (r *Relayer) Healthy() error { return r.chainSet.Healthy() } +// Healthy only if all subservices are healthy +func (r *Relayer) RegisterHealthCheck(hc relaytypes.Checker) error { + return hc.Register("", r) +} + func (r *Relayer) NewConfigProvider(args relaytypes.RelayArgs) (relaytypes.ConfigProvider, error) { configWatcher, err := newConfigProvider(r.ctx, r.lggr, r.chainSet, args) if err != nil { @@ -189,6 +194,10 @@ func (c *configProvider) Close() error { }) } +func (c *configProvider) RegisterHealthCheck(hc relaytypes.Checker) error { + return hc.Register("", c) +} + func (c *configProvider) OffchainConfigDigester() types.OffchainConfigDigester { return c.offchainConfigDigester }