Commit Graph

50 Commits

Author SHA1 Message Date
Franck Royer e244bae03d
Renamed `getBootstrapNodes` to `getNodesFromHostedJson`
So that the name better matches the function's behaviour.
2022-01-13 15:33:37 +11:00
Franck Royer 6f4d765e30
Remove useless log 2021-10-05 13:36:04 +11:00
Franck Royer 640a672257
Do not setup libp2p discovery module if we fail to retrieve node addrs 2021-09-21 14:47:45 +10:00
Franck Royer a21d641280
Added `Waku.waitForConnectedPeer` helper
To ensure that we are connected to Waku peers when using the bootstrap
option.
2021-09-02 15:46:23 +10:00
Franck Royer cfb97b6bde
Allow passing decryption keys to `Waku` instance
Keys can be set at creation or at run time.
They are passed to `WakuStore` and `WakuRelay` instances.
2021-09-02 15:20:43 +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 3f95934250
Replace deprecated package for libp2p-noise 2021-08-19 11:26:34 +10:00
Franck Royer 6d42c39298
export values so they are included in the documentation 2021-08-13 16:18:03 +10:00
Franck Royer 140791cc91
Provide easy way to bootstrap when creating Waku node 2021-08-13 16:18:00 +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 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 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 f3738b1eac
doc: Fix keep alive default value 2021-07-15 14:00:24 +10:00
Franck Royer e443237a81
Remove local type definitions for Karma to not return "not found" 2021-07-14 12:25:23 +10:00
Franck Royer a0d3a21762
Improve importing of Muxed Stream type 2021-07-14 11:38:59 +10:00
Franck Royer acdc032253
Simplify code 2021-07-09 15:50:16 +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 381fc8b82c
Add keep alive feature
Using libp2p ping protocol.
2021-06-21 09:46:41 +10:00
Franck Royer e3b4a42822
Add keep alive feature
Using libp2p ping protocol.
2021-06-21 09:46:29 +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 de3aea626a
Implement Light Push protocol 2021-05-19 12:29:29 +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 19e265c490
Remove unneeded variable 2021-05-13 12:30:13 +10:00
Franck Royer fda65ca83b
Fix documentation 2021-05-13 12:30:13 +10:00
Franck Royer 3663ce260d
Rework exports for an easy use of the library 2021-05-10 16:41:58 +10:00
Franck Royer 9e30627e2b
Force return types to be specified
Makes it easier to use the library. Best to enforce this early on.
2021-05-04 11:12:32 +10:00
Franck Royer d0020744b4
Use provided API 2021-05-04 10:23:31 +10:00
Franck Royer 69a3f73ee6
Self emit to see own messages 2021-04-22 14:47:43 +10:00
Franck Royer 09fa8a0447
Must pass filter.all to connect to ip4 ws peer 2021-04-22 10:39:05 +10:00
Franck Royer afba3210e9
Upgrade libp2p to 0.31.0-rc.3 2021-04-21 16:17:32 +10:00
Franck Royer e0debac165
Subscribe to default topic when starting, Remove dual Waku relay classes 2021-04-16 11:25:08 +10:00
Franck Royer 9a305033bc
Use peerStore event to determine if identify is done 2021-04-15 14:44:35 +10:00
Franck Royer 503157401e
Allow passing transports, enable websocket transport 2021-04-15 13:56:07 +10:00
Franck Royer 4b31a6aaba
Wait for identify protocol to finish when dialing
Removes most `delay()`.
2021-04-13 22:43:13 +10:00
Franck Royer e9d51a6c57
Implement Waku store protocol 2021-04-09 16:54:30 +10:00
Franck Royer 79a9520348
Test cleanup 2021-04-09 16:05:43 +10:00
Franck Royer 433a490dec
Move waku relay codec and default topic to constants module 2021-04-01 16:41:49 +11:00
Franck Royer c3cf6462cc
Pass listening addresses as argument 2021-04-01 11:01:14 +11:00
Franck Royer d2f1995f3e
Can receive message over internet 2021-04-01 11:01:14 +11:00
Franck Royer 46c41dc50f
Test connection triggered from js and add API 2021-03-29 15:08:31 +11:00
Franck Royer 4f58bde054
Add js to js subscribe test 2021-03-26 09:37:01 +11:00
Franck Royer 4473ad4cc7
Add tests where js initialize the connection to nim 2021-03-25 20:47:48 +11:00
Franck Royer 2486071708
Reduce entropy usage in tests
When playing around with tests frameworks, it was noticed that noise
was using entropy that lead to handles remaining open at the end of the
test run.
2021-03-22 22:25:13 +11:00
Franck Royer 090b064c84
Kill nim-waku & js-libp2p nodes after tests 2021-03-22 14:24:01 +11:00
Franck Royer 39332808d5
Improve API by using composition 2021-03-19 14:40:16 +11:00