[#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:
parent
5b85519f20
commit
a8a9f88d90
1 changed files with 5 additions and 2 deletions
|
@ -109,6 +109,7 @@ const (
|
||||||
|
|
||||||
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
cfgReplicatorPutTimeout = "replicator.put_timeout"
|
||||||
|
|
||||||
|
cfgReBootstrapRelay = "bootstrap.relay_only"
|
||||||
cfgReBootstrapEnabled = "bootstrap.periodic.enabled"
|
cfgReBootstrapEnabled = "bootstrap.periodic.enabled"
|
||||||
cfgReBootstrapInterval = "bootstrap.periodic.interval"
|
cfgReBootstrapInterval = "bootstrap.periodic.interval"
|
||||||
|
|
||||||
|
@ -354,6 +355,8 @@ func initCfg(path string) *cfg {
|
||||||
netmapWorkerPool, err := initNetmapWorkerPool(viperCfg)
|
netmapWorkerPool, err := initNetmapWorkerPool(viperCfg)
|
||||||
fatalOnErr(err)
|
fatalOnErr(err)
|
||||||
|
|
||||||
|
relayOnly := viperCfg.GetBool(cfgReBootstrapRelay)
|
||||||
|
|
||||||
c := &cfg{
|
c := &cfg{
|
||||||
ctx: context.Background(),
|
ctx: context.Background(),
|
||||||
internalErr: make(chan error),
|
internalErr: make(chan error),
|
||||||
|
@ -377,8 +380,8 @@ func initCfg(path string) *cfg {
|
||||||
state: state,
|
state: state,
|
||||||
workerPool: netmapWorkerPool,
|
workerPool: netmapWorkerPool,
|
||||||
reBootstrapInterval: viperCfg.GetUint64(cfgReBootstrapInterval),
|
reBootstrapInterval: viperCfg.GetUint64(cfgReBootstrapInterval),
|
||||||
reBootstrapEnabled: viperCfg.GetBool(cfgReBootstrapEnabled),
|
reBootstrapEnabled: !relayOnly && viperCfg.GetBool(cfgReBootstrapEnabled),
|
||||||
reBoostrapTurnedOff: atomic.NewBool(false),
|
reBoostrapTurnedOff: atomic.NewBool(relayOnly),
|
||||||
goOfflineEnabled: viperCfg.GetBool(cfgShutdownOfflineEnabled),
|
goOfflineEnabled: viperCfg.GetBool(cfgShutdownOfflineEnabled),
|
||||||
},
|
},
|
||||||
cfgNodeInfo: cfgNodeInfo{
|
cfgNodeInfo: cfgNodeInfo{
|
||||||
|
|
Loading…
Reference in a new issue