[#1114] neofs-node: Make some parameters optional in relay mode

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-01 10:52:24 +03:00 committed by Alex Vanin
parent ce76325840
commit e292321ccf
2 changed files with 10 additions and 3 deletions

View file

@ -17,6 +17,10 @@ const (
) )
func parseAttributes(c *config.Config) []*netmap.NodeAttribute { func parseAttributes(c *config.Config) []*netmap.NodeAttribute {
if nodeconfig.Relay(c) {
return nil
}
stringAttributes := nodeconfig.Attributes(c) stringAttributes := nodeconfig.Attributes(c)
attrs, err := attributes.ParseV2Attributes(stringAttributes, nil) attrs, err := attributes.ParseV2Attributes(stringAttributes, nil)

View file

@ -237,7 +237,12 @@ func initCfg(path string) *cfg {
log, err := logger.NewLogger(logPrm) log, err := logger.NewLogger(logPrm)
fatalOnErr(err) 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 maxChunkSize := uint64(maxMsgSize) * 3 / 4 // 25% to meta, 75% to payload
maxAddrAmount := uint64(maxChunkSize) / addressSize // each address is about 72 bytes maxAddrAmount := uint64(maxChunkSize) / addressSize // each address is about 72 bytes
@ -256,8 +261,6 @@ func initCfg(path string) *cfg {
reputationWorkerPool, err := ants.NewPool(notificationHandlerPoolSize) reputationWorkerPool, err := ants.NewPool(notificationHandlerPoolSize)
fatalOnErr(err) fatalOnErr(err)
relayOnly := nodeconfig.Relay(appCfg)
c := &cfg{ c := &cfg{
ctx: context.Background(), ctx: context.Background(),
appCfg: appCfg, appCfg: appCfg,