mirror of https://github.com/waku-org/nwaku.git
fix: wakunode2 config. adding new 'topic' config parameter. (#1727)
* wakunode2 config. adding new 'topic' config parameter. This new parameter can be repeated and we are starting to deprecate the parameter 'topics', that expected to receive a space-separated list of pubsubtopic to subscribe to. * Appying PR suggestions
This commit is contained in:
parent
8987d4a3ff
commit
2ec9809cf3
|
@ -547,7 +547,17 @@ proc setupProtocols(node: WakuNode, conf: WakuNodeConf,
|
||||||
peerExchangeHandler = some(handlePeerExchange)
|
peerExchangeHandler = some(handlePeerExchange)
|
||||||
|
|
||||||
if conf.relay:
|
if conf.relay:
|
||||||
let pubsubTopics = conf.topics.split(" ")
|
|
||||||
|
var pubsubTopics = @[""]
|
||||||
|
if conf.topicsDeprecated != "/waku/2/default-waku/proto":
|
||||||
|
warn "The 'topics' parameter is deprecated. Better use the 'topic' one instead."
|
||||||
|
if conf.topics != @["/waku/2/default-waku/proto"]:
|
||||||
|
return err("Please don't specify 'topics' and 'topic' simultaneously. Only use the 'topic' parameter")
|
||||||
|
|
||||||
|
# This clause (if conf.topicsDeprecated ) should disapear in >= v0.18.0
|
||||||
|
pubsubTopics = conf.topicsDeprecated.split(" ")
|
||||||
|
else:
|
||||||
|
pubsubTopics = conf.topics
|
||||||
try:
|
try:
|
||||||
await mountRelay(node, pubsubTopics, peerExchangeHandler = peerExchangeHandler)
|
await mountRelay(node, pubsubTopics, peerExchangeHandler = peerExchangeHandler)
|
||||||
except CatchableError:
|
except CatchableError:
|
||||||
|
|
|
@ -42,7 +42,6 @@ type
|
||||||
defaultValue: newSeq[ProtectedTopic](0)
|
defaultValue: newSeq[ProtectedTopic](0)
|
||||||
name: "protected-topic" .}: seq[ProtectedTopic]
|
name: "protected-topic" .}: seq[ProtectedTopic]
|
||||||
|
|
||||||
|
|
||||||
## Log configuration
|
## Log configuration
|
||||||
logLevel* {.
|
logLevel* {.
|
||||||
desc: "Sets the log level for process. Supported levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL",
|
desc: "Sets the log level for process. Supported levels: TRACE, DEBUG, INFO, NOTICE, WARN, ERROR or FATAL",
|
||||||
|
@ -54,7 +53,6 @@ type
|
||||||
defaultValue: logging.LogFormat.TEXT,
|
defaultValue: logging.LogFormat.TEXT,
|
||||||
name: "log-format" .}: logging.LogFormat
|
name: "log-format" .}: logging.LogFormat
|
||||||
|
|
||||||
|
|
||||||
## General node config
|
## General node config
|
||||||
agentString* {.
|
agentString* {.
|
||||||
defaultValue: "nwaku",
|
defaultValue: "nwaku",
|
||||||
|
@ -207,11 +205,16 @@ type
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
name: "keep-alive" }: bool
|
name: "keep-alive" }: bool
|
||||||
|
|
||||||
topics* {.
|
topicsDeprecated* {.
|
||||||
desc: "Default topics to subscribe to (space separated list)."
|
desc: "Default topics to subscribe to (space separated list). DEPRECATED: please use repeated --topic argument instead."
|
||||||
defaultValue: "/waku/2/default-waku/proto"
|
defaultValue: "/waku/2/default-waku/proto"
|
||||||
name: "topics" .}: string
|
name: "topics" .}: string
|
||||||
|
|
||||||
|
topics* {.
|
||||||
|
desc: "Default topic to subscribe to. Argument may be repeated."
|
||||||
|
defaultValue: @["/waku/2/default-waku/proto"]
|
||||||
|
name: "topic" .}: seq[string]
|
||||||
|
|
||||||
## Store and message store config
|
## Store and message store config
|
||||||
|
|
||||||
store* {.
|
store* {.
|
||||||
|
|
Loading…
Reference in New Issue