Deprecation of the 'topics' param (#1806)

This commit is contained in:
Ivan Folgueira Bande 2023-06-20 13:14:17 +02:00 committed by GitHub
parent 50412d1880
commit 5d4fa3ce73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 17 deletions

View File

@ -502,18 +502,7 @@ proc setupProtocols(node: WakuNode, conf: WakuNodeConf,
peerExchangeHandler = some(handlePeerExchange)
if conf.relay:
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
let pubsubTopics = conf.topics
try:
await mountRelay(node, pubsubTopics, peerExchangeHandler = peerExchangeHandler)
except CatchableError:

View File

@ -215,11 +215,6 @@ type
defaultValue: false
name: "keep-alive" }: bool
topicsDeprecated* {.
desc: "Default topics to subscribe to (space separated list). DEPRECATED: please use repeated --topic argument instead."
defaultValue: "/waku/2/default-waku/proto"
name: "topics" .}: string
topics* {.
desc: "Default topic to subscribe to. Argument may be repeated."
defaultValue: @["/waku/2/default-waku/proto"]