mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-04 05:43:07 +00:00
add sending media FAQ
This commit is contained in:
parent
2e67d5b319
commit
fe4c41f2d1
@ -79,6 +79,7 @@
|
|||||||
"txid",
|
"txid",
|
||||||
"baarerstrasse",
|
"baarerstrasse",
|
||||||
"FDPIC",
|
"FDPIC",
|
||||||
|
"IPFS",
|
||||||
],
|
],
|
||||||
"flagWords": [],
|
"flagWords": [],
|
||||||
"ignorePaths": [
|
"ignorePaths": [
|
||||||
|
|||||||
@ -35,7 +35,7 @@ import { AccordionItem } from '@site/src/components/mdx'
|
|||||||
</AccordionItem>
|
</AccordionItem>
|
||||||
|
|
||||||
<AccordionItem title="How can I integrate Waku into a NodeJS application?">
|
<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.
|
Though the JavaScript SDK isn't directly usable in NodeJS due to <a href="/guides/js-waku/run-waku-nodejs">certain limitations</a>, we recommend 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>
|
||||||
|
|
||||||
<AccordionItem title="How can I debug my Waku DApp and check WebSocket connections?">
|
<AccordionItem title="How can I debug my Waku DApp and check WebSocket connections?">
|
||||||
@ -44,4 +44,8 @@ import { AccordionItem } from '@site/src/components/mdx'
|
|||||||
|
|
||||||
<AccordionItem title="How can I manage unexpected disconnections of my Filter subscription from Waku?">
|
<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.
|
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>
|
||||||
|
|
||||||
|
<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>
|
||||||
@ -171,15 +171,11 @@ await subscription.subscribe([ECIESEncoder], callback);
|
|||||||
await node.lightPush.send(ECIESEncoder, { payload });
|
await node.lightPush.send(ECIESEncoder, { payload });
|
||||||
```
|
```
|
||||||
|
|
||||||
You can extract the `signature` and its public key (`signaturePublicKey`) from the [DecodedMessage](https://js.waku.org/classes/_waku_message_encryption.DecodedMessage.html) and compare it with the expected public key to verify the message origin:
|
You can extract the `signature` and its public key (`signaturePublicKey`) from the [DecodedMessage](https://js.waku.org/classes/_waku_message_encryption.DecodedMessage.html) and compare it with the expected public key or use the `verifySignature()` function to verify the message origin:
|
||||||
|
|
||||||
<!-- or use the `verifySignature()` function -->
|
|
||||||
<!-- if (wakuMessage.verifySignature(alicePublicKey)) { -->
|
|
||||||
|
|
||||||
```js title="Bob (receiver) client"
|
```js title="Bob (receiver) client"
|
||||||
import { generatePrivateKey } from "@waku/message-encryption";
|
import { generatePrivateKey } from "@waku/message-encryption";
|
||||||
import { createEncoder } from "@waku/message-encryption/symmetric";
|
import { createEncoder } from "@waku/message-encryption/symmetric";
|
||||||
import { equals } from "uint8arrays/equals";
|
|
||||||
|
|
||||||
// Generate a random private key for signing messages
|
// Generate a random private key for signing messages
|
||||||
// For this example, we'll call the receiver of the message Bob
|
// For this example, we'll call the receiver of the message Bob
|
||||||
@ -201,7 +197,7 @@ const callback = (wakuMessage) => {
|
|||||||
|
|
||||||
// Verify the message was actually signed and sent by Alice
|
// Verify the message was actually signed and sent by Alice
|
||||||
// Alice's public key can be gotten from broadcasting or out-of-band methods
|
// Alice's public key can be gotten from broadcasting or out-of-band methods
|
||||||
if (equals(signaturePublicKey, alicePublicKey)) {
|
if (wakuMessage.verifySignature(alicePublicKey)) {
|
||||||
console.log("This message was signed by Alice");
|
console.log("This message was signed by Alice");
|
||||||
} else {
|
} else {
|
||||||
console.log("This message was NOT signed by Alice");
|
console.log("This message was NOT signed by Alice");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user