diff --git a/docs/guides/js-waku/store-retrieve-messages.md b/docs/guides/js-waku/store-retrieve-messages.md index c09d8c9..61d664c 100644 --- a/docs/guides/js-waku/store-retrieve-messages.md +++ b/docs/guides/js-waku/store-retrieve-messages.md @@ -28,6 +28,19 @@ import { Protocols } from "@waku/sdk"; await node.waitForPeers([Protocols.Store]); ``` +You can also specify a dedicated Store peer to use for queries when creating the node. This is particularly useful when running your own Store node or when you want to use a specific Store node in the network: + +```js +const node = await createLightNode({ + defaultBootstrap: true, + store: { + peer: "/ip4/1.2.3.4/tcp/1234/p2p/16Uiu2HAm..." // multiaddr or PeerId of your Store node + } +}); +``` + +If the specified Store peer is not available, the node will fall back to using random Store peers in the network. + ## Choose a content topic [Choose a content topic](/learn/concepts/content-topics) for filtering the messages to retrieve and create a message `decoder`: diff --git a/docs/guides/js-waku/use-waku-react.md b/docs/guides/js-waku/use-waku-react.md index 46340aa..b612f5a 100644 --- a/docs/guides/js-waku/use-waku-react.md +++ b/docs/guides/js-waku/use-waku-react.md @@ -289,6 +289,19 @@ function App() { } ``` +You can also configure a specific Store peer when creating the node, which is useful when running your own Store node or using a specific node in the network: + +```js +const node = await createLightNode({ + defaultBootstrap: true, + store: { + peer: "/ip4/1.2.3.4/tcp/1234/p2p/16Uiu2HAm..." // multiaddr or PeerId of your Store node + } +}); +``` + +If the specified Store peer is not available, the node will fall back to using random Store peers in the network. + :::info To explore the available Store query options, have a look at the [Retrieve Messages Using Store Protocol](/guides/js-waku/store-retrieve-messages#store-query-options) guide. :::