From edcb0e15f28b40056a5bb734fecebedac31b7ddf Mon Sep 17 00:00:00 2001 From: Vaclav Pavlin Date: Wed, 23 Oct 2024 10:23:25 +0200 Subject: [PATCH] chore(networkmonitor): add missing field on RlnRelay init, set default for num of shard (#3136) --- apps/networkmonitor/networkmonitor.nim | 7 +++++++ apps/networkmonitor/networkmonitor_config.nim | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/apps/networkmonitor/networkmonitor.nim b/apps/networkmonitor/networkmonitor.nim index 09a64c8d5..cb2bec6d5 100644 --- a/apps/networkmonitor/networkmonitor.nim +++ b/apps/networkmonitor/networkmonitor.nim @@ -614,6 +614,12 @@ when isMainModule: waitFor node.mountRelay() waitFor node.mountLibp2pPing() + var onFatalErrorAction = proc(msg: string) {.gcsafe, closure.} = + ## Action to be taken when an internal error occurs during the node run. + ## e.g. the connection with the database is lost and not recovered. + error "Unrecoverable error occurred", error = msg + quit(QuitFailure) + if conf.rlnRelay and conf.rlnRelayEthContractAddress != "": let rlnConf = WakuRlnConfig( rlnRelayDynamic: conf.rlnRelayDynamic, @@ -624,6 +630,7 @@ when isMainModule: rlnRelayCredPassword: "", rlnRelayTreePath: conf.rlnRelayTreePath, rlnEpochSizeSec: conf.rlnEpochSizeSec, + onFatalErrorAction: onFatalErrorAction, ) try: diff --git a/apps/networkmonitor/networkmonitor_config.nim b/apps/networkmonitor/networkmonitor_config.nim index 291144c5b..bf1662649 100644 --- a/apps/networkmonitor/networkmonitor_config.nim +++ b/apps/networkmonitor/networkmonitor_config.nim @@ -45,7 +45,9 @@ type NetworkMonitorConf* = object .}: seq[uint16] numShardsInNetwork* {. - desc: "Number of shards in the network", name: "num-shards-in-network" + desc: "Number of shards in the network", + name: "num-shards-in-network", + defaultValue: 8 .}: uint32 refreshInterval* {.