forked from TrueCloudLab/frostfs-node
[#1114] neofs-node: Make some parameters optional in relay mode
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
ce76325840
commit
e292321ccf
2 changed files with 10 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue