mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-02 12:53:12 +00:00
chore: add FAQ and info for dialing a peer
This commit is contained in:
parent
bae25db3e7
commit
96d36bae38
@ -52,6 +52,35 @@ const node = await createLightNode({
|
||||
});
|
||||
```
|
||||
|
||||
Alternatively a particular node can be dialed:
|
||||
|
||||
```js
|
||||
// Define the list of static peers to bootstrap
|
||||
const peers = [
|
||||
"/ip4/0.0.0.0/tcp/60002/ws/p2p/16Uiu2HAkzjwwgEAXfeGNMKFPSpc6vGBRqCdTLG5q3Gmk2v4pQw7H",
|
||||
"/ip4/0.0.0.0/tcp/60003/ws/p2p/16Uiu2HAmFBA7LGtwY5WVVikdmXVo3cKLqkmvVtuDu63fe8safeQJ",
|
||||
];
|
||||
|
||||
|
||||
const node = await createLightNode();
|
||||
|
||||
// In case nodes are using `ws` protocol - additional configuration is needed:
|
||||
/*
|
||||
import { webSockets } from "@libp2p/websockets";
|
||||
import { all as filterAll } from "@libp2p/websockets/filters";
|
||||
|
||||
const node = await createLightNode({
|
||||
libp2p: {
|
||||
transports: [webSockets({ filter: filterAll })],
|
||||
},
|
||||
});
|
||||
*/
|
||||
|
||||
const promises = peers.map(multiaddr => node.dial(multiaddr));
|
||||
|
||||
await Promise.all(promises);
|
||||
```
|
||||
|
||||
:::tip
|
||||
For local development using a `nwaku` node, use a `ws` address instead of `wss`. Remember that this setup is functional only when your web server is running locally.
|
||||
:::
|
||||
|
||||
@ -49,3 +49,7 @@ import { AccordionItem } from '@site/src/components/mdx'
|
||||
<AccordionItem title="How can I send images and videos on the Waku Network?">
|
||||
While it's possible to transmit media such as images as bytes on Waku, we recommend uploading your media to a CDN or a file system like <a href="https://ipfs.tech/">IPFS</a> and then sharing the corresponding URL via Waku.
|
||||
</AccordionItem>
|
||||
|
||||
<AccordionItem title="How can I connect to my own node?">
|
||||
To manually set your own node as a starting point use <a href="/guides/js-waku/configure-discovery#configure-static-peers">Configure static peers</a>.
|
||||
</AccordionItem>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user