From a8a9f88d9076a9e92a14da92ec18d020aa04277d Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Tue, 27 Apr 2021 14:54:02 +0300 Subject: [PATCH] [#471] cmd: allow to start node as Relay node Disable bootstrapping completely. Signed-off-by: Evgenii Stratonikov --- cmd/neofs-node/config.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/cmd/neofs-node/config.go b/cmd/neofs-node/config.go index 2258f85d5f..314c791c8c 100644 --- a/cmd/neofs-node/config.go +++ b/cmd/neofs-node/config.go @@ -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{