mirror of
https://github.com/logos-messaging/js-waku.git
synced 2026-01-05 23:33:08 +00:00
Rephrased
This commit is contained in:
parent
499b3e7cc0
commit
495827ed63
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user