From e292321ccf9cf487993f1b1d33d3251fbde39cb7 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 1 Mar 2022 10:52:24 +0300 Subject: [PATCH] [#1114] neofs-node: Make some parameters optional in relay mode Signed-off-by: Evgenii Stratonikov --- cmd/neofs-node/attributes.go | 4 ++++ cmd/neofs-node/config.go | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cmd/neofs-node/attributes.go b/cmd/neofs-node/attributes.go index 9cef09df4..8fa0475b0 100644 --- a/cmd/neofs-node/attributes.go +++ b/cmd/neofs-node/attributes.go @@ -17,6 +17,10 @@ const ( ) func parseAttributes(c *config.Config) []*netmap.NodeAttribute { + if nodeconfig.Relay(c) { + return nil + } + stringAttributes := nodeconfig.Attributes(c) attrs, err := attributes.ParseV2Attributes(stringAttributes, nil) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 5ba45cf86..de7618f39 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -237,7 +237,12 @@ func initCfg(path string) *cfg { log, err := logger.NewLogger(logPrm) fatalOnErr(err) - netAddr := nodeconfig.BootstrapAddresses(appCfg) + var netAddr network.AddressGroup + + relayOnly := nodeconfig.Relay(appCfg) + if !relayOnly { + netAddr = nodeconfig.BootstrapAddresses(appCfg) + } maxChunkSize := uint64(maxMsgSize) * 3 / 4 // 25% to meta, 75% to payload maxAddrAmount := uint64(maxChunkSize) / addressSize // each address is about 72 bytes @@ -256,8 +261,6 @@ func initCfg(path string) *cfg { reputationWorkerPool, err := ants.NewPool(notificationHandlerPoolSize) fatalOnErr(err) - relayOnly := nodeconfig.Relay(appCfg) - c := &cfg{ ctx: context.Background(), appCfg: appCfg,