From f62e7d64599f2733ba04a00fc321ab60b63aee30 Mon Sep 17 00:00:00 2001 From: Sasha Date: Tue, 5 Mar 2024 23:41:23 +0100 Subject: [PATCH] chore: update doc for setting static peers --- docs/guides/js-waku/configure-discovery.md | 39 +++------------------- 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/docs/guides/js-waku/configure-discovery.md b/docs/guides/js-waku/configure-discovery.md index 684bf45..bfb83f7 100644 --- a/docs/guides/js-waku/configure-discovery.md +++ b/docs/guides/js-waku/configure-discovery.md @@ -26,43 +26,16 @@ const node = await createLightNode({ defaultBootstrap: true }); ## Configure static peers -To bootstrap a node using [static peers](/learn/concepts/static-peers), first install the `@libp2p/bootstrap` package: +To set [static peers](/learn/concepts/static-peers) `bootstrapPeers` parameter should be passed to `createLightNode`. -```mdx-code-block -import Tabs from '@theme/Tabs'; -import TabItem from '@theme/TabItem'; -``` - - - - -```shell -npm install @libp2p/bootstrap -``` - - - - -```shell -yarn add @libp2p/bootstrap -``` - - - - -Then, use the `bootstrap()` function to provide a list of `multiaddr` to bootstrap the node: +`bootstrapPeers` accepts a list of `multiaddr` to bootstrap the node: ```js import { createLightNode } from "@waku/sdk"; -import { bootstrap } from "@libp2p/bootstrap"; // Bootstrap node using static peers const node = await createLightNode({ - libp2p: { - peerDiscovery: [ - bootstrap({ list: ["[PEER MULTIADDR]"] }), - ], - }, + bootstrapPeers: ["[PEER MULTIADDR]"], }); ``` @@ -77,11 +50,7 @@ const peers = [ // Bootstrap node using the static peers const node = await createLightNode({ - libp2p: { - peerDiscovery: [ - bootstrap({ list: peers }), - ], - }, + bootstrapPeers: peers, }); ```