[#471] cmd: allow to start node as Relay node

Disable bootstrapping completely.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2021-04-27 14:54:02 +03:00 committed by Alex Vanin
parent 5b85519f20
commit a8a9f88d90

View file

@ -109,6 +109,7 @@ const (
cfgReplicatorPutTimeout = "replicator.put_timeout"
cfgReBootstrapRelay = "bootstrap.relay_only"
cfgReBootstrapEnabled = "bootstrap.periodic.enabled"
cfgReBootstrapInterval = "bootstrap.periodic.interval"
@ -354,6 +355,8 @@ func initCfg(path string) *cfg {
netmapWorkerPool, err := initNetmapWorkerPool(viperCfg)
fatalOnErr(err)
relayOnly := viperCfg.GetBool(cfgReBootstrapRelay)
c := &cfg{
ctx: context.Background(),
internalErr: make(chan error),
@ -377,8 +380,8 @@ func initCfg(path string) *cfg {
state: state,
workerPool: netmapWorkerPool,
reBootstrapInterval: viperCfg.GetUint64(cfgReBootstrapInterval),
reBootstrapEnabled: viperCfg.GetBool(cfgReBootstrapEnabled),
reBoostrapTurnedOff: atomic.NewBool(false),
reBootstrapEnabled: !relayOnly && viperCfg.GetBool(cfgReBootstrapEnabled),
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
goOfflineEnabled: viperCfg.GetBool(cfgShutdownOfflineEnabled),
},
cfgNodeInfo: cfgNodeInfo{