diff --git a/.cspell.json b/.cspell.json index 3fdfffc..71e5822 100644 --- a/.cspell.json +++ b/.cspell.json @@ -60,6 +60,7 @@ "nwakunode", "tlsv", "rustup", + "storenode", ], "flagWords": [], "ignorePaths": [ diff --git a/docs/guides/js-waku/light-send-receive.md b/docs/guides/js-waku/light-send-receive.md index bceef66..2831ada 100644 --- a/docs/guides/js-waku/light-send-receive.md +++ b/docs/guides/js-waku/light-send-receive.md @@ -66,7 +66,7 @@ The `ephemeral` option allows you to specify whether your messages should be per ```js const encoder = createEncoder({ contentTopic: contentTopic, // message content topic - ephemeral: true, // allows messages to be stored or not + ephemeral: true, // allows messages to be persisted or not }); ``` diff --git a/docs/guides/nwaku/configure-nwaku.md b/docs/guides/nwaku/configure-nwaku.md index 0f088c4..d46adf1 100644 --- a/docs/guides/nwaku/configure-nwaku.md +++ b/docs/guides/nwaku/configure-nwaku.md @@ -15,22 +15,59 @@ To join the Waku Network, nodes must [bootstrap](/overview/reference/glossary#bo ## Configure a Domain Name -You can set up an IPv4 DNS domain name that resolves to the public IPv4 address of a node. This allows the node's publicly announced multiaddrs to use the `/dns4` scheme. +You can set up an IPv4 DNS domain name that resolves to the public IPv4 address of a node using the `dns4-domain-name` option. This allows the node's publicly announced multiaddrs to use the `/dns4` scheme. ```bash ./build/wakunode2 --dns4-domain-name=[DOMAIN NAME] ``` -:::info -This example describes configuring a domain name that resolves to your node's IP address and is unrelated to [DNS Discovery](/overview/concepts/dns-discovery). -::: - For example, consider the domain name `node.example.com`, which resolves to a `nwaku` node: ```bash ./build/wakunode2 --dns4-domain-name=node.example.com ``` -:::info Nodes with a domain name and secure WebSocket configured will generate a discoverable ENR with `/wss` multiaddr and `/dns4` domain name, essential for verifying domain certificates when connecting securely. -::: \ No newline at end of file + +:::info +This example describes configuring a domain name that resolves to your node's IP address and is unrelated to [DNS Discovery](/overview/concepts/dns-discovery). +::: + +## Configure Store Protocol and Message Store + +To enable `nwaku` to be a [store service node](/overview/concepts/protocols#store), use the following configuration options: + +- `store`: Enables `Waku Store` protocol on the node (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: + - 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. +- `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. + +```bash +./build/wakunode2 \ + --store=true \ + --store-message-retention-policy=[MESSAGE RETENTION POLICY] \ + --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: + +```bash +./build/wakunode2 \ + --store=true \ + --store-message-retention-policy=time:15000 \ + --store-message-db-url=sqlite://store.sqlite3 +``` + +You can configure `nwaku` as a `Waku Store` client using the `storenode` option. This allows the node to query peers for historical messages but not store any message itself. + +```bash +./build/wakunode2 --storenode=[STORE PEER MULTIADDR] +``` + +For example, consider a `nwaku` node that does not persist messages but can query peers for historical messages: + +```bash +./build/wakunode2 --storenode=/dns4/node-01.ac-cn-hongkong-c.wakuv2.prod.statusim.net/tcp/30303/p2p/16Uiu2HAm4v86W3bmT1BiH6oSPzcsSr24iDQpSN5Qa992BCjjwgrD +``` \ No newline at end of file diff --git a/docs/guides/nwaku/run-docker.md b/docs/guides/nwaku/run-docker.md index 8a7e313..b5980e1 100644 --- a/docs/guides/nwaku/run-docker.md +++ b/docs/guides/nwaku/run-docker.md @@ -38,7 +38,7 @@ docker run [OPTIONS] [IMAGE] [ARG...] Run `nwaku` using the most typical configuration: ```bash -docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.19.0 \ +docker run -i -t -p 60000:60000 -p 9000:9000/udp statusteam/nim-waku:v0.20.0 \ --dns-discovery=true \ --dns-discovery-url=enrtree://AOGECG2SPND25EEFMAJ5WF3KSGJNSGV356DSTL2YVLLZWIV6SAYBM@prod.waku.nodes.status.im \ --discv5-discovery=true \