mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-04 06:53:12 +00:00
parent
4b444a1da6
commit
9778b45c67
@ -344,13 +344,6 @@ hence would have reachability issues.""",
|
||||
name: "num-shards-in-network"
|
||||
.}: uint32
|
||||
|
||||
pubsubTopics* {.
|
||||
desc:
|
||||
"Deprecated. Default pubsub topic to subscribe to. Argument may be repeated.",
|
||||
defaultValue: @[],
|
||||
name: "pubsub-topic"
|
||||
.}: seq[string]
|
||||
|
||||
shards* {.
|
||||
desc:
|
||||
"Shards index to subscribe to [0..NUM_SHARDS_IN_NETWORK-1]. Argument may be repeated.",
|
||||
|
||||
@ -177,31 +177,6 @@ proc new*(
|
||||
|
||||
logging.setupLog(confCopy.logLevel, confCopy.logFormat)
|
||||
|
||||
# TODO: remove after pubsubtopic config gets removed
|
||||
var shards = newSeq[uint16]()
|
||||
if confCopy.pubsubTopics.len > 0:
|
||||
let shardsRes = topicsToRelayShards(confCopy.pubsubTopics)
|
||||
if shardsRes.isErr():
|
||||
error "failed to parse pubsub topic, please format according to static shard specification",
|
||||
error = shardsRes.error
|
||||
return err("failed to parse pubsub topic: " & $shardsRes.error)
|
||||
|
||||
let shardsOpt = shardsRes.get()
|
||||
|
||||
if shardsOpt.isSome():
|
||||
let relayShards = shardsOpt.get()
|
||||
if relayShards.clusterId != confCopy.clusterId:
|
||||
error "clusterId of the pubsub topic should match the node's cluster. e.g. --pubsub-topic=/waku/2/rs/22/1 and --cluster-id=22",
|
||||
nodeCluster = confCopy.clusterId, pubsubCluster = relayShards.clusterId
|
||||
return err(
|
||||
"clusterId of the pubsub topic should match the node's cluster. e.g. --pubsub-topic=/waku/2/rs/22/1 and --cluster-id=22"
|
||||
)
|
||||
|
||||
for shard in relayShards.shardIds:
|
||||
shards.add(shard)
|
||||
confCopy.shards = shards
|
||||
|
||||
# Why can't I replace this block with a concise `.valueOr`?
|
||||
confCopy = block:
|
||||
let res = applyPresetConfiguration(confCopy)
|
||||
if res.isErr():
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user