[#493] node: Replace relay config value to node section

Set default value to `false`.

Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
remotes/KirillovDenis/release/v0.21.1
Leonard Lyubich 2021-05-12 12:29:19 +03:00 committed by Leonard Lyubich
parent f90fc86ec8
commit d36084c26a
1 changed files with 3 additions and 3 deletions

View File

@ -64,6 +64,7 @@ const (
cfgNodeKey = "node.key"
cfgBootstrapAddress = "node.address"
cfgNodeAttributePrefix = "node.attribute"
cfgNodeRelay = "node.relay"
// config keys for cfgGRPC
cfgListenAddress = "grpc.endpoint"
@ -96,8 +97,6 @@ const (
cfgReplicatorPutTimeout = "replicator.put_timeout"
cfgReBootstrapRelay = "bootstrap.relay_only"
cfgObjectPutPoolSize = "pool.object.put.size"
cfgObjectGetPoolSize = "pool.object.get.size"
cfgObjectHeadPoolSize = "pool.object.head.size"
@ -354,7 +353,7 @@ func initCfg(path string) *cfg {
reputationWorkerPool, err := ants.NewPool(notificationHandlerPoolSize)
fatalOnErr(err)
relayOnly := viperCfg.GetBool(cfgReBootstrapRelay)
relayOnly := viperCfg.GetBool(cfgNodeRelay)
c := &cfg{
ctx: context.Background(),
@ -431,6 +430,7 @@ func initViper(path string) *viper.Viper {
func defaultConfiguration(v *viper.Viper) {
v.SetDefault(cfgNodeKey, "") // node key
v.SetDefault(cfgBootstrapAddress, "") // announced address of the node
v.SetDefault(cfgNodeRelay, false)
v.SetDefault(cfgMorphRPCAddress, []string{})
v.SetDefault(cfgMorphNotifyRPCAddress, []string{})