mirror of
https://github.com/waku-org/nwaku.git
synced 2025-02-24 21:08:38 +00:00
feature/mount-filter-protocol (#125)
This commit is contained in:
parent
a4c6caa62f
commit
76e0b49e2b
@ -11,7 +11,7 @@ import
|
|||||||
libp2p/multistream,
|
libp2p/multistream,
|
||||||
libp2p/transports/transport,
|
libp2p/transports/transport,
|
||||||
libp2p/transports/tcptransport,
|
libp2p/transports/tcptransport,
|
||||||
../../waku/protocol/v2/[waku_filter, message_notifier],
|
../../waku/protocol/v2/[waku_relay, waku_filter, message_notifier],
|
||||||
../test_helpers, ./utils
|
../test_helpers, ./utils
|
||||||
|
|
||||||
procSuite "Waku Filter":
|
procSuite "Waku Filter":
|
||||||
|
@ -12,7 +12,7 @@ import
|
|||||||
libp2p/peerinfo,
|
libp2p/peerinfo,
|
||||||
rpc/wakurpc,
|
rpc/wakurpc,
|
||||||
standard_setup,
|
standard_setup,
|
||||||
../../protocol/v2/[waku_relay, waku_store], ../common,
|
../../protocol/v2/[waku_relay, waku_store, waku_filter], ../common,
|
||||||
./waku_types, ./config, ./standard_setup, ./rpc/wakurpc
|
./waku_types, ./config, ./standard_setup, ./rpc/wakurpc
|
||||||
|
|
||||||
# key and crypto modules different
|
# key and crypto modules different
|
||||||
@ -129,6 +129,9 @@ proc start*(node: WakuNode) {.async.} =
|
|||||||
let storeProto = WakuStore.init()
|
let storeProto = WakuStore.init()
|
||||||
node.switch.mount(storeProto)
|
node.switch.mount(storeProto)
|
||||||
|
|
||||||
|
let filterProto = WakuFilter.init()
|
||||||
|
node.switch.mount(filterProto)
|
||||||
|
|
||||||
# TODO Get this from WakuNode obj
|
# TODO Get this from WakuNode obj
|
||||||
let peerInfo = node.peerInfo
|
let peerInfo = node.peerInfo
|
||||||
let id = peerInfo.peerId.pretty
|
let id = peerInfo.peerId.pretty
|
||||||
@ -154,7 +157,7 @@ proc subscribe*(w: WakuNode, topic: Topic, handler: TopicHandler) =
|
|||||||
# XXX Consider awaiting here
|
# XXX Consider awaiting here
|
||||||
discard wakuRelay.subscribe(topic, handler)
|
discard wakuRelay.subscribe(topic, handler)
|
||||||
|
|
||||||
proc subscribe*(w: WakuNode, contentFilter: ContentFilter, handler: ContentFilterHandler) =
|
proc subscribe*(w: WakuNode, contentFilter: waku_types.ContentFilter, handler: ContentFilterHandler) =
|
||||||
## Subscribes to a ContentFilter. Triggers handler when receiving messages on
|
## Subscribes to a ContentFilter. Triggers handler when receiving messages on
|
||||||
## this content filter. ContentFilter is a method that takes some content
|
## this content filter. ContentFilter is a method that takes some content
|
||||||
## filter, specifically with `ContentTopic`, and a `Message`. The `Message`
|
## filter, specifically with `ContentTopic`, and a `Message`. The `Message`
|
||||||
@ -170,7 +173,7 @@ proc unsubscribe*(w: WakuNode, topic: Topic) =
|
|||||||
## Status: Not yet implemented.
|
## Status: Not yet implemented.
|
||||||
## TODO Implement.
|
## TODO Implement.
|
||||||
|
|
||||||
proc unsubscribe*(w: WakuNode, contentFilter: ContentFilter) =
|
proc unsubscribe*(w: WakuNode, contentFilter: waku_types.ContentFilter) =
|
||||||
echo "NYI"
|
echo "NYI"
|
||||||
## Unsubscribe from a content filter.
|
## Unsubscribe from a content filter.
|
||||||
##
|
##
|
||||||
|
Loading…
x
Reference in New Issue
Block a user