From 87e08d85855f945021e83e9985c8d559caf36790 Mon Sep 17 00:00:00 2001 From: Madhur Shrimal Date: Tue, 22 Oct 2024 15:33:13 -0400 Subject: [PATCH] operator id --- node/node.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/node/node.go b/node/node.go index 999c5e448..6b212d2e8 100644 --- a/node/node.go +++ b/node/node.go @@ -172,6 +172,18 @@ func NewNode(reg *prometheus.Registry, config *Config, pubIPProvider pubip.Provi config.ID = keyPair.GetPubKeyG1().GetOperatorID() } else { + pkBytes, err := hex.DecodeString(config.BLSPublicKeyHex) + if err != nil { + return nil, fmt.Errorf("failed to decode BLS public key: %w", err) + } + pubkey := new(core.G1Point) + publicKey, err := pubkey.Deserialize(pkBytes) + if err != nil { + return nil, err + } + + config.ID = publicKey.GetOperatorID() + nodeLogger.Info("creating signer client", "url", config.BLSRemoteSignerUrl) creds := insecure.NewCredentials() if config.BLSSignerTLSCertFilePath != "" { @@ -187,6 +199,7 @@ func NewNode(reg *prometheus.Registry, config *Config, pubIPProvider pubip.Provi return nil, fmt.Errorf("failed to create new BLS remote signer client: %w", err) } blsClient = blssignerV1.NewSignerClient(conn) + } return &Node{