* maintain pings in a hashmap
* convert `KeepAliveManager` into a singleton
* chore: fix an unrelated cyclic dependency error
* update `selectPeerForProtocol` to return peer with the lowest latency
* use the new KeepAliveManager API
* use the new API for `selectPeerForProtocol`
* add tests
* use PeerData to hold the ping instead of a new variable
* improve tests for readability
* move back KeepAliveManager from singleton
* reenable all tests
* minor improvements
* improve error handling
* convert .then() syntax to async/await
* set peer-exchange with default bootstrap
* only initialise protocols with bootstrap peers
* update package
* update package-lock
* refactor `getPeers` while setting up a protocol
* move codecs to `@waku/interfaces`
* lightpush: send messages to multiple peers
* only use multiple peers for LP and Filter
* fix: ts warnings
* lightpush: tests pass
* update breaking changes for new API
* move codecs back into protocol files
* refactor: `getPeers()`
* rm: log as an arg
* add tsdoc for getPeers
* add import
* add prettier rule to eslint
* add: peer exchange to sdk as a dep
* fix eslint error
* add try catch
* revert unecessary diff
* revert unecessary diff
* fix imports
* convert relaycodecs to array
* remove: peerId as an arg for protocol methods
* keep peerId as an arg for peer-exchange
* remove: peerId from getPeers()
* lightpush: extract hardcoded numPeers as a constant
* return all peers if numPeers is 0 and increase readability for random peers
* refactor considering more than 1 bootstrap peers can exist
* use `getPeers`
* change arg for `getPeers` to object
* address comments
* refactor tests for new API
* lightpush: make constant the class variable
* use `maxBootstrapPeers` instead of `includeBootstrap`
* refactor protocols for new API
* add tests for `getPeers`
* skip getPeers test
* rm: only from test
* move tests to `base_protocol.spec.ts`
* break down `getPeers` into a `filter` method
* return all bootstrap peers if arg is 0
* refactor test without stubbing
* address comments
* update test title
* move `filterPeers` to a separate file
* address comments & add more test
* make test title more verbose
* address comments
* remove ProtocolOptions
* chore: refactor tests for new API
* add defaults for getPeers
* address comments
* rm unneeded comment
* address comment: add diversity of node tags to test
* address comments
* fix: imports
* pass log as an arg to baseprotocol
* optimistically create and use streams for light protocols
* refactor BaseProtocol for readability
* use optimistic stream selection in protocols
* use a new stream for every request instead of reusing
* replenish streams correctly
* create StreamManager
* refactor for a single stream
* fix: listener binds
* declare streamManager as a class var isntead of extending
* remove stream destruction as it happens by default
* simplify logic & address comments
* fix: bind typo
* refactor for improvements
* fix typedoc
* rm: lock
* restructure StreamManager for readbility
* remove log as an arg
* use newStream as a facade in BaseProtoocl
* 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
* Refactors message decoding to abort as soon as a suitable decoder found. #1369
* fix: return from the function
* improve readability
---------
Co-authored-by: Danish Arora <35004822+danisharora099@users.noreply.github.com>
Co-authored-by: danisharora099 <danisharora099@gmail.com>
* 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