From 2381adfd17820a44e387c9281147fc060578eaaf Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 9 Aug 2021 14:03:07 +1000 Subject: [PATCH] Do not recommend protobuf Yet provide guide on how to use protobuf. --- guides/choose-content-topic.md | 2 +- guides/relay-receive-send-messages.md | 8 +++++--- guides/store-retrieve-messages.md | 8 +++++--- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/guides/choose-content-topic.md b/guides/choose-content-topic.md index 11f2397209..d64b21ec49 100644 --- a/guides/choose-content-topic.md +++ b/guides/choose-content-topic.md @@ -14,7 +14,7 @@ The format for content topics is as follows: - `content-topic-name`: The actual content topic name to use for filtering. If your dApp uses DappConnect for several features, 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, it enables users to receive notifications and send private messages. diff --git a/guides/relay-receive-send-messages.md b/guides/relay-receive-send-messages.md index c29ab66821..e6890f93bb 100644 --- a/guides/relay-receive-send-messages.md +++ b/guides/relay-receive-send-messages.md @@ -75,10 +75,12 @@ await waku.relay.send(wakuMessage); # Use Protobuf 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: ```js diff --git a/guides/store-retrieve-messages.md b/guides/store-retrieve-messages.md index 2c5227d508..b49d7e85d9 100644 --- a/guides/store-retrieve-messages.md +++ b/guides/store-retrieve-messages.md @@ -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. Waku Relay should still be preferred when online; 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. @@ -56,9 +56,11 @@ await Promise.all(nodes.map((addr) => waku.dial(addr))); # 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: ```js