chore: add docs to use a specific store node

This commit is contained in:
Danish Arora 2025-01-31 16:42:50 +05:30
parent 3f0010159d
commit fcb187acf0
No known key found for this signature in database
GPG Key ID: 1C6EF37CDAE1426E
2 changed files with 26 additions and 0 deletions

View File

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

View File

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