Commit Graph

198 Commits

Author SHA1 Message Date
Franck Royer 398f34b57f
Fixed Buffer.concat error when using symmetric encryption in the browser 2021-08-26 16:12:53 +10:00
Franck Royer 5b34da6b5f
Both or neither time parameters must be passed
The protocol does not support open-ended time filtering windows. See
https://github.com/status-im/nim-waku/issues/706
2021-08-25 12:14:53 +10:00
Franck Royer 8fce1ad884
Release 0.11.0
### Added
- Examples: New Ethereum Private Message Using Wallet Encryption
  [Web App](./examples/eth-pm-wallet-encryption/README.md)
  example that demonstrates the usage of `eth_encrypt` API (available on
  Metamask) and EIP-712 for typed structured data signing.
- New `bootstrap` option for `Waku.create` to easily connect to Waku
  nodes upon start up.
- Support for `startTime` and `endTime` in Store queries to filter by
  time window as per [21/WAKU2-FTSTORE](https://rfc.vac.dev/spec/21/).

### Changed
- Renamed `discover.getStatusFleetNodes` to
  `discovery.getBootstrapNodes`;
  Changed the API to allow retrieval of bootstrap nodes from other
  sources.
- Examples: Renamed `eth-dm` to `eth-pm`; "Direct Message" can lead to
  confusion with "Direct Connection" that
  refers to low latency network connections.
- Examples (eth-pm): Use sign typed data EIP-712 instead of personal
  sign.
- Upgraded dependencies to remove warning at installation.
- **Breaking**: Moved `DefaultPubSubTopic` to `waku.ts` and fixed the
  casing.
- **Breaking**: Rename all `pubsubTopic` occurrences to `pubSubTopic`,
  across all interfaces.

### Removed
- Examples (cli-chat): The focus of this library is Web environment;
  Several examples now cover usage of Waku Relay and Waku Store making cli-chat example obsolete;
  web-chat POC should be preferred to use the [TOY-CHAT](https://rfc.vac.dev/spec/22/) protocol.
- `ChatMessage` has been moved from js-waku to web-chat example;
  it is a type used for the [TOY-CHAT](https://rfc.vac.dev/spec/22/) protocol;
  js-waku users should not build on top if this toy protocol and instead design message data structures appropriate to their use case.
- Unused dependencies & scripts.
2021-08-20 12:15:23 +10:00
Franck Royer ac03a9e54b
Update changelog 2021-08-20 10:54:13 +10:00
Franck Royer b7693853d2
Added support for `startTime` and `endTime` in Store queries 2021-08-20 10:37:58 +10:00
Franck Royer 1d48dc4372
Rename all `pubsubTopic` occurrences to `pubSubTopic` 2021-08-20 10:13:02 +10:00
Franck Royer 60290e8d84
Moved `DefaultPubSubTopic` to `waku.ts` and fixed the casing
The pubsub topic is used by several protocol, not just relay.
2021-08-20 10:12:55 +10:00
Franck Royer 0c09d60c91
Update changelog 2021-08-19 11:27:03 +10:00
Franck Royer 0b03952542
Update changelog 2021-08-19 11:13:34 +10:00
Franck Royer 9692b4af72
Rename Eth-DM to Eth-PM
"Direct Message" can lead to confusion with "Direct Connection" that
refers to low latency network connections.
2021-08-17 16:06:46 +10:00
Franck Royer 0f0b083586
Update changelog for Eth-PM Wallet Encryption changes 2021-08-13 16:44:29 +10:00
Franck Royer 140791cc91
Provide easy way to bootstrap when creating Waku node 2021-08-13 16:18:00 +10:00
Franck Royer c3855112d7
Rename `getStatusFleetNodes`
To make it more generic to allow retrieval of bootstrap nodes from
other sources.
2021-08-13 16:17:15 +10:00
Franck Royer 319f44a0b1
`WakuStore.queryHistory` throws when encountering an error
Instead of returning a `null` value.
2021-08-09 12:36:24 +10:00
Franck Royer b422c9a10b
Move `contentTopics` out the `WakuStore.queryHistory`'s optional params 2021-08-09 12:36:12 +10:00
Franck Royer ad9d629daa
`ChatMessage` has been moved from js-waku to web-chat example
It is a type used for the [TOY-CHAT](https://rfc.vac.dev/spec/22/)
 protocol;
js-waku users should not build on top if this toy protocol and instead
design message data structures appropriate to their use case.
2021-08-06 17:25:12 +10:00
Franck Royer 0c3995a810
Remove cli-chat example
The focus of this library is on Web environment; Several examples now
cover usage of Waku Relay and Waku Store; web-chat POC should be
preferred to use the [TOY-CHAT](https://rfc.vac.dev/spec/22/) protocol.
2021-08-06 17:25:11 +10:00
Franck Royer 70c58c8c49
Release 0.10.0
### Added
- Relay and ReactJS guides and examples
  ([#56](https://github.com/status-im/js-waku/issues/56)).

### Changed
- **Breaking**: The `WakuMessage` APIs have been changed to move
  `contentTopic` out of the optional parameters.

### Removed
- Examples (web-chat): Remove broken `/fleet` command.
- **Breaking**: Removed `DefaultContentTopic` as developers must choose
  a content topic for their app; recommendations for content topic can
  be found at https://rfc.vac.dev/spec/23/.

### Fixed
- `WakuMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii
  characters.
- `ChatMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii
  characters.
2021-08-06 16:38:55 +10:00
Franck Royer 1b82c21297
Update changelog 2021-08-05 13:39:42 +10:00
Franck Royer 45dc8f81c9
Fixed `ChatMessage.payloadAsUtf8` returning garbage on utf-8 non-ascii 2021-08-02 10:36:50 +10:00
Franck Royer 1f692f1683
Fixed `payloadAsUtf8` returning garbage on utf-8 non-ascii characters 2021-08-02 09:51:37 +10:00
Franck Royer 0cfdd34284
Removed `DefaultContentTopic`
As developers must choose a content topic for their app.
The`WakuMessage` APIs have been changed to move `contentTopic` out of
the optional parameters. Recommendations for content topic can be found
at https://rfc.vac.dev/spec/23/.
2021-07-28 12:03:51 +10:00
Franck Royer 53ef23362c
Remove faulty fleet feature
It does not work as it can lead to infinite loops due to the handling of
the Waku instance. It should disconnect and reconnect to peers instead
of starting a new waku instance.
2021-07-28 11:58:02 +10:00
Franck Royer 9638f6db10
Introduced new `relayKeepAlive` option
..on `Waku` with a default to 5min to send ping messages over relay
to ensure the relay stream stays open.

This is a workaround until
[js-libp2p#744](https://github.com/libp2p/js-libp2p/issues/744) is done
as there are issues when TCP(?) timeouts and the stream gets closed.
2021-07-27 16:24:04 +10:00
Franck Royer ea33b9cd8a
Rename `keepAlive` option to `pingKeepAlive`
In preparation for introducing a relay keep alive feature.
2021-07-27 16:06:57 +10:00
Franck Royer 36a5a51aa8
Upgrade to libp2p 0.32.0 2021-07-27 14:31:06 +10:00
Franck Royer c35fe74dad
Release 0.9.0
### Changed
- **Breaking**: Store Response Protobuf changed to align with
  nim-waku v0.5
  ([nim-waku#676](https://github.com/status-im/nim-waku/pull/676)).
2021-07-26 16:49:30 +10:00
Franck Royer 5f7eee394b
Store Response Protobuf change to align with nim-waku
status-im/nim-waku#676
2021-07-26 11:35:08 +10:00
Franck Royer be007f4839
Ensure there is no infinite loop on error 2021-07-21 15:44:00 +10:00
Franck Royer 92a76b3be0
Support multiple protocol id for relay
Support id of latest nim-waku release 0.4 and current master.
2021-07-21 15:43:30 +10:00
Franck Royer 0753184079
Release 0.8.1
### Added
- Examples (web-chat): New `/fleet` command to switch connection between
  Status prod and test fleets.
- Export `generatePrivateKey` and `getPublicKey` directly from the root.
- Usage of the encryption and signature APIs to the readme.

### Changed
- **Breaking**: Renamed `WakuRelay.(add|delete)PrivateDecryptionKey` to
  `WakuRelay.(add|delete)DecryptionKey` to make it clearer that it
  accepts both symmetric keys and asymmetric private keys.

### Fix
- Align `WakuMessage` readme example with actual code behaviour.
2021-07-16 12:00:43 +10:00
Franck Royer 4f796ab920
Add encryption/signature documentation 2021-07-16 11:19:38 +10:00
Franck Royer 1d4137e2c4
Rename so that it does make dev thinks it's for asymmetric enc only 2021-07-16 10:24:29 +10:00
Franck Royer 07cba4f8ca
Update changelog for readme changes 2021-07-16 09:51:59 +10:00
Franck Royer a3c4eed656
Update changelog for fleet command 2021-07-16 09:50:44 +10:00
Franck Royer addf9543a2
Export `generatePrivateKey` and `getPublicKey` directly from the root 2021-07-16 09:43:10 +10:00
Franck Royer 3a3e718749
Release 0.8.0
### Added
- `WakuRelay.deleteObserver` to allow removal of observers, useful when
  a React component add observers when mounting and needs to delete it
  when unmounting.
- Keep alive feature that pings host regularly, reducing the chance of
  connections being dropped due to idle.
  Can be disabled or default frequency (10s) can be changed when calling
  `Waku.create`.
- New `lib/utils` module for easy, dependency-less hex/bytes
  conversions.
- New `peers` and `randomPeer` methods on `WakuStore` and
  `WakuLightPush` to have a better idea of available peers;
  Note that it does not check whether Waku node is currently connected
  to said peers.
- Enable passing decryption private keys to `WakuStore.queryHistory`.
- Test: Introduce testing in browser environment (Chrome) using Karma.
- Add support for Waku Message version 1: Asymmetric encryption,
  symmetric encryption, and signature of the data.

### Changed
- **Breaking**: Auto select peer if none provided for store and light
  push protocols.
- Upgrade to `libp2p@0.31.7` and `libp2p-gossipsub@0.10.0` to avoid
  `TextEncoder` errors in ReactJS tests.
- Disable keep alive by default as latest nim-waku release does not
  support ping protocol.
- **Breaking**: Optional parameters for `WakuMessage.fromBytes` and
  `WakuMessage.fromUtf8String` are now passed in a single `Options`
   object.
- **Breaking**: `WakuMessage` static functions are now async to allow
  for encryption and decryption.
- **Breaking**: `WakuMessage` constructor is now private, `from*` and
  `decode*` function should be used.
- `WakuMessage` version 1 is partially supported, enabling asymmetrical
  encryption and signature of messages;
  this can be done by passing keys to `WakuMessage.from*` and
  `WakuMessage.decode*` methods.
- Examples (eth-dm): Use Waku Message version 1 encryption scheme
  instead of `eth-crypto`.
- Examples (eth-dm): Use Protobuf for direct messages instead of JSON
  ([#214](https://github.com/status-im/js-waku/issues/214)).

### Fixed
- Disable `keepAlive` if set to `0`.
2021-07-15 12:48:47 +10:00
Franck Royer 6afecd9989
Mention encryption support 2021-07-15 10:36:24 +10:00
Franck Royer 8c66022a18
Update changelog for Karma 2021-07-14 15:35:46 +10:00
Franck Royer c2cef05c2d
Use protobuf instead of JSON for direct messages 2021-07-12 17:29:52 +10:00
Franck Royer 48bdb0b3f2
Use WakuMessage version 1 instead of eth-crypto 2021-07-12 17:09:44 +10:00
Franck Royer 0e9c482a19
Enable decryption of messages retrieve via `WakuStore.queryHistory` 2021-07-12 13:15:19 +10:00
Franck Royer d68ee3fb74
New `peers` and `randomPeer` methods to return available peers 2021-07-12 13:15:19 +10:00
Franck Royer 4fe0116039
Use ecies library that provide right ECIES parameters 2021-07-12 11:30:19 +10:00
Franck Royer 8cd5a52eba
Provide hex/bytes utils as part of js-waku 2021-07-09 15:50:17 +10:00
Franck Royer 34e6ac5247
Add version 1 support to WakuMessage 2021-07-09 15:50:15 +10:00
Franck Royer 2266f31d30
Move optional parameters to a single `Options` object. 2021-07-09 15:50:15 +10:00
Franck Royer aaf3b1867e
Disable keep alive by default as latest nim-waku release does not
support ping protocol.
2021-07-05 09:40:07 +10:00
Franck Royer 370a347ff2
Actually disable keep alive if set to 0 2021-07-02 10:51:58 +10:00
Franck Royer 6cb92dd4b9
Upgrade to latest libp2p versions
And few other packages
2021-06-22 13:21:23 +10:00
Franck Royer e3b4a42822
Add keep alive feature
Using libp2p ping protocol.
2021-06-21 09:46:29 +10:00
Franck Royer 939b5fb20a
Auto select peer if none provided for store and light push protocols 2021-06-16 23:51:20 +10:00
Franck Royer 60eb473047
Add `WakuRelay.deleteObserver` to allow removal of observers
Useful when a React component add observers when mounting and needs to
delete it when unmounting.
2021-06-16 16:37:04 +10:00
Franck Royer 6ed7445d83
Release 0.7.0
### Changed
- Test: Upgrade nim-waku node to v0.4.
- Waku Light Push upgraded to `2.0.0-beta1`.
- Examples (web chat): Catch error if chat message decoding fails.
- Examples (web chat): Do not send message if shift/alt/ctrl is pressed,
 enabling multiline messages.
2021-06-15 15:36:47 +10:00
Franck Royer c293e268e8
Do not send message if a modifier is pressed to enable multiline msgs 2021-06-11 14:38:31 +10:00
Franck Royer 8073021d82
Do not fail if a chat message is malformed 2021-06-11 14:38:22 +10:00
Franck Royer bc544c8e0b
Update Light Push protocol string to match nim-waku v0.4 2021-06-11 14:38:08 +10:00
Franck Royer ba8390f02a
Upgrade nim-waku to v0.4 2021-06-11 14:37:54 +10:00
Franck Royer e75fb91d3f
Release 0.6.0
### Changed
- **Breaking**: Websocket protocol is not automatically added anymore
  if the user specifies a protocol in `libp2p.modules` when using
  `Waku.create`.
- **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.
- Examples (cli chat): Use tcp protocol instead of websocket.

### 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.
- Doc: Link to [Waku v2 Toy Chat specs](https://rfc.vac.dev/spec/22/) in
  README.
- Examples (web chat): Persist nick.
- Support for custom PubSub Topics to `Waku`, `WakuRelay`, `WakuStore`
  and `WakuLightPush`;
  Passing a PubSub Topic is optional and still defaults to
  `/waku/2/default-waku/proto`;
  JS-Waku currently supports one, and only, PubSub topic per instance.
2021-06-09 20:49:19 +10:00
Franck Royer 2350ce5a6f
Clarify new libp2p modules transport behaviour 2021-06-09 16:59:27 +10:00
Franck Royer 1bb1f8f6b6
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.
2021-06-09 16:58:08 +10:00
Franck Royer 5ce0717f05
Enable passing a custom pubsub topic
Note that we currently only support one, and only one, pubsub topic for
a given instance across the codebase. The PubSub topic needs to be set
when instantiating the Waku* classes.

At this stage, we believe that most DApp will use, and only use, the
default PubSub topic. Some application want to use an alternative topic
but not use the default one so this behaviour should be fine. See #174
for details.
2021-06-09 15:00:03 +10:00
Franck Royer f17a008278
Separate the libp2p create options from Waku's 2021-06-09 15:00:02 +10:00
Franck Royer 6b48c55266
Persist nick 2021-06-04 15:15:07 +10:00
Franck Royer 39f96f4a56
Add link to Waku v2 Toy Chat specs 2021-06-01 16:35:52 +10:00
Franck Royer 5de796ea70
Add link to new topic usage recommendation 2021-06-01 16:35:52 +10:00
Franck Royer 553c0154d9
Use waku message timestamp as better unique key 2021-05-28 22:38:00 +10:00
Franck Royer 9e64eec2a6
Enable test encoding and decoding of WakuMessage.timestamp 2021-05-28 22:35:59 +10:00
Franck Royer 80e7ae9d1e
Release 0.5.0 2021-05-21 15:43:34 +10:00
Franck Royer 90e224577f
Add `--help` command 2021-05-19 12:29:30 +10:00
Franck Royer 2ea17bfdfa
Use light push to send messages if it's passed 2021-05-19 12:29:29 +10:00
Franck Royer fb7e9f2b9e
Get messages from store in chronological order 2021-05-19 12:29:29 +10:00
Franck Royer de3aea626a
Implement Light Push protocol 2021-05-19 12:29:29 +10:00
Franck Royer 85dd64b81e
Release 0.4.0 2021-05-18 14:14:18 +10:00
Franck Royer c4c259f47a
Connect cli chat to prod fleet upon passing `--prod` 2021-05-18 13:51:11 +10:00
Franck Royer a69c483c46
Connect to prod fleet by default, test fleet for local development 2021-05-18 13:51:11 +10:00
Franck Royer 2cd87b561d
Expose `Enviroment` & `Protocol` enums to pass to `getStatusFleetNodes` 2021-05-18 13:45:49 +10:00
Franck Royer 537a2b73a7
Use prod nodes by default instead of test 2021-05-18 13:26:42 +10:00
Franck Royer 243b6629c3
Add callback option to store query 2021-05-17 16:32:34 +10:00
Franck Royer 4b6fe84392
Use one object as we are increasing the number of parameters 2021-05-17 16:32:33 +10:00
Franck Royer 703b50cfae
Upgrade nim-waku to v0.3 2021-05-16 14:43:07 +10:00
Franck Royer 1f081718dd
Fix link 2021-05-15 22:00:29 +10:00
Franck Royer 5ab9964191
Release 0.3.0 2021-05-15 21:25:20 +10:00
Franck Royer 9cf83585ed
Remove unused dependencies 2021-05-15 19:57:47 +10:00
Franck Royer 79bef35460
Add and use `getStatusFleetNodes` to connect to Status' wakunodes 2021-05-15 19:52:05 +10:00
Franck Royer eed1d39ec5 Clarify content topic format 2021-05-14 09:14:08 +00:00
Franck Royer a9d5222b80
Release 0.2.0 2021-05-14 09:39:56 +10:00
Franck Royer 89b35eb4df
Disable send button if no peer available
Yet keep it enabled if user tries to send a command.

Resolves #136
2021-05-13 20:48:33 +10:00
Franck Royer a8d4d494f8
Add getPeers method
To know if relay messages would be published.
2021-05-13 20:48:33 +10:00
Franck Royer eb9955314c
Align terminology with specs
In specs, this is referenced as a `pubsubTopic`.
2021-05-13 20:48:30 +10:00
Franck Royer 065593b0cf
Revert naming to js-waku
To align with go-waku and nim-waku and keep bors working.
2021-05-13 20:27:38 +10:00
Franck Royer e44776d09c
Update usage with dial peer method 2021-05-13 13:43:08 +10:00
Franck Royer 6f7c1e0ca3
Enhance addPeerToAddressBook
So that consumer does not need to import multiaddr and peer-id.
2021-05-13 13:42:40 +10:00
Franck Royer 76bad59d5a
Release 0.1.0
### Added
- Add usage section to the README.
- Support of [Waku v2 Relay](https://rfc.vac.dev/spec/11/).
- Support of [Waku v2 Store](https://rfc.vac.dev/spec/13/).
- [Node Chat App example](./examples/cli-chat).
- [ReactJS Chat App example](./examples/web-chat).
- [Typedoc Documentation](https://status-im.github.io/js-waku/docs).
2021-05-13 12:01:07 +10:00
Franck Royer 702201f7be
Set first release version to 0.1.0 2021-05-13 11:01:41 +10:00
Franck Royer 0ffde9cf42
Add documentation to the readme 2021-05-12 13:35:25 +10:00
Franck Royer 68ee01b652
Release 1.0.0 2021-05-11 17:40:18 +10:00
Franck Royer 0e9f2c2ecc
Add CHANGELOG.md 2021-05-11 14:05:12 +10:00