Do not recommend protobuf

Yet provide guide on how to use protobuf.
This commit is contained in:
Franck Royer 2021-08-09 14:03:07 +10:00
parent bb7ae2f30a
commit 2381adfd17
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
3 changed files with 11 additions and 7 deletions

View File

@ -14,7 +14,7 @@ The format for content topics is as follows:
- `content-topic-name`: The actual content topic name to use for filtering. - `content-topic-name`: The actual content topic name to use for filtering.
If your dApp uses DappConnect for several features, If your dApp uses DappConnect for several features,
you should use a content topic per feature. you should use a content topic per feature.
- `encoding`: The encoding format of the message, we recommend using Protobuf: `proto`. - `encoding`: The encoding format of the message, Protobuf is most often used: `proto`.
For example: Your dApp's name is SuperCrypto, For example: Your dApp's name is SuperCrypto,
it enables users to receive notifications and send private messages. it enables users to receive notifications and send private messages.

View File

@ -75,10 +75,12 @@ await waku.relay.send(wakuMessage);
# Use Protobuf # Use Protobuf
Sending strings as messages in unlikely to cover your dApps needs. Sending strings as messages in unlikely to cover your dApps needs.
To include structured objects in Waku Messages,
we recommend you use [protobuf](https://developers.google.com/protocol-buffers/).
First, let's define a data structure. Waku v2 protocols use [protobuf](https://developers.google.com/protocol-buffers/) [by default](https://rfc.vac.dev/spec/10/).
Let's review how you can use protobuf to include structured objects in Waku Messages.
First, define a data structure.
For this guide, we will use a simple chat message that contains a timestamp and text: For this guide, we will use a simple chat message that contains a timestamp and text:
```js ```js

View File

@ -13,7 +13,7 @@ allowing you to retrieve them at a later time.
The Waku Store protocol is best-effort and does not guarantee data availability. The Waku Store protocol is best-effort and does not guarantee data availability.
Waku Relay should still be preferred when online; Waku Relay should still be preferred when online;
Waku Store can be used after resuming connectivity: Waku Store can be used after resuming connectivity:
when the dApp starts for example. For example, when the dApp starts.
In this guide, we'll review how you can use Waku Store to retrieve messages. In this guide, we'll review how you can use Waku Store to retrieve messages.
@ -56,9 +56,11 @@ await Promise.all(nodes.map((addr) => waku.dial(addr)));
# Use Protobuf # Use Protobuf
We recommend you use [protobuf](https://developers.google.com/protocol-buffers/) for messages. Waku v2 protocols use [protobuf](https://developers.google.com/protocol-buffers/) [by default](https://rfc.vac.dev/spec/10/).
First, let's define a data structure. Let's review how you can use protobuf to send structured data.
First, define a data structure.
For this guide, we will use a simple news article that contains a date of publication, title and body: For this guide, we will use a simple news article that contains a date of publication, title and body:
```js ```js