Use tcp protocol only

Due to #201, Websocket protocol is not added by default if the caller
specifies a protocol for libp2p.

In the case cli-chat. We were using both tcp and ws.
As the web-chat already demonstrates usage of websocket protocol, we
cli-chat to tcp only.
This commit is contained in:
Franck Royer 2021-06-09 16:58:08 +10:00
parent 0136720b48
commit 1bb1f8f6b6
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 5 additions and 2 deletions

View File

@ -9,7 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- **Breaking**: Options passed to `Waku.create` used to be passed to `Libp2p.create`;
Now, only the `libp2p` property is passed to `Libp2p.create`, allowing for a cleaner interface.
Now, only the `libp2p` property is passed to `Libp2p.create`, allowing for a cleaner interface.
- Examples (cli chat): Use tcp protocol instead of websocket.
### Added
- Enable access to `WakuMessage.timestamp`.

View File

@ -7,6 +7,7 @@ import {
Environment,
getStatusFleetNodes,
LightPushCodec,
Protocol,
StoreCodec,
Waku,
WakuMessage,
@ -202,7 +203,8 @@ export function formatMessage(chatMsg: ChatMessage): string {
async function addFleetNodes(opts: Options): Promise<Options> {
await getStatusFleetNodes(
opts.prod ? Environment.Prod : Environment.Test
opts.prod ? Environment.Prod : Environment.Test,
Protocol.tcp
).then((nodes) =>
nodes.map((addr) => {
opts.staticNodes.push(multiaddr(addr));