From 5de796ea70fb80a7fb55c30fc5264923a064a635 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Tue, 1 Jun 2021 16:07:44 +1000 Subject: [PATCH] Add link to new topic usage recommendation --- CHANGELOG.md | 1 + README.md | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb3dfaf157..e4e3d83b74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Enable access to `WakuMessage.timestamp`. - Examples (web chat): Use `WakuMessage.timestamp` as unique key for list items. +- Doc: Link to new [topic guidelines](https://rfc.vac.dev/spec/23/) in README. ## [0.5.0] - 2021-05-21 diff --git a/README.md b/README.md index 1b426eead9..f175da01fa 100644 --- a/README.md +++ b/README.md @@ -49,18 +49,17 @@ await Promise.all( The `contentTopic` is a metadata `string` that allows categorization of messages on the waku network. Depending on your use case, you can either create one (or several) new `contentTopic`(s) or look at the [RFCs](https://rfc.vac.dev/) and use an existing `contentTopic`. -See the [Waku v2 Message spec](https://rfc.vac.dev/spec/14/) for more details. +See the [Waku v2 Topic Usage Recommendations](https://rfc.vac.dev/spec/23/) for more details. -For example, if you were to use a new `contentTopic` such as `"my-cool-app"`, +For example, if you were to use a new `contentTopic` such as `/my-cool-app/1/my-use-case/proto`, here is how to listen to new messages received via [Waku v2 Relay](https://rfc.vac.dev/spec/11/): ```javascript waku.relay.addObserver((msg) => { console.log("Message received:", msg.payloadAsUtf8) -}, ["my-cool-app"]); +}, ["/my-cool-app/1/my-use-case/proto"]); ``` -Note that the guidelines regarding content topic format are yet to be defined, see [vacp2p/rfc#364](https://github.com/vacp2p/rfc/issues/364). The examples chat apps currently use content topic `"/waku/2/huilong/proto"`. Send a message on the waku relay network: @@ -68,7 +67,7 @@ Send a message on the waku relay network: ```javascript import { WakuMessage } from 'js-waku'; -const msg = WakuMessage.fromUtf8String("Here is a message!", "my-cool-app") +const msg = WakuMessage.fromUtf8String("Here is a message!", "/my-cool-app/1/my-use-case/proto") await waku.relay.send(msg); ```