update DNS discovery + static peers config

This commit is contained in:
LordGhostX 2024-03-06 00:09:04 +01:00
parent f62e7d6459
commit 8132d5d0d1
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7
3 changed files with 7 additions and 9 deletions

View File

@ -26,9 +26,7 @@ const node = await createLightNode({ defaultBootstrap: true });
## Configure static peers
To set [static peers](/learn/concepts/static-peers) `bootstrapPeers` parameter should be passed to `createLightNode`.
`bootstrapPeers` accepts a list of `multiaddr` to bootstrap the node:
To set [static peers](/learn/concepts/static-peers), a list of `multiaddr` to bootstrap the node should be passed to the `bootstrapPeers` parameter of the `createLightNode()` function:
```js
import { createLightNode } from "@waku/sdk";
@ -148,11 +146,11 @@ const NODE_REQUIREMENTS = {
filter: 3,
};
// Bootstrap node using DNS Discovery
// Bootstrap node using DNS Discovery and static peers
const node = await createLightNode({
libp2p: {
bootstrapPeers: peers,
peerDiscovery: [
bootstrap({ list: peers }),
wakuDnsDiscovery(
[enrTree["PROD"]],
NODE_REQUIREMENTS,

View File

@ -21,7 +21,7 @@ await node.start();
```
:::info
When the `defaultBootstrap` option is set to `true`, your node will be bootstrapped using the [default bootstrap method](/guides/js-waku/configure-discovery#default-bootstrap-method). Have a look at the [Bootstrap Nodes and Discover Peers](/guides/js-waku/configure-discovery) guide to learn more methods to bootstrap nodes.
When the `defaultBootstrap` parameter is set to `true`, your node will be bootstrapped using the [default bootstrap method](/guides/js-waku/configure-discovery#default-bootstrap-method). Have a look at the [Bootstrap Nodes and Discover Peers](/guides/js-waku/configure-discovery) guide to learn more methods to bootstrap nodes.
:::
## Connect to remote peers
@ -35,7 +35,7 @@ import { waitForRemotePeer } from "@waku/sdk";
await waitForRemotePeer(node);
```
The `protocols` option allows you to specify the [protocols](/learn/concepts/protocols) that the remote peers should have enabled:
The `protocols` parameter allows you to specify the [protocols](/learn/concepts/protocols) that the remote peers should have enabled:
```js
import { waitForRemotePeer, Protocols } from "@waku/sdk";
@ -62,7 +62,7 @@ const encoder = createEncoder({ contentTopic });
const decoder = createDecoder(contentTopic);
```
The `ephemeral` option allows you to specify whether messages should **NOT** be stored by [Store peers](/guides/js-waku/store-retrieve-messages):
The `ephemeral` parameter allows you to specify whether messages should **NOT** be stored by [Store peers](/guides/js-waku/store-retrieve-messages):
```js
const encoder = createEncoder({

View File

@ -136,7 +136,7 @@ Message signing helps in proving the authenticity of received messages. By attac
Signing messages is only possible when encrypted, but if your application does not require encryption, you can generate a symmetric key through hardcoded or deterministic methods using information available to all users.
:::
The `sigPrivKey` option allows the `Symmetric` and `ECIES` message `encoders` to sign the message before encryption using an `ECDSA` private key:
The `sigPrivKey` parameter allows the `Symmetric` and `ECIES` message `encoders` to sign the message before encryption using an `ECDSA` private key:
```js title="Alice (sender) client"
import { generatePrivateKey, getPublicKey } from "@waku/message-encryption";