Skip to content

Commit e43612e

Browse files
authored
Refactor: waku_types -> waku_filter (#331)
Also create a folder with README for filter protocol.
1 parent fc32aeb commit e43612e

File tree

13 files changed

+92
-68
lines changed

13 files changed

+92
-68
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- Added JSON-RPC Admin API to retrieve information about peers registered on the `wakunode2`
77
- `StrictNoSign` enabled.
88
- Added JSON-RPC Private API to enable using symmetric or asymmetric cryptography to encrypt/decrypt message payloads
9+
- Refactor: Move `waku_filter` protocol into its own module.
910

1011
## 2020-11-30 v0.1
1112

examples/v2/chat2.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ import libp2p/[switch, # manage transports, a single entry poi
1919
muxers/muxer, # define an interface for stream multiplexing, allowing peers to offer many protocols over a single connection
2020
muxers/mplex/mplex] # define some contants and message types for stream multiplexing
2121
import ../../waku/v2/node/[config, wakunode2, waku_payload],
22-
../../waku/v2/protocol/[waku_relay, waku_filter],
22+
../../waku/v2/protocol/[waku_relay],
2323
../../waku/v2/protocol/waku_store/waku_store,
24+
../../waku/v2/protocol/waku_filter/waku_filter,
2425
../../waku/common/utils/nat,
2526
../../waku/v2/waku_types
2627

tests/v2/test_jsonrpc_waku.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ import
1919
admin_api,
2020
private_api],
2121
../../waku/v2/protocol/message_notifier,
22-
../../waku/v2/protocol/waku_filter,
2322
../../waku/v2/protocol/waku_store/waku_store,
2423
../../waku/v2/protocol/waku_swap/waku_swap,
24+
../../waku/v2/protocol/waku_filter/waku_filter,
2525
../test_helpers
2626

2727
template sourceDir*: string = currentSourcePath.rsplit(DirSep, 1)[0]

tests/v2/test_waku_filter.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ import
88
libp2p/stream/[bufferstream, connection],
99
libp2p/crypto/crypto,
1010
libp2p/multistream,
11-
../../waku/v2/protocol/[waku_filter, message_notifier],
11+
../../waku/v2/protocol/[message_notifier],
12+
../../waku/v2/protocol/waku_filter/waku_filter,
1213
../../waku/v2/waku_types,
1314
../test_helpers, ./utils
1415

tests/v2/test_wakunode.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ import
77
libp2p/crypto/secp,
88
libp2p/switch,
99
eth/keys,
10-
../../waku/v2/protocol/[waku_relay, waku_filter, message_notifier],
10+
../../waku/v2/protocol/[waku_relay, message_notifier],
1111
../../waku/v2/protocol/waku_store/waku_store,
12+
../../waku/v2/protocol/waku_filter/waku_filter,
1213
../../waku/v2/node/wakunode2,
1314
../test_helpers,
1415
../../waku/v2/waku_types

waku/v2/node/jsonrpc/admin_api.nim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import
77
../../waku_types,
88
../../protocol/waku_store/[waku_store_types, waku_store],
99
../../protocol/waku_swap/[waku_swap_types, waku_swap],
10-
../../protocol/waku_filter,
10+
../../protocol/waku_filter/[waku_filter_types, waku_filter],
1111
../wakunode2,
1212
./jsonrpc_types
1313

waku/v2/node/jsonrpc/filter_api.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import
55
json_rpc/rpcserver,
66
eth/[common, rlp, keys, p2p],
77
../../waku_types,
8+
../../protocol/waku_filter/waku_filter_types,
89
../wakunode2,
910
./jsonrpc_types
1011

@@ -87,4 +88,4 @@ proc installFilterApiHandlers*(node: WakuNode, rpcsrv: RpcServer, messageCache:
8788
return true
8889
else:
8990
# Failed to unsubscribe from one or more content filters
90-
raise newException(ValueError, "Failed to unsubscribe from contentFilters " & repr(fReq))
91+
raise newException(ValueError, "Failed to unsubscribe from contentFilters " & repr(fReq))

waku/v2/node/rpc/wakurpc.nim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import
66
../../protocol/waku_relay,
77
../../waku_types,
88
../../protocol/waku_store/waku_store,
9+
../../protocol/waku_filter/waku_filter,
910
../wakunode2
1011

1112
proc setupWakuRPC*(node: WakuNode, rpcsrv: RpcServer) =

waku/v2/node/wakunode2.nim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ import
1010
libp2p/protocols/pubsub/pubsub,
1111
libp2p/peerinfo,
1212
libp2p/standard_setup,
13-
../protocol/[waku_relay, waku_filter, message_notifier],
13+
../protocol/[waku_relay, message_notifier],
1414
../protocol/waku_store/waku_store,
1515
../protocol/waku_swap/waku_swap,
16+
../protocol/waku_filter/waku_filter,
1617
../waku_types,
1718
./message_store,
1819
./sqlite
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Waku Filter protocol
2+
3+
The filter protocol implements bandwidth preserving filtering for light nodes. See https://github.com/vacp2p/specs/blob/master/specs/waku/v2/waku-store.md for more information.

0 commit comments

Comments
 (0)