This commit is contained in:
LordGhostX 2024-05-13 14:43:25 +01:00
parent ff5464b7d3
commit acb0a75d55
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7

View File

@ -24,6 +24,8 @@ await node.start();
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.
:::
Your node will route messages to the default pubsub topic (`/waku/2/default-waku/proto`). If your project uses a different shared pubsub topic, you can change this using the `ShardInfo` parameter:
## Connect to remote peers
Use the `waitForRemotePeer()` function to wait for the node to connect with peers on the Waku Network:
@ -41,10 +43,7 @@ The `protocols` parameter allows you to specify the [protocols](/learn/concepts/
import { waitForRemotePeer, Protocols } from "@waku/sdk";
// Wait for peer connections with specific protocols
await waitForRemotePeer(node, [
Protocols.LightPush,
Protocols.Filter,
]);
await waitForRemotePeer(node, [Protocols.LightPush, Protocols.Filter]);
```
## Choose a content topic