fix(rest): mount filterClient for REST API

This commit is contained in:
Václav Pavlín 2023-10-17 16:09:15 +02:00
parent a5b1cfd024
commit 357a245536
No known key found for this signature in database
GPG Key ID: B378FB31BB6D89A5

View File

@ -596,6 +596,10 @@ proc startRestServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNo
## Filter REST API
if conf.filter:
try:
waitFor app.node.mountFilterClient()
except CatchableError:
return err("Failed to mount FilterClient" & getCurrentExceptionMsg())
let legacyFilterCache = rest_legacy_filter_api.MessageCache.init()
rest_legacy_filter_api.installLegacyFilterRestApiHandlers(server.router, app.node, legacyFilterCache)