From ba28e32e5894b79e8e75f97488a11ed4d4e37baa Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Thu, 30 Jul 2026 21:32:35 +0100 Subject: [PATCH] feat(conf): add localStoragePath to MessagingClientConf (#4083) The structured shapes had no way to set the node's storage directory: localStoragePath is kernel-only and the structured parser rejects bare kernel fields. Hosts (logos-delivery-module) inject a per-instance path and need a place the structured grammar accepts. Co-authored-by: Claude Fable 5 --- logos_delivery/api/conf/messaging_conf.nim | 4 ++++ tests/api/test_conf.nim | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/logos_delivery/api/conf/messaging_conf.nim b/logos_delivery/api/conf/messaging_conf.nim index a78305c49..6f3a867f2 100644 --- a/logos_delivery/api/conf/messaging_conf.nim +++ b/logos_delivery/api/conf/messaging_conf.nim @@ -45,6 +45,8 @@ type MessagingClientConf* = object ## Store retention policy (e.g. "time:3600;size:1GB"). storeMaxNumDbConnections* {.name: "store-max-num-db-connections".}: Opt[int] ## Maximum number of simultaneous store database connections. + localStoragePath* {.name: "local-storage-path".}: Opt[string] + ## Path to store local data. logLevel* {.name: "log-level".}: Opt[logging.LogLevel] ## Process log level (TRACE..FATAL); applied by the kernel on node creation. logFormat* {.name: "log-format".}: Opt[logging.LogFormat] @@ -98,6 +100,8 @@ proc toWakuNodeConf*( conf.storeMaxNumDbConnections = self.storeMaxNumDbConnections.get() if self.storenode.isSome(): conf.storenode = self.storenode.get() + if self.localStoragePath.isSome(): + conf.localStoragePath = self.localStoragePath.get() if self.clusterId.isSome(): conf.clusterId = self.clusterId diff --git a/tests/api/test_conf.nim b/tests/api/test_conf.nim index ba1bf6f91..4ffc547a3 100644 --- a/tests/api/test_conf.nim +++ b/tests/api/test_conf.nim @@ -154,6 +154,13 @@ suite "parseLogosDeliveryConf - JSON parsing": WakuNodeConf(lc.kernelConf).clusterId == Opt.some(7'u16) # kernel field lc.messagingConf.get().reliabilityEnabled == Opt.some(true) # messaging-only + test "localStoragePath override maps to the kernel": + let lc = parseLogosDeliveryConf( + """{"mode": "Core", "messagingOverrides": {"localStoragePath": "/tmp/inst-1/data"}}""" + ).valueOr: + raiseAssert error + check WakuNodeConf(lc.kernelConf).localStoragePath == "/tmp/inst-1/data" + test "messaging overrides are recorded verbatim, unset fields left none": let lc = parseLogosDeliveryConf("""{"messagingOverrides": {"clusterId": 7}}""").valueOr: raiseAssert error