[#607] cmd/node: Configure group of bootstrap addresses

There is a need to support multiple network addresses of the storage nodes.

Make `BootstrapAddress` to return `network.AddressGroup` (and rename).

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
This commit is contained in:
Leonard Lyubich 2021-06-22 20:35:56 +03:00 committed by Leonard Lyubich
parent 8060735732
commit 163c24a2d2
6 changed files with 42 additions and 27 deletions

View file

@ -215,7 +215,7 @@ func initCfg(path string) *cfg {
log, err := logger.NewLogger(logPrm)
fatalOnErr(err)
netAddr := nodeconfig.BootstrapAddress(appCfg)
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
@ -259,7 +259,7 @@ func initCfg(path string) *cfg {
maxChunkSize: maxChunkSize,
maxAddrAmount: maxAddrAmount,
},
localAddr: network.GroupFromAddress(netAddr),
localAddr: netAddr,
respSvc: response.NewService(
response.WithNetworkState(state),
),