add js-waku FAQ answers

This commit is contained in:
LordGhostX 2024-03-04 02:54:38 +01:00
parent 27b9dd1ff0
commit 2e67d5b319
No known key found for this signature in database
GPG Key ID: 520CC5DC4F94FCC7
4 changed files with 17 additions and 7 deletions

View File

@ -1,5 +1,5 @@
---
title: JavaScript Waku FAQ
title: JavaScript SDK FAQ
hide_table_of_contents: true
sidebar_label: Frequently Asked Questions
---
@ -7,31 +7,41 @@ sidebar_label: Frequently Asked Questions
import { AccordionItem } from '@site/src/components/mdx'
<AccordionItem title="How do I install the @waku/sdk package in my project?">
You can add the JavaScript SDK to your project using NPM, Yarn, or a CDN. Check out the <a href="/guides/js-waku/#installation">installation guide</a> to get started.
</AccordionItem>
<AccordionItem title="Why should I use Protocol Buffers for my application's message structure when using Waku?">
Protocol Buffers ensure consistent formatting, interoperability, and backward compatibility for your application's messages, with a smaller payload size than JSON. Check out the <a href="/guides/js-waku/#message-structure">installation guide</a> and <a href="https://protobuf.dev/overview/">Protobuf documentation</a> to learn more.
</AccordionItem>
<AccordionItem title="What are the steps to retrieve historical messages using the Store protocol with Waku?">
<AccordionItem title="What are the steps to retrieve historical messages on Waku?">
Check out the <a href="/guides/js-waku/store-retrieve-messages">Retrieve Messages Using Store Protocol</a> guide to learn how to retrieve and filter historical messages using the <a href="/learn/concepts/protocols#store">Store protocol</a>.
</AccordionItem>
<AccordionItem title="How can I prevent Store peers from persisting my messages?">
When <a href="/guides/js-waku/light-send-receive#choose-a-content-topic">creating your message encoder</a>, you can configure the <strong>ephemeral</strong> option to prevent Store peers from keeping your messages on the Waku Network.
</AccordionItem>
<AccordionItem title="How can I encrypt, decrypt, and sign messages in my Waku application?">
You can encrypt and decrypt your messages using symmetric, ECIES, and noise encryption methods. Check out the <a href="/guides/js-waku/message-encryption">Encrypt, Decrypt, and Sign Your Messages</a> guide to get started.
</AccordionItem>
<AccordionItem title="How do I integrate Waku into a React application?">
Waku has a specialized SDK designed for building React applications. Check out the <a href="/guides/js-waku/use-waku-react">Build React DApps Using @waku/react</a> guide for instructions on installation and usage.
</AccordionItem>
<AccordionItem title="How can I bootstrap and discover peers in the Waku Network for my browser node?">
<AccordionItem title="How can I bootstrap and discover peers in the Waku Network for browser nodes?">
The JavaScript SDK has a <a href="/guides/js-waku/configure-discovery#default-bootstrap-method">default bootstrap method</a> that can be configured with <a href="/learn/concepts/static-peers">Static Peers</a> and <a href="/learn/concepts/dns-discovery">DNS Discovery</a>. Check out the <a href="/guides/js-waku/configure-discovery">Bootstrap Nodes and Discover Peers</a> guide for setting up peer discovery for your node.
</AccordionItem>
<AccordionItem title="How can I integrate Waku into a NodeJS application?">
Though the JavaScript SDK isn't directly usable in NodeJS due to <a href="/guides/js-waku/run-waku-nodejs">certain limitations</a>, we suggest running <a href="/guides/nwaku/run-docker-compose">nwaku in a Docker container</a> and consuming its <a href="https://waku-org.github.io/waku-rest-api/">REST API</a> in a NodeJS application.
</AccordionItem>
<AccordionItem title="How can I debug my Waku DApp and check WebSocket connections?">
Check out the <a href="/guides/js-waku/debug-waku-dapp">Debug Your Waku DApp and WebSocket</a> guide to discover how to use debug logs to troubleshoot your Waku DApp and resolve connection issues with nwaku WebSockets.
</AccordionItem>
<AccordionItem title="How can I manage unexpected disconnections of my Filter subscription from Waku?">
We recommend regularly pinging peers to check for an active connection and reinitiating the subscription when it disconnects. Check out the <a href="/guides/js-waku/manage-filter">Manage Your Filter Subscriptions</a> guide for a detailed explanation and step-by-step instructions.
</AccordionItem>

View File

@ -62,12 +62,12 @@ 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` option allows you to specify whether messages should **NOT** be stored by [Store peers](/guides/js-waku/store-retrieve-messages):
```js
const encoder = createEncoder({
contentTopic: contentTopic, // message content topic
ephemeral: true, // allows messages not be stored on the network
ephemeral: true, // allows messages NOT be stored on the network
});
```

View File

@ -27,7 +27,7 @@ Certain features in `@waku/sdk` are tailored for browsers and might not translat
## Recommendations
Before using `@waku/sdk` in a NodeJS environment, take into account these limitations. For a more optimised solution, we recommend [running nwaku in a Docker container](/guides/nwaku/run-docker) and consuming its [REST API](https://waku-org.github.io/waku-rest-api/).
Before using `@waku/sdk` in a NodeJS environment, take into account these limitations. For a more optimised solution, we recommend [running nwaku in a Docker container](/guides/nwaku/run-docker-compose) and consuming its [REST API](https://waku-org.github.io/waku-rest-api/).
## Future developments

View File

@ -294,5 +294,5 @@ To explore the available Store query options, have a look at the [Retrieve Messa
:::
:::tip
You have successfully integrated `@waku/sdk` into a React application using the `@waku/react` package. Have a look at the [web-chat](https://github.com/waku-org/js-waku-examples/tree/master/examples/web-chat) example for a working demo.
You have successfully integrated `@waku/sdk` into a React application using the `@waku/react` package. Have a look at the [web-chat](https://github.com/waku-org/js-waku-examples/tree/master/examples/web-chat) example for a working demo and the [Building a Tic-Tac-Toe Game with Waku](https://blog.waku.org/tictactoe-tutorial) tutorial to learn more.
:::