* move KeepAliveOptions to dedicated interface file
* update export for KeepAlive
* expose `ConnectionManager` on the waku node
* update ConnectionManager test to use the exposed API
* rm: only for the test
* disable libp2p autodial
* improve logs for peer-exchange
* add a function to fetch discovered and connected peers by discovery
* connection-manager: introduce event emissions by discovery
* write a spec test for events
* minor code improvement for peer-exchange
* rm: comment
* rename peer event result interface
* switch to using libp2p EventEmitter
* rename variables for readability
* reset peer-exchange spec file
* address review
* test: minor refactor
* fix: failing test
* increase peer IDs to test against for attemptDial
* improve structuring
* rm: v1
* fix v2 imports
* remove tests for filter v1
* set filter v1 as default and rm v2 completely
* change import name for filter v2
* rename FilterV2 to Filter completely
* fix run check
* upgrade libp2p version, partially update protocols, rename to IBaseProtocol
* complete transition for protocols
* complete transition of connection maanger
* finish sdk
* complete core
* complete relay
* complete peer-exchange
* complete dns-discovery
* add components field to Libp2p interface and use it in core
* add type hack for Libp2p creation:
* finish waku node test
* complete relay test
* complete peer exchange
* complete dns peer discovery test
* add missing dependency to relay
* fix new peer store integration
* improve initialization of pubsub
* add catch for missing peer
* update test and remove extra dependency
* prevent error throw
* fix edge case with peerStore
* fix peer exchange
* fix protocols used
* fix test with another evnet
* bump libp2p and interfaces
* add missing package
* fix peer-exchange problem
* prefer libp2p peerDiscovery for integration tests
* fix import
* increate timeout
* return test against Test fleet
* remove await for peer:update
* increase timeout
* add await for peerStore
* comment event for testing
* fix lint
* remove bind
* fix stub
* decouple to separate test case
* move back to explicit build
* remove only
* do not test event
* add sinon
* use new API for libp2p to attach event listener
* add a test for event emitter/listening
* add tests to check peer dials happen as expected for bootstrap peers
* add tests for peer-exchange
* remove only and run all tests
* chore: rm extra packages
* chore(deps): revert temp
* chore(deps): revert temp
* add sinon
---------
Co-authored-by: jacques metevier <jmetevier@gmail.com>
* allow passing of multiple ENRs to DNS Discovery
* add test for >1 ENR to DNS Disc
* address comments
* feat: dial multiple peers in parallel (#1380)
* ensure discovered peers are dialed in parallel
* cap parallel dials
* drop connection to bootstrap peer if >set connected
* switch to american english
* improve promises and error logging
* implement proto
* implement filter v2
* add tests
* minor improvements
- make unsubscribe functions private in
filter
- enable all tests
* enable all tests
* readd multiaddrinput
* address comment removals
* unsubscribe based on contentFilters passed
* update unsubscribe function parameters in test
* reset interfaces & filter v1
* refactor filterv2 into 2 classes
- removes generics from types on filter which means
manual typecasting to filter version is required on
consumer side
- defaults to filterv2
- splits filterv2 into 2 classes:
- one to create the subscription object with a
peer which returns the second class
- the other to manage all subscription functions
* updates filter tests for the new API
- also fixes an interface import
* update `toAsyncIterator` test for Filter V1
* implement IReceiver on FilterV2
* remove return values from subscription functions
* update `to_async_iterator`
* address variable naming
* add tsdoc comments for hidden function
* address minor comments
* update docs to default to filter v2
* address comments
* rename `wakuFilter` to `wakuFilterV1`
* chore: Remove static variables (#1371)
* chore: Remove static variables
- Remove internal types from `@core/interfaces`
- Remove data being redundantly stored (pubsub topic)
- Remove usage of static variables
- Clean up callbacks and decoders when using `unsubscribe`
- Clean up callbacks and decoders when using `unsubscribeAll`
* fix setting activeSubscription
---------
Co-authored-by: danisharora099 <danisharora099@gmail.com>
* make activeSub getter and setter private
* update size-limit
---------
Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
* move dockerode into a separate class
* rename `nwaku` to `WakuNode` to generalise
- nwaku and go-waku were running through
`nwaku.ts`
* move wakunode and docker into one subdir
* rename node to `NimGoNode` and update imports in tests
* update docker to host all containers in a specific network
* update the peer exchange test
* assign static IPs to containers
* enable relay on px interop
* fix px compliance tests
* fix import
* merge: master
* fix: CI
* use: js script instead of shell script to run precheck and mocha
* use `console.log` instead of `debug.log` for `run-tests.js`
* skip fleet test for CI
* add: compliance test
* fix: check CI
* fix: nwaku node name
* remove: setTimeout
* force typecasting instead of ts-ignore
* rm: only for the test
* increase readability
- Replace exception pattern with a result pattern as it better fits the
usage.
- merge few maps to prefer chaining to assign var after var.
- Make `isDefined` type helper a common util function
* initialises ConnectionManager and KeepAliveManager
ports from previous PR and makes necessary improvements and reductions
* address: comments
* map a ConnectionManager instance with a WakuNode
* abstract event listeners logic
* minor fix
* minor cleaning
* instantiate KeepAliveManager instead of extending
* fix build and enable all tests
* fix CI
* address review
* refine event handlers
- only removes the previously attached callback from
the event handlers while shutting down service
- removes the requirement of passing around
`keepAliveOptions` and `relay` inside of
`ConnectionManager`
* add verbosity to interface
* make `dialPeer()` more readable
* use set to push tags to avoid duplicates
* fix: merge build
* remove: logging function
* rename startService and stopService
* remove: future TODO
added that as part of future refactor
* use the new libp2p api
* initialise options in constructor//fix TS error
* remove stale export
* address principal review
* reset test timeout to master
* remove peer-exchange from @waku/core
- also removes the manual test for peer-exchange (assumption is that the
only way to initialise peer-exchange is through libp2p's peerDiscovery and
not manually) (ref:
https://github.com/waku-org/js-waku/pull/1158#discussion_r1108055234)
# Please enter the commit message for your changes. Lines
starting
* fix: build
* update interop test
* decrease test duration for px auto discovery
* rm: only for tests
* address comment
* handle a breaking edge case
- changes interval from static to increasing
- handles an edge case which resulted in unwanted return
from a function
* modularise code & make defaults configurable
- breaks the backoff code into a separate function
- makes default values configurable
- improve interval handling
* clean code for checking peer in peerStore
* address comments
* rename `backoff` to `abort`
* add locally run nwaku interop test for peer-exchange
* replace `--listen-address` with `--nat:extip`
* address improvements
* use DNS discovery as default bootstrap discovery
* fix: failing CI
* fix: typo
* introduce tagging, components & explicit tests
libp2p wasn't by default tagging peers with dns-discovery as
"bootstrap"
-- we are manually now tagging peers with "dns-discovery", and then
running tests according to that
* fix: package installs
* fix: typedoc CI
* change tag name from dns-discovery to bootstrap
* update tag name in test
* fix CI
* address review
* add: prod enrtree and use as default
* fix: change DoH DNS provider
opendns did not support CORS -- switched it with AhaDNS that does not
persist logs
* Update packages/dns-discovery/src/dns_over_https.ts
Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
* add ahadns to cspell
* increase timeout on compliance test
possibly the new dns provider we use is taking longer than
opendns to resolve is why the test did not pass with
5000ms
Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
* temp-add: debugging
* fix: ENR root signature verification
the nodes in the TXT/fleet were updated causing the publicKey to change
and verification to fail
* add: libp2p compliance tests
* fix: bind function
`bind` was being passed an empty object reference
* fix: tests
* merge with master
* chore: address review
- move compliance test to dev dependency
- move global mocha timeout to test specific timeout
* chore: update enrtree pubkey and fqdn
ref: https://github.com/status-im/infra-nim-waku/issues/64
* chore: update libp2p-peer-discovery-compliance-tests
ref: https://github.com/libp2p/js-libp2p-interfaces/pull/328
* chore: fix typedoc errors
* add: dns-discovery to dependencies
* fix: discovery for peer-exchange
use the bootstrap node as a starter to send a
peer-exchange query to, and emit the response
peers received from it for further connection to
libp2p using the peer-discovery interface
* init: test for libp2p bootstrap/discovery for
peer-exchange
* temp-add: console.logs for easier debugging
* add: peer discovery test & rm: console.logs
* chore: rm and redundant spec test
* add: interval for peer exchange queries
we set an interval to query a peer every 5 minutes
for peer exchange, and add new peers if found
* address: reviews
- add `type` for imports not using values
- better handling for peer-exchange query interval
* chore: fix tsc for peer-exchange
use node16 for module resolution
* chore: add extra exports to fix typedoc warnings
ref: https://github.com/TypeStrong/typedoc/issues/1739
This is because `IDecodedMessage` does not include all possible field of
messages from a specific decoder (ie, signature public key, etc) so
usage of the `DecodedMessage` class associated with the used decoder is
preferred.
* chore: change `localhost` -> `127.0.0.1`
There is a change in how Node does DNS resolution in Node 18 vs
16 -- `localhost` resolves to `::1`, which is the equivalent of
`127.0.0.1` but in IPv6 instead of IPv4. The server however is
only listening on IPv4.
Reference:
https://github.com/nodejs/node/issues/40702#issuecomment-958143154
* refactor: change node version on CI from 16 to 18
`createEncoder`, `createDecoder` and `DecodedMessage` are function/types
useful to the user so they should have easy access to it.
We still export `Decoder` and `Encoder` but in a path so it cam be
re-used by `@waku/message-encryption`.
Reasoning: by exposing the `Decoder` and `Encoder` classes to the user,
the user may care about them, try to use the method etc.
By "hiding" them away and providing `create*` help, the aim is for the
user to just call a function instead of instantiating a class.
Also, `V0` does not provide much information to the user so removing it.
The messages were sent at the same time over light push so there was
no strong order preservation from the behaviour.
Correction: order does not matter, just check that messages aren't
present.
Messages were only checked for `ephemeral` being false + one test was
doing several checks.
Correction: split the test and use light push + filter to check
ephemeral field value preservation.