Rephrased

This commit is contained in:
Franck Royer 2021-08-02 12:26:07 +10:00
parent 499b3e7cc0
commit 495827ed63
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 4 additions and 4 deletions

View File

@ -76,9 +76,9 @@ await waku.relay.send(wakuMessage);
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, To include structured objects in Waku Messages,
We recommend you use [protobuf](https://developers.google.com/protocol-buffers/). we recommend you use [protobuf](https://developers.google.com/protocol-buffers/).
First, let's define an object. First, let's 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
@ -92,7 +92,7 @@ To encode and decode protobuf payloads, you can use the [protons](https://www.np
## Install Protobuf Library ## Install Protobuf Library
First, install it: First, install protons:
```shell ```shell
npm install protons npm install protons
@ -113,7 +113,7 @@ message SimpleChatMessage {
`); `);
``` ```
You can learn about protobuf definitions here: You can learn about protobuf message definitions here:
[Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto). [Protocol Buffers Language Guide](https://developers.google.com/protocol-buffers/docs/proto).
## Encode Messages ## Encode Messages