* move relay related code
* move libp2p to utils
* define CreateWakuNodeOptions
* improve options
* make libp2p use from create function
* add bootstrapPeers option
* fix lint
* fix types, imports
* fix exports
* use bootstrap along default bootstrap
* fix test as REST does not return peer though connection is made
* rollback condition change
* enable gossipSub back for every node
* initialise the new package
* feat: implement LocalStorageDiscovery
* add: Startable to cspell
* add compliance test
* add: discovery tests
* rm: browser tests script
* address comments
* add type safety to getting peers from local
* only dispatch peer if it does not exist
* move ws ma extraction to utils
* chore: update package name to local-discovery
* fix: add compliance test with no external deps on service node
* use peer:identify instead of peer:update
* add: unit tests & remove sdk dependency
* move tests to self package
* update cspell + remove unrequired deps
* add types
* maintain in-memory peers for localstorage
* address comments
* chore: rename
* use name from options
* fix: saving peers
* rm: only
tests: use a generator for sharded pubsub topics
set pubsub topic in encoder/decoder based on sharding type
add function for grouping content topics by pubsub topic
add autosharding config to create options
add autoshard rpc endpoints to nwaku and use in tests
set autoshard pubsub topics in all protocols
fix rebase with static sharding
removes unused function
remove console logs
remove autosharding from ShardInfo, add to EncoderOptions
fix enr and encoder/decoder options
test that same application/version hashes to same shard index
update comment on shard field
fix spelling of autosharding
fix content topic protocol in tests
add sharding type alias and function to determine topic in encoders/decoders
move DefaultPubsubTopic from core to interfaces
* add proto
* add rpc and interfaces
* add protocol implementation
* update faulty proto def
* add rpc and interfaces
* refactor implementation & write test
* setup the metadata protocol as a service
* fix cases where metadata service needs to be undefined
* remove redundant catch block
* remove addressed TODO
* update import path
* log errors
* remove redundant code from handling incoming metadata request
* update tests
* add test to check for active connections
* change expects
* save remote peer's shard info after successful connection
* refactor: rename as this method does not check empty payloads
* feat: fail early when trying to send empty payload
---------
Co-authored-by: Sasha <oleksandr@status.im>
* `ProtocolCreateOptions` now has `pubSubTopic` as `pubSubTopic[]`
* chore: update encoder & decoder to support `PubSubTopic`
* feat(protocols): allow multiple `PubSubTopic[]`
* feat(relay): allow multiple `PubSubTopic[]`
* chore(tests): update for new API
* chore: minor fixes
* chore: make store more robust
* fix(relay): correctly set types
* chore(address comments): update terminology around configured pubsub topics
* chore(address comments): minor refactoring
* chore(relay): split `subscribe` into smaller functions for readability & modularity
* chore(address comments): refactor `waitForGossipSubPeerInMesh`
* chore(store): only allow to query one `pubSubTopic`
* fix: `store` bug
* feat(tests): add some basic tests
* sharding utils
* address comments
* feat(relay): re-add API for `getMeshPeers`
* update error message
Co-authored-by: fryorcraken <110212804+fryorcraken@users.noreply.github.com>
* refactor for new API
* feat: simplify handling of observers (#1614)
* refactor: simplify handling of observers
* refactor: Remove redundant PubSubTopic from Observer
* use `??` instead of `||`
* update `pubsubTopic` to `pubSubTopic`
* update `interval` typo
* change occurence of `pubsubTopic` to `pubSubTopic`
* relay: rm `getAllMeshPeers` and make `pubSubTopics` public
* relay: use `push_or_init_map` and move to `utils`
* fix: update API for tests
* fix: relay waitForRemotePeer
---------
Co-authored-by: fryorcraken <110212804+fryorcraken@users.noreply.github.com>
* update typescript, define in root package.json
* update typedoc and fix typedoc comments
* update dev version of tsconfig
* set module and resolution for tsconfig dev
* bump ts plugins
* set order of typedoc generation
* turn off warnings as errors setting
* 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
* add: test for multi enrtree + static multiaddr
* wrap up test
* rm: only
* move test to optional file
* dns-disc: setup default for node requirements & move to constants
* chore: restructure DNS Discovery for better readability
* fix: build
* fix: type import
* fix: test expect
* rm: only
* update packagelock
* use new libp2p interface
* fix linting errors