mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-02 12:53:12 +00:00
chore: add docs to use a specific store node (#231)
This commit is contained in:
parent
3f0010159d
commit
a21ed2e02c
@ -28,6 +28,19 @@ import { Protocols } from "@waku/sdk";
|
|||||||
await node.waitForPeers([Protocols.Store]);
|
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
|
||||||
|
|
||||||
[Choose a content topic](/learn/concepts/content-topics) for filtering the messages to retrieve and create a message `decoder`:
|
[Choose a content topic](/learn/concepts/content-topics) for filtering the messages to retrieve and create a message `decoder`:
|
||||||
|
|||||||
@ -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
|
:::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.
|
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.
|
||||||
:::
|
:::
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user