update docs (#128)

This commit is contained in:
LordGhostX 2023-10-29 17:48:37 +01:00 committed by GitHub
parent fc59ddfd63
commit 0e655b98c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 7 deletions

View File

@ -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!

View File

@ -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:<duration-in-seconds>` (e.g., `time:14400`)
- Capacity retention policy: `capacity:<messages-count>` (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:<storage-in-MB/GB>` (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

View File

@ -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
```

View File

@ -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:<IP\> |
| `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:<seconds\>'. Capacity retention policy: 'capacity:<count\>'. Set to 'none' to disable |
| `store-message-retention-policy` | `time:172800` | Message store retention policy. Time retention policy: `time:<seconds>`. Capacity retention policy: `capacity:<count>`. Size retention policy: `size:<xMB/xGB>`. 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 |

View File

@ -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: