From 032933da282380a6f9c220fab21143e28bbb01f6 Mon Sep 17 00:00:00 2001 From: Amir Yahalom Date: Thu, 2 Dec 2021 18:13:34 +0200 Subject: [PATCH] start monitoring before ETH1 sync --- cli/exporter/node.go | 7 ++++--- cli/operator/node.go | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cli/exporter/node.go b/cli/exporter/node.go index 190e3c378a..a58a80f8c4 100644 --- a/cli/exporter/node.go +++ b/cli/exporter/node.go @@ -152,15 +152,16 @@ var StartExporterNodeCmd = &cobra.Command{ exporterNode = exporter.New(*exporterOptions) + if cfg.MetricsAPIPort > 0 { + go startMetricsHandler(Logger, network, cfg.MetricsAPIPort, cfg.EnableProfile) + } + metrics.WaitUntilHealthy(Logger, eth1Client, "eth1 node") metrics.WaitUntilHealthy(Logger, beaconClient, "beacon node") if err := exporterNode.StartEth1(eth1.HexStringToSyncOffset(cfg.ETH1Options.ETH1SyncOffset)); err != nil { Logger.Fatal("failed to start eth1", zap.Error(err)) } - if cfg.MetricsAPIPort > 0 { - go startMetricsHandler(Logger, network, cfg.MetricsAPIPort, cfg.EnableProfile) - } if err := exporterNode.Start(); err != nil { Logger.Fatal("failed to start exporter", zap.Error(err)) } diff --git a/cli/operator/node.go b/cli/operator/node.go index d5bdf09e61..c7a2c4c165 100644 --- a/cli/operator/node.go +++ b/cli/operator/node.go @@ -170,18 +170,18 @@ var StartNodeCmd = &cobra.Command{ validatorCtrl := validator.NewController(cfg.SSVOptions.ValidatorOptions) cfg.SSVOptions.ValidatorController = validatorCtrl - operatorNode = operator.New(cfg.SSVOptions) + if cfg.MetricsAPIPort > 0 { + go startMetricsHandler(Logger, cfg.MetricsAPIPort, cfg.EnableProfile) + } + metrics.WaitUntilHealthy(Logger, cfg.SSVOptions.Eth1Client, "eth1 node") metrics.WaitUntilHealthy(Logger, beaconClient, "beacon node") if err := operatorNode.StartEth1(eth1.HexStringToSyncOffset(cfg.ETH1Options.ETH1SyncOffset)); err != nil { Logger.Fatal("failed to start eth1", zap.Error(err)) } - if cfg.MetricsAPIPort > 0 { - go startMetricsHandler(Logger, cfg.MetricsAPIPort, cfg.EnableProfile) - } if err := operatorNode.Start(); err != nil { Logger.Fatal("failed to start SSV node", zap.Error(err)) }