Add choose content topic guide

This commit is contained in:
Franck Royer 2021-07-30 11:54:34 +10:00
parent 2dd399d6c6
commit b92b9009b9
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
# How to choose a content topic
A content topic is used for content based filtering.
It allows you to filter out the messages that your dApp processes,
both when receiving live messages (Relay) or retrieving historical messages (Store).
The format for content topics is as follows:
`/{dapp-name}/{version}/{content-topic-name}/{encoding}`
- `dapp-name`: The name of your dApp, it must be unique to avoid conflict with other dApps.
- `version`: We usually start at `1`, useful when introducing breaking changes in your messages.
- `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`.
For example: Your dApp's name is SuperCrypto,
it enables users to receive notifications and send private messages.
You may want to use the following content topics:
- `/supercrypto/1/notification/proto`
- `/supercrypto/1/private-message/proto`
You can learn more about Waku topics in the [23/WAKU2-TOPICS](https://rfc.vac.dev/spec/23/) specs.