From 7a0a031814846b15b12c3b05165c7e865de73b81 Mon Sep 17 00:00:00 2001 From: LordGhostX Date: Fri, 15 Sep 2023 04:00:29 +0100 Subject: [PATCH] add filter config --- .cspell.json | 1 + docs/guides/nwaku/configure-nwaku.md | 32 ++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.cspell.json b/.cspell.json index 28a9dbe..71729c1 100644 --- a/.cspell.json +++ b/.cspell.json @@ -70,6 +70,7 @@ "certbot", "letsencrypt", "lightpushnode", + "filternode", ], "flagWords": [], "ignorePaths": [ diff --git a/docs/guides/nwaku/configure-nwaku.md b/docs/guides/nwaku/configure-nwaku.md index ad3ad9b..1e90018 100644 --- a/docs/guides/nwaku/configure-nwaku.md +++ b/docs/guides/nwaku/configure-nwaku.md @@ -51,12 +51,12 @@ To enable the [Store protocol](/overview/concepts/protocols#store) in `nwaku`, u --store-message-db-url=[DATABASE CONNECTION URL] ``` -For example, consider a `nwaku` node that is configured to be a `Store` protocol and retain messages received in the last `15,000` seconds: +For example, consider a `nwaku` node that is configured to be a `Store` protocol and retain messages received in the last `21600` seconds (6 hours): ```bash ./build/wakunode2 \ --store=true \ - --store-message-retention-policy=time:15000 \ + --store-message-retention-policy=time:21600 \ --store-message-db-url=sqlite://store.sqlite3 ``` @@ -197,6 +197,34 @@ Consider a `nwaku` node that enabled the REST `admin` and `private` API with a m --rest-relay-cache-capacity=100 ``` +## Configure Filter Protocol + +To enable the [Filter protocol](/overview/concepts/protocols#filter) in `nwaku`, use the `filter` configuration option: + +```bash +./build/wakunode2 --filter=true +``` + +You can configure `nwaku` as a `Filter client` using the `filternode` and `filter-timeout` options. This allows the node to request content filtering of messages from peers. + +```bash +./build/wakunode2 \ + --filternode=[FILTER PEER MULTIADDR] \ + --filter-timeout=[FILTER PEER TIMEOUT] +``` + +For example, consider a `nwaku` node that requests content filtering of messages from peers with a timeout of `21600` seconds (6 hours): + +```bash +./build/wakunode2 \ + --filternode=/dns4/node-01.ac-cn-hongkong-c.wakuv2.prod.statusim.net/tcp/30303/p2p/16Uiu2HAm4v86W3bmT1BiH6oSPzcsSr24iDQpSN5Qa992BCjjwgrD \ + --filter-timeout=21600 +``` + +:::info +If you omit the `filter-timeout` option, it will default to `14400` seconds (4 hours). +::: + ## Configure Light Push Protocol To enable the [Light Push protocol](/overview/concepts/protocols#light-push) in `nwaku`, use the `lightpush` configuration option: