Commit Graph

470 Commits

Author SHA1 Message Date
Danish Arora a30b2bd747
chore!: add exports map to @waku/utils (#1201)
* add exports map

* merge: master

* export  subdir with default export path

* import according to the export path
2023-03-14 10:10:38 +05:30
dependabot[bot] 687f9bec5f
chore(deps)(deps): bump @libp2p/crypto from 1.0.12 to 1.0.14
Bumps [@libp2p/crypto](https://github.com/libp2p/js-libp2p-crypto) from 1.0.12 to 1.0.14.
- [Release notes](https://github.com/libp2p/js-libp2p-crypto/releases)
- [Changelog](https://github.com/libp2p/js-libp2p-crypto/blob/master/CHANGELOG.md)
- [Commits](https://github.com/libp2p/js-libp2p-crypto/compare/v1.0.12...v1.0.14)

---
updated-dependencies:
- dependency-name: "@libp2p/crypto"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-14 02:25:11 +00:00
dependabot[bot] a159e3ca62
chore(deps)(deps-dev): bump @libp2p/interface-peer-routing
Bumps [@libp2p/interface-peer-routing](https://github.com/libp2p/js-libp2p-interfaces) from 1.0.7 to 1.0.8.
- [Release notes](https://github.com/libp2p/js-libp2p-interfaces/releases)
- [Commits](https://github.com/libp2p/js-libp2p-interfaces/compare/@libp2p/interface-peer-routing-v1.0.7...@libp2p/interface-peer-routing-v1.0.8)

---
updated-dependencies:
- dependency-name: "@libp2p/interface-peer-routing"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-14 00:43:39 +00:00
fryorcraken.eth bd983ea48e
feat!: enable encoding of `meta` field 2023-03-14 11:21:09 +11:00
fryorcraken.eth 497588bc36
chore: make topics arbitrary data 2023-03-14 11:21:08 +11:00
fryorcraken.eth 560c393662
fix: add payload to relay ping messages to avoid poor relay peer scoring
Note that this keep alive mechanism should probably be removed.
2023-03-14 11:14:52 +11:00
fryorcraken.eth b3228a2dfe
chore: refactor delete undefined logic 2023-03-14 11:07:57 +11:00
fryorcraken.eth 5a8de54d50
chore: remove some code duplication 2023-03-14 11:07:57 +11:00
Sasha 4d7b3e39e6
fix: prettier and cspell ignore CHANGELOG (#1235) 2023-03-13 23:40:41 +01:00
fryorcraken.eth 628ac50d71
feat!: expose pubsub topic in `IDecodedMessage`
Needed for deterministic message hash.

Ref: #1208
2023-03-13 13:49:24 +11:00
fryorcraken.eth 96847374d6
feat(relay): validate waku message at gossip layer 2023-03-13 13:04:24 +11:00
dependabot[bot] 930e54c292
chore(deps)(deps-dev): bump @types/uuid from 9.0.0 to 9.0.1
Bumps [@types/uuid](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/uuid) from 9.0.0 to 9.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/uuid)

---
updated-dependencies:
- dependency-name: "@types/uuid"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-10 16:08:28 +00:00
fryorcraken.eth 5a42efcd8d
chore: rename: peer exchange peers are not bootstrap peers 2023-03-10 10:23:40 +11:00
fryorcraken.eth 1181eadcf8
doc: fix references in comments 2023-03-10 10:23:39 +11:00
fryorcraken.eth 81ad14cad3
chore: segregate basic access to fields and more advanced logic
Move basic access to ENR fields (with conversion) to `RawEnr`

`ENR` inherits from `RawEnr` and add a layer of logic.
2023-03-10 10:23:39 +11:00
fryorcraken.eth 6dbcde041a
chore!: directly convert from ENR to `PeerInfo`, remove unneeded utility 2023-03-10 10:23:39 +11:00
fryorcraken.eth 84f114bfa4
chore: extract and simplify `getLocationMultiaddr`
Using switch/case when appropriate.
2023-03-10 10:23:39 +11:00
fryorcraken.eth af5c5733a5
chore: split functions 2023-03-10 10:23:39 +11:00
fryorcraken.eth 22ffcf571a
chore!: extract encoder code
Separation of concerns by moving encoding logic in new class.
2023-03-10 10:23:39 +11:00
fryorcraken.eth 130c49b636
chore!: extract decoder code
Separation of concerns by moving decoding logic in new class.
2023-03-10 10:23:38 +11:00
fryorcraken.eth 8fd1455122
chore: extract test code
createFrom* functions are only used in test.
By extracting them in different class it should help
bundlers.
2023-03-10 10:23:38 +11:00
fryorcraken.eth 031f4c0c21
chore: improve function name
By describe why one would use it.
2023-03-10 10:23:38 +11:00
fryorcraken.eth a513087637
chore: remove functions not used in prod 2023-03-10 10:23:38 +11:00
fryorcraken.eth 93ba160791
chore: remove unused keypair api 2023-03-10 10:23:38 +11:00
fryorcraken.eth 46a020c6b4
chore: split function as one part was only used in test 2023-03-10 10:23:38 +11:00
fryorcraken.eth 05b122e646
chore: remove unnecessary functions 2023-03-10 10:23:38 +11:00
dependabot[bot] 9e03644f48
chore(deps)(deps-dev): bump cspell from 6.26.3 to 6.28.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.26.3 to 6.28.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.26.3...v6.28.0)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-09 23:18:07 +00:00
fryorcraken.eth 952aadd7bb
fix(dns-discovery/peer-exchange): check if peer is already tagged
If we `continue` when the peer is already known by the `peerStore` then
the next step of checking the tags is useless (no tags if peer is not
known).

There are two ways around it:
1. either do nothing if peer is already in peer store
2. OR, do nothing if peer is in peer store and is already tagged

I opted for the second approach to ensure all peers are tagged properly.
2023-03-10 10:09:10 +11:00
fryorcraken.eth da1b18d995
feat: export `Decoder`, `Encoder` and `DecodedMessage` types from root
Fixes #1010
2023-03-08 09:52:27 +11:00
dependabot[bot] b9a5032930
chore(deps)(deps-dev): bump fast-check from 3.6.3 to 3.7.0
Bumps [fast-check](https://github.com/dubzzz/fast-check/tree/HEAD/packages/fast-check) from 3.6.3 to 3.7.0.
- [Release notes](https://github.com/dubzzz/fast-check/releases)
- [Changelog](https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/CHANGELOG.md)
- [Commits](https://github.com/dubzzz/fast-check/commits/v3.7.0/packages/fast-check)

---
updated-dependencies:
- dependency-name: fast-check
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-07 16:10:09 +00:00
fryorcraken.eth 56814ba740
chore: rename build-utils to avoid potential conflict 2023-03-07 16:44:57 +11:00
dependabot[bot] 28ec631432
chore(deps)(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.53.0 to 5.54.1.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.54.1/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-06 23:23:40 +00:00
dependabot[bot] 6e3953e210
chore(deps)(deps): bump @libp2p/peer-id from 2.0.1 to 2.0.2
Bumps [@libp2p/peer-id](https://github.com/libp2p/js-libp2p-peer-id) from 2.0.1 to 2.0.2.
- [Release notes](https://github.com/libp2p/js-libp2p-peer-id/releases)
- [Commits](https://github.com/libp2p/js-libp2p-peer-id/compare/@libp2p/peer-id-v2.0.1...@libp2p/peer-id-v2.0.2)

---
updated-dependencies:
- dependency-name: "@libp2p/peer-id"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-03-01 16:14:08 +00:00
fryorcraken.eth 0b93fdd76d
chore: extract exports path from package.json for rollup
Also sort eslint to lint JavaScript ESM files successfully.

Fixes #933
2023-03-01 15:46:21 +11:00
fryorcraken.eth 1a9b13f902
chore: use `BaseProtocol` on `WakuPeerExchange`
Ref: https://github.com/waku-org/js-waku/pull/1137
2023-02-28 13:49:36 +11:00
fryorcraken.eth 60e866f00d
chore: remove usage of `any` 2023-02-28 12:00:53 +11:00
fryorcraken.eth 6c37ee5f19
chore: make variable used as boolean, a boolean 2023-02-28 12:00:53 +11:00
dependabot[bot] 35dab5392d
chore(deps)(deps-dev): bump eslint from 8.34.0 to 8.35.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.34.0 to 8.35.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.34.0...v8.35.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-27 16:25:16 +00:00
fryorcraken.eth 81d6638067
chore: use pascal case for class name 2023-02-27 14:00:49 +11:00
fryorcraken.eth 967e6ffc7e
chore!: update store.proto
Ref: https://github.com/vacp2p/waku
2023-02-27 14:00:33 +11:00
fryorcraken.eth 5cf8ed2030
chore!: update message.proto: payload and content topic are always defined
Ref: https://github.com/vacp2p/waku
2023-02-27 14:00:33 +11:00
fryorcraken.eth 18d31381d2
chore: use pascal case for class name 2023-02-27 14:00:32 +11:00
fryorcraken.eth 3e93e8f49e
chore: update light_push.proto
Ref: https://github.com/vacp2p/waku/blob/main/waku/lightpush/v2beta1/lightpush.proto
2023-02-27 14:00:32 +11:00
fryorcraken.eth d6184fb41a
fixup! chore: update filter.proto 2023-02-27 14:00:32 +11:00
fryorcraken.eth f6130d65c9
chore: use pascal case for class name 2023-02-27 14:00:31 +11:00
fryorcraken.eth 5f0e8b72f5
chore: update filter.proto
Ref: https://github.com/vacp2p/waku
2023-02-27 14:00:31 +11:00
fryorcraken.eth 31740e7a3d
chore: add `build:esm` script so it can be called from root script 2023-02-27 14:00:31 +11:00
dependabot[bot] 911ccd0074
chore(deps)(deps-dev): bump puppeteer from 19.7.1 to 19.7.2
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 19.7.1 to 19.7.2.
- [Release notes](https://github.com/puppeteer/puppeteer/releases)
- [Changelog](https://github.com/puppeteer/puppeteer/blob/main/release-please-config.json)
- [Commits](https://github.com/puppeteer/puppeteer/compare/puppeteer-v19.7.1...puppeteer-v19.7.2)

---
updated-dependencies:
- dependency-name: puppeteer
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-26 23:12:33 +00:00
fryorcraken.eth 789bebed00
chore: add `BaseProtocol` class to req-resp protocols
Each protocol implementation have some common functionality.
Implements those in `BaseProtocol`, to be extended by each protocol
implementation.
2023-02-27 09:48:30 +11:00
fryorcraken.eth 7d29ed1d99
chore: move error throwing within `selectPeerForProtocol`
As all callers throw upon undefined result.
2023-02-27 09:48:30 +11:00
fryorcraken.eth c85b113df7
chore: use `this.multicodec` over constant
To enable extraction of common functions.
2023-02-27 09:48:10 +11:00
Danish Arora 6b87ca1c4d
chore: move `random_subset.ts` to `@waku/utils` (#1191) 2023-02-26 12:31:55 -07:00
dependabot[bot] d3156cdefb
chore(deps)(deps-dev): bump @typescript-eslint/eslint-plugin
Bumps [@typescript-eslint/eslint-plugin](https://github.com/typescript-eslint/typescript-eslint/tree/HEAD/packages/eslint-plugin) from 5.52.0 to 5.53.0.
- [Release notes](https://github.com/typescript-eslint/typescript-eslint/releases)
- [Changelog](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/CHANGELOG.md)
- [Commits](https://github.com/typescript-eslint/typescript-eslint/commits/v5.53.0/packages/eslint-plugin)

---
updated-dependencies:
- dependency-name: "@typescript-eslint/eslint-plugin"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-23 16:11:17 +00:00
fryorcraken.eth 8748484048
test: bump go-waku to 0.5.0 and re-enable a CI run against it 2023-02-20 21:32:42 +11:00
Danish Arora 24c24cc27d
feat!: ConnectionManager and KeepAliveManager (#1135)
* 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
2023-02-20 15:30:59 +05:30
dependabot[bot] 6328ce0c39
chore(deps)(deps-dev): bump eslint from 8.33.0 to 8.34.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.33.0 to 8.34.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.33.0...v8.34.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-17 16:09:45 +00:00
Danish Arora 8d8874d2bb
fix: enable all tests (#1184) 2023-02-17 13:59:21 +05:30
Danish Arora 1b41569023
fix: remove initialising peer-exchange while creating a node (#1158)
* 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
2023-02-17 13:27:37 +05:30
dependabot[bot] 431815cf32
chore(deps)(deps-dev): bump cspell from 6.22.0 to 6.26.3
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 6.22.0 to 6.26.3.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v6.22.0...v6.26.3)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-17 01:57:03 +00:00
Danish Arora d8419d9e5c
feat: nwaku interop test for peer-exchange (#1129)
* 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
2023-02-17 01:07:44 +05:30
fryorcraken.eth f66e9835f1
test: nwaku JSON RPC API now uses base64 encoding 2023-02-16 13:45:25 +11:00
dependabot[bot] 5ea04579a2
chore(deps)(deps-dev): bump rollup from 3.14.0 to 3.15.0
Bumps [rollup](https://github.com/rollup/rollup) from 3.14.0 to 3.15.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v3.14.0...v3.15.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-02-14 16:25:26 +00:00
Sasha dcb5908d5b
chore: update note in CHANGELOG and add missing (#1178) 2023-02-14 01:11:40 +01:00
fryorcraken.eth 0fde93c34a
chore: bump ts-loader and install where needed 2023-02-13 10:12:21 +11:00
Sasha f945eb90c4
feat: add mocha to dns-discovery (#1154) 2023-02-11 22:25:11 +01:00
fryorcraken.eth 97c3e8cfe5
chore: bump gh-pages and move it to root package (used by Jenkins) 2023-02-11 15:26:24 +11:00
fryorcraken.eth 2f2d266e81
chore!: bump protons from 5.1.0 to 7.0.2
Notable change: optionality of singular fields and optional values.

See https://github.com/ipfs/protons/releases
2023-02-10 22:26:46 +11:00
fryorcraken.eth d73f2a84db
chore: remove usage of jsdom 2023-02-10 19:44:59 +11:00
fryorcraken.eth f2706c21b6
chore: remove unused test configs 2023-02-10 16:34:52 +11:00
fryorcraken.eth 985dcb6414
chore: bump karma, puppeteer and plugins and install where used 2023-02-10 16:30:18 +11:00
fryorcraken.eth f473e751f7
chore: remove p-timeout from core, bump it in tests 2023-02-10 16:09:06 +11:00
fryorcraken.eth cb6d464021
chore: bump cspell 2023-02-10 16:09:05 +11:00
fryorcraken.eth 1bf740b7b4
chore: bump fast-check 2023-02-10 15:45:41 +11:00
fryorcraken.eth 0eb7ae5781
chore: bump and install @types/chai 2023-02-10 15:37:36 +11:00
fryorcraken.eth c0bbfd32c3
chore: bump and install @types/mocha 2023-02-10 15:32:38 +11:00
fryorcraken.eth 6b4dc1acf2
chore: bump eslint, prettier and related plugins 2023-02-10 15:18:29 +11:00
fryorcraken.eth 938157560f
chore: bump chai
Also install mocha in packages that uses it.
2023-02-10 14:02:02 +11:00
fryorcraken.eth eb3443c4b6
chore: bump mocha
Also install mocha in packages that uses it.
2023-02-10 13:59:44 +11:00
fryorcraken.eth 12d86e6abc
chore!: bump typescript
`module: "nodenext"` has been introduced. Enabling it for NodeJS tests
only.
2023-02-10 13:54:41 +11:00
fryorcraken.eth 8e3795f038
chore: bump rollup dependencies 2023-02-10 13:14:02 +11:00
fryorcraken.eth 88cc76d2b8
chore!: bump all prod dependencies 2023-02-10 13:06:33 +11:00
fryorcraken.eth f31400c8c4
chore: bump @noble dependencies 2023-02-10 11:22:25 +11:00
fryorcraken.eth c3b01751ce
chore: fix doc generation 2023-02-10 08:32:41 +11:00
fryorcraken.eth c2cef9a319
chore: run `npm update` 2023-02-10 08:32:41 +11:00
fryorcraken.eth 4fb3ab191d
chore: bump uint8arraylist and uint8arrays deps 2023-02-10 08:32:40 +11:00
fryorcraken.eth 3343a4acec
chore: bump multiformat deps 2023-02-10 08:32:40 +11:00
fryorcraken.eth a3c5050c1d
chore: fix dependencies for @waku/proto` package 2023-02-10 08:32:32 +11:00
fryorcraken.eth ab735908d3
chore: fix dependencies for @waku/peer-exchange` package 2023-02-09 19:31:12 +11:00
fryorcraken.eth 719ec8e2e7
chore: fix dev dependencies for tests package 2023-02-09 19:31:12 +11:00
fryorcraken.eth b9f526d3ff
chore: fix dev dependencies for `@waku/message-encryption` 2023-02-09 19:31:12 +11:00
fryorcraken.eth 9c3deccd89
chore: fix dependencies for `@waku/interfaces` 2023-02-09 19:31:12 +11:00
fryorcraken.eth 6f3a6d00d8
chore: fix dependencies for `@waku/enr` 2023-02-09 19:31:12 +11:00
fryorcraken.eth 81bb74fa97
chore: fix dependencies for `@waku/dns-discovery` 2023-02-09 19:31:12 +11:00
fryorcraken.eth a4f6d3b98e
chore: fix dependencies for `@waku/create` 2023-02-09 19:31:12 +11:00
fryorcraken.eth 6b8779b3be
chore: fix dependencies for `@waku/core` 2023-02-09 19:31:12 +11:00
fryorcraken.eth 803ae7bd8e
chore!: bump libp2p dependencies 2023-02-09 19:30:59 +11:00
Danish Arora 3b4bc8b25b
chore: update changelog & minor improvements (#1153)
* address comments from https://github.com/waku-org/js-waku/pull/1145

* fix: typedoc

* address comments in https://github.com/waku-org/js-waku/pull/1146#pullrequestreview-1286307508

- update changelog
- change naming for `EciesEncoderOptions` and
`SymmetricEncoderOptions`
2023-02-09 13:15:23 +05:30
Danish Arora 2a7d72be14
chore: decrease delay on the peer-exchange tests (#1141)
* decrease timeouts for peer-exchange tests

* reset dns test timeout
2023-02-08 11:09:52 +05:30
Danish Arora b33306655a
chore: move libp2p and byte utils to a single `utils` package (#1149)
* move libp2p and byte utils to a single `utils`
package

* set package version to 0.0.1
2023-02-06 11:22:36 +05:30
Danish Arora 8910a6d76a
chore: move args for `createEncoder` into non-repeating `options` & fix typedoc (#1146)
* move args for `createEncoder` into non-repeating `options` & fix typedoc

* update tests with new API
2023-02-02 11:37:28 +05:30
Danish Arora 10b3898762
chore: move protocols `CreateOptions` into interfaces (#1145)
* move protocols `CreateOptions` into interfaces and
add possible TODO

* remove: createOptions for PeerExchange

* update test with new API
2023-02-02 08:02:06 +05:30
Danish Arora 11819fc7b1
feat: DNS discovery as default bootstrap discovery (#1114)
* 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
2023-01-31 19:47:46 +05:30
fryorcraken.eth 3aed340cb2
chore: only build what is necessary to test
Script to build enough to run tests locally and in CI (skip bundling).
2023-01-30 20:32:43 +11:00
fryorcraken.eth afa7262604
test: replace nwaku ip with local ip 2023-01-30 20:08:04 +11:00
fryorcraken.eth c8fa8ea20e
chore: remove unnecessary compilation flag for nwaku 2023-01-30 20:08:04 +11:00
fryorcraken.eth 171fd1e6df
fix: randomize the first port tried by portfinder 2023-01-30 20:07:46 +11:00
Danish Arora 380ba6987a
disable tests connecting to test fleet on the CI (#1138) 2023-01-30 11:29:12 +05:30
fryorcraken.eth 372ff6454f
chore: remove `@waku/peer-exchange` dependency
As per its name, `@waku/core` aims to contain, and only contains, the
minimal set of core functionalities needed for a developer to use Waku
in their webapp.

Hence, `@waku/core` should avoid depending on other Waku packages. If a
developer wishes to use functionality from other packages, they should
explicitly import such packages.
2023-01-27 09:08:28 +11:00
fryorcraken.eth a5ff788eed
feat: codec as a property of the protocol implementations
For easy access from `@waku/core` without the need to depend on package
implementing the protocol.
2023-01-27 09:08:02 +11:00
fryorcraken.eth 9a59e9dd64
chore: release @waku/message-encryption@0.0.9 2023-01-25 15:37:52 +11:00
fryorcraken.eth a5a748e2fd
chore: release @waku/dns-discovery@0.0.5 2023-01-25 15:35:12 +11:00
fryorcraken.eth 4e72cf2cff
chore: release @waku/core@0.0.10 2023-01-25 15:29:23 +11:00
fryorcraken.eth 1cd04dbb33
chore: release @waku/peer-exchange@0.0.3 2023-01-25 15:23:10 +11:00
fryorcraken.eth f356ac56fc
chore: release @waku/enr@0.0.5 2023-01-25 15:22:06 +11:00
fryorcraken.eth 6969131346
chore: release @waku/libp2p-utils@0.0.3 2023-01-25 15:19:20 +11:00
Danish Arora cc1d8bb3d5
feat: change DoH DNS provider (#1131)
* 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>
2023-01-24 23:42:21 +05:30
Danish Arora 5fae073ebd
fix: edge case with peer-exchange (#1125)
* address comments

* rename to maxRetries

* use timeout instead of interval

* remove: only from test
2023-01-24 22:50:16 +05:30
weboko 5a56b6432f
add configuration to determine devDependencies, move them in package 2023-01-19 22:49:11 +01:00
weboko 011ec8f1e9
remove unused dependency 2023-01-19 22:31:40 +01:00
weboko 913573a25a
remove no-extraneous-dependencies lint options, move packages to devDep section 2023-01-19 22:14:17 +01:00
Danish Arora 828f8b40e5
add `ephemeral: true` to relay (#1123) 2023-01-19 14:30:23 +05:30
fryorcraken.eth 665dba8f3e
chore: release @waku/proto@0.0.2 2023-01-18 15:36:22 +11:00
fryorcraken.eth ec5118a502
chore: release @waku/peer-exchange@0.0.2 2023-01-18 15:36:20 +11:00
fryorcraken.eth 45f3823ac4
chore: release @waku/message-encryption@0.0.8 2023-01-18 15:28:51 +11:00
fryorcraken.eth 8e9d2c3a0e
chore: release @waku/libp2p-utils@0.0.2 2023-01-18 15:19:49 +11:00
fryorcraken.eth b0c1a8a4a6
chore: release @waku/interfaces@0.0.7 2023-01-18 15:16:00 +11:00
fryorcraken.eth 15a852af57
chore: release @waku/enr@0.0.4 2023-01-18 15:00:56 +11:00
fryorcraken.eth 2b1e3ad602
chore: release @waku/dns-discovery@0.0.4 2023-01-18 14:57:44 +11:00
fryorcraken.eth 3e19f82768
chore: release core@0.0.9 2023-01-18 09:42:58 +11:00
weboko 53dfd84d4c
chore: update changelog 2023-01-11 23:22:26 +01:00
Danish Arora fcd500e045
fix: invoke peer exchange query immediately (#1115)
when the query is set in an interval, it first
gets invoked when the interval time is reached.
refactor: invoke it immmediately, and then set an
interval
2023-01-11 11:11:49 +05:30
Danish Arora 0b083201c6
chore: refactor dns-discovery & add tests (#1084)
* 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
2023-01-06 12:30:06 +05:30
danisharora099 93b12e59c9
fix: failing CI check
add `@waku/peer-exchange` as a dependency to `tests`
2023-01-05 12:54:29 +05:30
weboko bcc7c451ed
Merge branch 'master' of github.com:waku-org/js-waku into weboko/missing-dep 2023-01-04 21:51:37 +01:00
Danish Arora e0e8e655f8
chore: fix peer discovery peer-exchange (#1069)
* 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
2023-01-04 14:35:44 +05:30
weboko a2d79c2551
Merge branch 'master' of github.com:waku-org/js-waku into weboko/missing-dep 2022-12-23 14:39:25 +01:00
Danish Arora d022d8700b
chore: remove unused relay protocol identifier (#1063)
* chore: remove unused relay protocol identifier

* update: changelog
2022-12-23 17:08:41 +05:30
weboko fb9bb35042
fix: move deps from dev deps 2022-12-23 00:24:38 +01:00
weboko ae764bc31e
add missing deps to workspaces 2022-12-23 00:18:16 +01:00
fryorcraken.eth ac4ff5a00a
chore: fix links in docs, treat doc warnings as errors 2022-12-21 16:47:00 +11:00
fryorcraken.eth f48278adce
chore: remove waku dep from @waku/interfaces by defining IEnr
@waku packages are expected to (dev)depend on @waku/interfaces to
implement them. Hence, to avoid possible cyclic (dev)dependency, define
IEnr interface and use it as a type across @waku/packages.
2022-12-21 15:40:34 +11:00
dependabot[bot] abaa29df18
build(deps-dev): bump @types/node from 17.0.45 to 18.11.17
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 17.0.45 to 18.11.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-20 13:57:43 +00:00
fryorcraken.eth 89571ff497
feat!: remove peer exchange from protocols to wait on by default
This is because peer exchange is still experimental and not enabled
on all prod fleets.

The issue is that we could be connected to a remote peer with relay/
filter/lightpush yet never resolve because peer exchange is missing.

This also shows the limit of this function logic which should be
addressed as we dive deeper in peer management.
2022-12-20 23:00:30 +11:00
fryorcraken.eth bff9b857ec
fix: export `Encoder` and `Decoder` types
Enables API consumer to use the types.
2022-12-20 16:11:41 +11:00
fryorcraken.eth d234c4df76
chore: release @waku/create@0.0.6 2022-12-19 16:58:30 +11:00
fryorcraken.eth 1f003e7691
chore: release @waku/message-encryption@0.0.7 2022-12-19 16:56:40 +11:00
fryorcraken.eth b060e88c27
chore: release @waku/core@0.0.8 2022-12-19 16:54:22 +11:00
fryorcraken.eth 75c8e2be8d
fix: incorrect `proto` import 2022-12-19 16:27:26 +11:00
fryorcraken.eth e292855742
fix: missing dependencies 2022-12-19 16:26:56 +11:00
fryorcraken.eth e0fd4433e7
fix: remove invalid re-export 2022-12-19 16:16:07 +11:00
fryorcraken.eth 803a0b4a12
fix: missing dependency declarations 2022-12-16 12:48:36 +11:00
fryorcraken.eth 541056abfe
chore: release @waku/message-encryption@0.0.6 2022-12-16 12:28:40 +11:00
fryorcraken.eth 36327c9222
fix: add `typesVersions` so import works with `moduleResolution: node` 2022-12-16 12:10:14 +11:00
fryorcraken.eth b828903ef0
chore: release @waku/create@0.0.5 2022-12-15 14:51:45 +11:00
fryorcraken.eth c4647d58c6
chore: release @waku/message-encryption@0.0.5 2022-12-15 14:50:20 +11:00
fryorcraken.eth e5c1e20681
chore: release @waku/dns-discovery@0.0.3 2022-12-15 14:48:55 +11:00
fryorcraken.eth 3312c6134a
chore: release @waku/core@0.0.7 2022-12-15 14:47:14 +11:00
fryorcraken.eth de1643be61
chore: release @waku/interfaces@0.0.6 2022-12-15 14:43:15 +11:00
fryorcraken.eth 01981dc184
chore: release @waku/enr@0.0.3 2022-12-15 14:41:30 +11:00
fryorcraken.eth 63f6316b42
chore: release @waku/libp2p-utils@0.0.1 2022-12-15 14:37:56 +11:00
fryorcraken.eth edf5d438cb
test: remove `--nat` option when starting nwaku 2022-12-15 13:54:07 +11:00
fryorcraken.eth a640e2c940
refactor: remove dupe code 2022-12-13 15:23:39 +11:00
dependabot[bot] 872c9cd0df
build(deps-dev): bump cspell from 5.21.2 to 6.17.0
Bumps [cspell](https://github.com/streetsidesoftware/cspell) from 5.21.2 to 6.17.0.
- [Release notes](https://github.com/streetsidesoftware/cspell/releases)
- [Changelog](https://github.com/streetsidesoftware/cspell/blob/main/CHANGELOG.md)
- [Commits](https://github.com/streetsidesoftware/cspell/compare/v5.21.2...v6.17.0)

---
updated-dependencies:
- dependency-name: cspell
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-13 13:46:02 +11:00
fryorcraken.eth 9ac92ef99d
test: use LightNode interface 2022-12-13 10:58:07 +11:00
fryorcraken.eth c6b86a33bc
doc: update changelogs 2022-12-12 22:36:14 +11:00
fryorcraken.eth f743cfd1ca
chore: rename node interfaces to include `Node` in name
Also rename node with only relay to `RelayNode`.
2022-12-12 22:36:14 +11:00
fryorcraken.eth d946e443ad
refactor: remove `Waku` from protocol names
This is redundant with the context (waku package).
2022-12-12 22:36:13 +11:00
fryorcraken.eth 574f3ee80f
refactor: remove `waku_` from module names
This is redundant with the context (waku package).
2022-12-12 22:36:13 +11:00
fryorcraken.eth 53af8994bd
feat: added `I` prefix to protocols interfaces
This will enable the remove of `Waku` prefix on all protocol
implementations, which is redundant due to the context.
2022-12-12 22:36:09 +11:00
fryorcraken.eth 8f01a453f7
test: usage of `DecodedMessage` class is preferred
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.
2022-12-12 22:13:47 +11:00
fryorcraken.eth cc691e26ce
feat: added `I` prefix to message/codec interfaces
To make it easier to differentiate with their implementations.
2022-12-12 22:13:46 +11:00
fryorcraken.eth a7c4bb9cbf
refactor: split interface definition in separate files 2022-12-12 22:13:45 +11:00
Danish Arora d6de62a391
chore: remove relay as default when starting nwaku for tests (#1044)
* chore: redeploy

* remove: relay as default for nwaku

* address: comments

* remove relay as default and add where needed

* Update packages/tests/tests/light_push.node.spec.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
2022-12-12 11:08:08 +05:30
Danish Arora eecdb6aeeb
chore: upgrade to node 18 (#1061)
* 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
2022-12-12 10:52:17 +05:30
Danish Arora 6e4ff0f2b8
fix: revert timeout on test (#1059) 2022-12-07 20:37:10 +05:30
Danish Arora 0ca7fd790c
feat!: implement peer exchange (#1027)
* wip -- yet to test

* update: draft

* wip

* support passing flags manually to nwaku node

* refactor peer-exchange test

* switch response from uint8array to ENR

* rm: unnecesary logs

* implement clas

* fix: for loop

* init-wip: directories

* setup: new package & fix circular deps

* bind a response handler

* wip: refactor & update test

* test logs

* wip code - debugging

* address: comments

* Update packages/core/src/lib/waku_peer_exchange/peer_discovery.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* Update packages/core/src/lib/waku_peer_exchange/peer_discovery.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* address: comments

* address: comments

* address: comments

* address: comments

* address: comments

* fix: test build

* refactor

* fix: build

* comply with API

* numPeers: use number instead of bigint

* fix: build

* Update packages/peer-exchange/package.json

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* Update packages/peer-exchange/src/waku_peer_exchange.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* Update packages/peer-exchange/src/waku_peer_exchange.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* Update packages/peer-exchange/src/waku_peer_exchange.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* address: comments, add eslint config

* Update packages/peer-exchange/.eslintrc.cjs

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* Update packages/peer-exchange/src/index.ts

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* address comments

* test works with test fleet

* rm: only for px test => run all tests

* fix: tests

* reorder packages for build, and fix imports

* remove: px test doesnt work with local nodes

* chore: move proto into a separate package

* fix: proto dir

* fix: build

* fix: ci

* add: index for proto

* fix: ci

* Update packages/proto/package.json

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

* address comments

* chore: run failing test with higher timeout

* chore: run failing test with higher timeout

* fix: ci

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
2022-12-07 11:35:30 +05:30
Danish Arora 56009d3b26
chore: move proto into a separate package (#1057)
* chore: move proto into a separate package

* fix: proto dir

* fix: build

* fix: ci

* add: index for proto

* fix: ci

* Update packages/proto/package.json

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>

Co-authored-by: fryorcraken.eth <110212804+fryorcraken@users.noreply.github.com>
2022-12-07 10:19:40 +05:30
Danish Arora 03e00225bd
chore: move libp2p utils from @waku/core to new package (#1056)
* add: libp2p-utils

* address: comments
2022-12-06 15:46:10 +05:30
fryorcraken.eth 80d7215e15
doc: `createEncoder` and `createDecoder` 2022-12-05 16:05:20 +11:00
fryorcraken.eth 84c477984f
fix: remove `ephemeral` argument for `Decoder` 2022-12-05 16:05:20 +11:00
fryorcraken.eth 9cd1759a06
doc: update changelogs 2022-12-05 16:05:20 +11:00
fryorcraken.eth a4ddb45af1
chore: do not use `Partial` when not needed 2022-12-05 15:14:51 +11:00
fryorcraken.eth 6121aa78d7
doc: add readme for @waku/message-encryption 2022-12-05 15:14:51 +11:00
fryorcraken.eth 33ed43c068
feat: `waitForRemotePeer` can now be directly imported from `@waku/core` 2022-12-05 15:14:51 +11:00
fryorcraken.eth f7fabec8b3
feat: easy import by having an export map for each type of encryption 2022-12-05 15:14:17 +11:00
fryorcraken.eth 563b66eab5
refactor: separate symmetric and asymmetric encoders 2022-12-05 09:34:17 +11:00
fryorcraken.eth 1d727b2bc0
refactor: extract 26/WAKU-PAYLOAD related function to waku_payload.ts 2022-12-05 09:34:17 +11:00
fryorcraken.eth e65e0a0a80
refactor: move module that define cryptographic operations to crypto/
This is to prepare the split of encoder/decoder/message definition
from index.ts.
2022-12-05 09:34:17 +11:00
fryorcraken.eth e8efd5e962
feat!: export user functions from package root
`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`.
2022-12-05 09:34:17 +11:00
fryorcraken.eth ad15f861c3
feat!: hide `Decoder`/`Encoder` classes to user
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.
2022-12-05 09:34:17 +11:00
fryorcraken.eth 0f5bef78d1
feat: remove V0 suffix from Decoder/Encoder 2022-12-05 09:34:17 +11:00
Jakub Sokołowski e0c738c092
ci: fix builds broken by moving to packages/core
Broken by:
https://github.com/waku-org/js-waku/commit/b975943e

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-02 11:44:52 +01:00
fryorcraken.eth 88c6ec6ef4
chore: add '.js' extensions to local import
As per ESM standard.
2022-12-02 15:54:30 +11:00
fryorcraken.eth 2dddaa193a
chore: merge tsconfig
No need to duplicate the config.
2022-12-02 15:54:30 +11:00
danisharora099 1314930765
fix: store 2022-11-22 23:03:31 +05:30
Danish Arora 2215e44985
Merge branch 'master' into danisharora/improve-cursor-api 2022-11-21 17:56:18 +05:30
danisharora099 36a01c3c30
address comments 2022-11-21 13:20:21 +05:30
fryorcraken.eth 2ecb761ea7
feat: add `@multiformats/multiaddr` as peer dep
This dep often has breakings changes on type and is used by several
APIs. Declaring as an optional peer dependency will hopefully help the
user know what version to install.
2022-11-21 11:02:39 +11:00
fryorcraken.eth 2a0b06f361
test: use `createLightNode` instead of a full node
As full node was only necessary due to an issue nwaku v0.11.

Ref: https://github.com/status-im/nwaku/pull/1090
2022-11-21 10:52:33 +11:00
dependabot[bot] 62f300ce81
build(deps): bump uuid from 8.3.2 to 9.0.0
Bumps [uuid](https://github.com/uuidjs/uuid) from 8.3.2 to 9.0.0.
- [Release notes](https://github.com/uuidjs/uuid/releases)
- [Changelog](https://github.com/uuidjs/uuid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/uuidjs/uuid/compare/v8.3.2...v9.0.0)

---
updated-dependencies:
- dependency-name: uuid
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-18 15:58:49 +00:00