diff --git a/waku/factory/internal_config.nim b/waku/factory/internal_config.nim index 8b8a45f60..877a608ce 100644 --- a/waku/factory/internal_config.nim +++ b/waku/factory/internal_config.nim @@ -32,7 +32,15 @@ proc enrConfiguration*( let shards: seq[uint16] = # no shards configured if conf.shards.len == 0: - toSeq(0 ..< conf.pubsubTopics.len).mapIt(uint16(it)) + var shardsLocal = newSeq[uint16]() + let shardsRes = topicsToRelayShards(conf.pubsubTopics) + if shardsRes.isOk() and shardsRes.get().isSome(): + shardsLocal = shardsRes.get().get().shardIds + else: + error "failed to parse pubsub topic, please format according to static shard specification", + error = shardsRes.error + shardsLocal + # some shards configured else: toSeq(conf.shards.mapIt(uint16(it)))