diff --git a/docs/guides/js-waku/light-send-receive.md b/docs/guides/js-waku/light-send-receive.md index 2831ada..002f0ca 100644 --- a/docs/guides/js-waku/light-send-receive.md +++ b/docs/guides/js-waku/light-send-receive.md @@ -127,11 +127,17 @@ const callback = (wakuMessage) => { console.log(messageObj); }; -// Subscribe to content topics and display new messages -const unsubscribe = await node.filter.subscribe([decoder], callback); +// Create a filter subscription +const subscription = await node.filter.createSubscription(); -// Use the unsubscribe() function to stop receiving messages -// await unsubscribe(); +// Subscribe to content topics and process new messages +await subscription.subscribe([decoder], callback); +``` + +You can use the `subscription.unsubscribe()` function to stop receiving messages from a content topic: + +```js +await subscription.unsubscribe([contentTopic]); ``` :::tip Congratulations! diff --git a/docs/guides/nwaku/configure-nwaku.md b/docs/guides/nwaku/configure-nwaku.md index 9f117a0..603656f 100644 --- a/docs/guides/nwaku/configure-nwaku.md +++ b/docs/guides/nwaku/configure-nwaku.md @@ -38,10 +38,11 @@ This example describes configuring a domain name that resolves to your node's IP To enable message caching and serve them to network peers, enable the [Store protocol](/overview/concepts/protocols#store) using the following configuration options: - `store`: Enables storing messages to serve them to peers (disabled by default). -- `store-message-retention-policy`: Retention policy of the store node (how long messages will be persisted). Two different retention policies are supported: +- `store-message-retention-policy`: Retention policy of the store node (how long messages will be persisted). Three different retention policies are supported: - Time retention policy: `time:` (e.g., `time:14400`) - Capacity retention policy: `capacity:` (e.g, `capacity:25000`) - - Set this option to an empty string to disable the retention policy. If you omit this option, it will default to `time:172800` (48 hours). + - Size retention policy: `size:` (e.g, `size:512MB` or `size:10GB`) + - Set this option to `none` to disable the retention policy. If you omit this option, it will default to `time:172800` (48 hours). - `store-message-db-url`: Database connection URL for persisting messages in the [SQLAlchemy database URL format](https://docs.sqlalchemy.org/en/20/core/engines.html#database-urls). Setting this option to an empty string will instruct the node to use the fallback in-memory message store. If you omit this option, it will default to `sqlite://store.sqlite3`. ```bash diff --git a/docs/guides/nwaku/run-docker.md b/docs/guides/nwaku/run-docker.md index 2ca5452..1b76c10 100644 --- a/docs/guides/nwaku/run-docker.md +++ b/docs/guides/nwaku/run-docker.md @@ -42,6 +42,7 @@ docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.20.0 \ --dns-discovery=true \ --dns-discovery-url=enrtree://ANEDLO25QVUGJOUTQFRYKWX6P4Z4GKVESBMHML7DZ6YK4LGS5FC5O@prod.wakuv2.nodes.status.im \ --discv5-discovery=true \ + --rpc-address=0.0.0.0 \ --nat=extip:[YOUR PUBLIC IP] # or, if you are behind a nat: --nat=any ``` diff --git a/docs/guides/reference/node-config-options.md b/docs/guides/reference/node-config-options.md index 791843c..c556785 100644 --- a/docs/guides/reference/node-config-options.md +++ b/docs/guides/reference/node-config-options.md @@ -22,6 +22,7 @@ Here are the available node configuration options, along with their default valu | Name | Default Value | Description | | - | - | - | +| `cluster-id` | `0` | Cluster id that the node is running in. Node in a different cluster id is disconnected | | `agent-string` | `nwaku` | Node agent string which is used as identifier in network | | `nodekey` | | P2P node private key as 64-char hex string | | `listen-address` | `defaultListenAddress()` | Listening address for LibP2P (and Discovery v5, if enabled) traffic | @@ -29,6 +30,7 @@ Here are the available node configuration options, along with their default valu | `ports-shift` | `0` | Add a shift to all port numbers | | `nat` | any | Specify method to use for determining public address. Must be one of: any, none, upnp, pmp, extip: | | `ext-multiaddr` | | External multiaddresses to advertise to the network. Argument may be repeated | +| `ext-multiaddr-only` | `false` | Only announce external multiaddresses | | `max-connections` | `50` | Maximum allowed number of libp2p connections | | `max-relay-peers` | | Maximum allowed number of relay peers | | `peer-store-capacity` | | Maximum stored peers in the peerstore | @@ -71,7 +73,7 @@ Here are the available node configuration options, along with their default valu | - | - | - | | `store` | `false` | Enable/disable waku store protocol | | `storenode` | | Peer multiaddress to query for storage | -| `store-message-retention-policy` | time:172800 | Message store retention policy. Time retention policy: 'time:'. Capacity retention policy: 'capacity:'. Set to 'none' to disable | +| `store-message-retention-policy` | `time:172800` | Message store retention policy. Time retention policy: `time:`. Capacity retention policy: `capacity:`. Size retention policy: `size:`. Set to `none` to disable | | `store-message-db-url` | `sqlite://store.sqlite3` | The database connection URL for persistent storage | | `store-message-db-vacuum` | `false` | Enable database vacuuming at start. Only supported by SQLite database engine | | `store-message-db-migration` | `true` | Enable database migration at start | diff --git a/docs/guides/run-nwaku-node.md b/docs/guides/run-nwaku-node.md index b0c7252..f601dcf 100644 --- a/docs/guides/run-nwaku-node.md +++ b/docs/guides/run-nwaku-node.md @@ -6,6 +6,10 @@ Nwaku is a lightweight and robust Nim client for running a Waku node, equipped w This guide provides detailed steps to download, build, configure, and connect a `nwaku` node to the Waku Network. It also includes interacting with the node and finding its addresses. +:::info +We recommend running a `nwaku` node with at least 2GB of RAM, especially if you have `WSS` enabled. If running just a `Relay` node, 0.5GB of RAM is sufficient. +::: + ## Get the Node Binary To run a node, you must have the `nwaku` binary. Nwaku provides multiple options for acquiring the node binary: