mirror of
https://github.com/waku-org/nwaku.git
synced 2025-01-14 08:57:14 +00:00
Fix wrong install of filter rest api - now installed when using filter client mode and filter client protocol is mounted correctly (#2133)
This commit is contained in:
parent
a5b1cfd024
commit
5277d122d0
@ -473,9 +473,12 @@ proc setupProtocols(node: WakuNode,
|
|||||||
if conf.filternode != "":
|
if conf.filternode != "":
|
||||||
let filterNode = parsePeerInfo(conf.filternode)
|
let filterNode = parsePeerInfo(conf.filternode)
|
||||||
if filterNode.isOk():
|
if filterNode.isOk():
|
||||||
await node.mountFilterClient()
|
try:
|
||||||
node.peerManager.addServicePeer(filterNode.value, WakuLegacyFilterCodec)
|
await node.mountFilterClient()
|
||||||
node.peerManager.addServicePeer(filterNode.value, WakuFilterSubscribeCodec)
|
node.peerManager.addServicePeer(filterNode.value, WakuLegacyFilterCodec)
|
||||||
|
node.peerManager.addServicePeer(filterNode.value, WakuFilterSubscribeCodec)
|
||||||
|
except CatchableError:
|
||||||
|
return err("failed to mount waku filter client protocol: " & getCurrentExceptionMsg())
|
||||||
else:
|
else:
|
||||||
return err("failed to set node waku filter peer: " & filterNode.error)
|
return err("failed to set node waku filter peer: " & filterNode.error)
|
||||||
|
|
||||||
@ -595,7 +598,10 @@ proc startRestServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNo
|
|||||||
installRelayApiHandlers(server.router, app.node, cache)
|
installRelayApiHandlers(server.router, app.node, cache)
|
||||||
|
|
||||||
## Filter REST API
|
## Filter REST API
|
||||||
if conf.filter:
|
if conf.filternode != "" and
|
||||||
|
app.node.wakuFilterClient != nil and
|
||||||
|
app.node.wakuFilterClientLegacy != nil:
|
||||||
|
|
||||||
let legacyFilterCache = rest_legacy_filter_api.MessageCache.init()
|
let legacyFilterCache = rest_legacy_filter_api.MessageCache.init()
|
||||||
rest_legacy_filter_api.installLegacyFilterRestApiHandlers(server.router, app.node, legacyFilterCache)
|
rest_legacy_filter_api.installLegacyFilterRestApiHandlers(server.router, app.node, legacyFilterCache)
|
||||||
|
|
||||||
@ -606,7 +612,9 @@ proc startRestServer(app: App, address: ValidIpAddress, port: Port, conf: WakuNo
|
|||||||
installStoreApiHandlers(server.router, app.node)
|
installStoreApiHandlers(server.router, app.node)
|
||||||
|
|
||||||
## Light push API
|
## Light push API
|
||||||
rest_lightpush_api.installLightPushRequestHandler(server.router, app.node)
|
if conf.lightpushnode != "" and
|
||||||
|
app.node.wakuLightpushClient != nil:
|
||||||
|
rest_lightpush_api.installLightPushRequestHandler(server.router, app.node)
|
||||||
|
|
||||||
server.start()
|
server.start()
|
||||||
info "Starting REST HTTP server", url = "http://" & $address & ":" & $port & "/"
|
info "Starting REST HTTP server", url = "http://" & $address & ":" & $port & "/"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user