From ddd03bb187970cbb6cc73f39f6571873e6230eca Mon Sep 17 00:00:00 2001 From: Gabriel mermelstein Date: Thu, 29 Aug 2024 11:44:25 -0600 Subject: [PATCH] improving logs and using defaults --- tests/testlib/wakunode.nim | 4 ++-- waku/factory/waku.nim | 11 +++++++---- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/tests/testlib/wakunode.nim b/tests/testlib/wakunode.nim index 96c2deeab7..b6184e330f 100644 --- a/tests/testlib/wakunode.nim +++ b/tests/testlib/wakunode.nim @@ -37,8 +37,8 @@ proc defaultTestWakuNodeConf*(): WakuNodeConf = nat: "any", maxConnections: 50, maxMessageSize: "1024 KiB", - clusterId: 0, - shards: @[uint16(0)], + clusterId: DefaultClusterId, + shards: @[DefaultShardId], relay: true, storeMessageDbUrl: "sqlite://store.sqlite3", ) diff --git a/waku/factory/waku.nim b/waku/factory/waku.nim index 669799c431..9a6c6bec7c 100644 --- a/waku/factory/waku.nim +++ b/waku/factory/waku.nim @@ -91,8 +91,9 @@ proc validateShards(conf: WakuNodeConf): Result[void, string] = for shard in conf.shards: if shard >= networkShards: - let msg = "Invalid shard: " & $shard & " when networkShards: " & $networkShards - # fmt doesn't work + let msg = + "validateShards invalid shard: " & $shard & " when networkShards: " & + $networkShards # fmt doesn't work error "validateShards failed", error = msg return err(msg) @@ -120,9 +121,11 @@ proc init*(T: type Waku, conf: WakuNodeConf): Result[Waku, string] = if shardsOpt.isSome(): let relayShards = shardsOpt.get() if relayShards.clusterId != conf.clusterId: - error "clusterId of the pubsub topic should match the node's cluster", + 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 = conf.clusterId, pubsubCluster = relayShards.clusterId - return err("clusterId of the pubsub topic should match the node's cluster") + 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)