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