Skip to content

Commit

Permalink
chore: add docs to use a specific store node
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Jan 31, 2025
1 parent 3f00101 commit fcb187a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/guides/js-waku/store-retrieve-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`:
Expand Down
13 changes: 13 additions & 0 deletions docs/guides/js-waku/use-waku-react.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
:::
Expand Down

0 comments on commit fcb187a

Please sign in to comment.