From 0df0fcb192cf215e56276665fa8532809793f501 Mon Sep 17 00:00:00 2001 From: Simon-Pierre Vivier Date: Thu, 3 Jul 2025 13:11:39 -0400 Subject: [PATCH] feat: add store sync entrees (#239) Co-authored-by: fryorcraken <110212804+fryorcraken@users.noreply.github.com> Co-authored-by: Hanno Cornelius <68783915+jm-clius@users.noreply.github.com> --- .cspell.json | 1 + docs/guides/nwaku/config-options.md | 9 +++++++++ docs/guides/nwaku/configure-nwaku.md | 18 ++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/.cspell.json b/.cspell.json index eed5e20..d534ce6 100644 --- a/.cspell.json +++ b/.cspell.json @@ -83,6 +83,7 @@ "IPFS", "cheatsheet", "hacken", + "statusteam", ], "flagWords": [], "ignorePaths": [ diff --git a/docs/guides/nwaku/config-options.md b/docs/guides/nwaku/config-options.md index 915ec30..d3a27ba 100644 --- a/docs/guides/nwaku/config-options.md +++ b/docs/guides/nwaku/config-options.md @@ -84,6 +84,15 @@ Here are the available node configuration options, along with their default valu | `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 | +## Store Sync + +| Name | Default Value | Description | +| -------------------------------- | ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `store-sync` | `false` | Enable/disable waku store sync protocol | +| `store-sync-interval` | `300` 5 minutes | Interval between store synchronization attempts | +| `store-sync-range` | `3600` 1 hour | Amount of time to sync | +| `store-sync-relay-jitter` | `20` seconds | Sync range offset to account for relay's message propagation jitter | + ## Filter config | Name | Default Value | Description | diff --git a/docs/guides/nwaku/configure-nwaku.md b/docs/guides/nwaku/configure-nwaku.md index 2e388b5..c83c31b 100644 --- a/docs/guides/nwaku/configure-nwaku.md +++ b/docs/guides/nwaku/configure-nwaku.md @@ -78,6 +78,24 @@ For example, consider a `nwaku` node that does not store messages but can query ./build/wakunode2 --storenode=/dns4/node-01.ac-cn-hongkong-c.waku.sandbox.status.im/tcp/30303/p2p/16Uiu2HAmSJvSJphxRdbnigUV5bjRRZFBhTtWFTSyiKaQByCjwmpV ``` +## Configure store sync + +To enable synchronization between stores, enable the protocol via the configuration options below; + +- `store-sync`: Enable store sync protocol (disable by default). +- `store-sync-interval`: Interval between store synchronization attempts, in seconds (300s default). +- `store-sync-range`: Amount of time to sync, in seconds (3600s default). +- `store-sync-relay-jitter`: Sync range offset to account for relay's message propagation jitter, in seconds (20s default). + +Configuration example. +``` +./build/wakunode2 \ + --store-sync=true \ + --store-sync-interval=300 \ + --store-sync-range=3600 \ + --store-sync-relay-jitter=20 +``` + ## Generate and configure a node key Nodes generate [new random key pairs](/learn/glossary#node-key) at each boot, leading to different `multiaddrs`. To maintain consistency, you can use a pre-generated private key with the `nodekey` option: