Commit Graph

2293 Commits

Author SHA1 Message Date
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 a15436d786
Merge pull request #1050 from waku-org/ci/fix-deploy
package.json: set type to module
2022-12-06 10:16:49 +11:00
Jakub Sokołowski 10d0ba400c
package.json: set type to module
Fixes errors like:
```
SyntaxError: Cannot use import statement outside a module
```

Signed-off-by: Jakub Sokołowski <jakub@status.im>
2022-12-05 10:06:59 +01:00
fryorcraken.eth 54397f597a
Merge pull request #1049 from waku-org/feat/api-improvements 2022-12-05 16:41:05 +11:00
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 f80c3ded0f
chore: fix size-limit 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 c7100fb820
Merge pull request #1048 from waku-org/chore/align-tsconfig 2022-12-02 16:07:16 +11: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 e678b84119
chore: use ESM module resolution
Fixes #1039
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
fryorcraken.eth 25f104a769
Merge pull request #1047 from waku-org/chore/remove-lerna 2022-12-02 15:53:23 +11:00
fryorcraken.eth e7a2203bea
chore: ensure all packages are built
Add a check that no package has been forgotten from the `workspace`
property.
2022-12-02 15:44:59 +11:00
fryorcraken.eth 31fe78d5a7
chore: remove lerna
This was a premature optimization of workspace handling.
Lerna tries to be clever and cache build artefact, etc, but the step
to decide what packages to build takes more than 5s.

For now, using workspaces feature of npm.

Note that npm execute scripts in the order of the `workspaces` field of
`package.json`.
2022-12-02 15:44:59 +11:00
fryorcraken.eth 3fb0f364c2
Merge pull request #1046 from waku-org/chore/no-console
chore: make no-console an error
2022-12-02 15:40:17 +11:00
fryorcraken.eth 280d4a60dc
chore: make no-console an error
We use `debug` across the codebase, this ensures no `console.log` slips
in by mistake.
2022-12-02 13:23:57 +11:00
Danish Arora 50c6ea9ea9
Merge pull request #1031 from waku-org/danisharora/improve-cursor-api
feat: improve the cursor API
2022-11-22 23:06:50 +05:30
danisharora099 1314930765
fix: store 2022-11-22 23:03:31 +05:30
danisharora099 b8c5d27a3c
chore: redeploy 2022-11-22 22:53:15 +05:30
danisharora099 9c8d7a5cd4
chore: redeploy 2022-11-22 22:47:04 +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 a85db50abd
Merge pull request #1029 from waku-org/feat/multiaddr-optional-dep 2022-11-21 11:14:02 +11:00
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 5ba874065d
Merge pull request #900 from waku-org/filter 2022-11-21 10:57:52 +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
fryorcraken.eth 613cfea023
Merge pull request #985 from waku-org/dependabot/npm_and_yarn/uuid-9.0.0 2022-11-21 10:37:02 +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
fryorcraken.eth 110f15d16b
Merge pull request #1028 from waku-org/release/core-0.0.6 2022-11-18 13:49:24 +11:00
fryorcraken.eth ab861431d5
doc: release core@0.0.6 (changelog) 2022-11-18 13:35:09 +11:00
fryorcraken.eth dfa7c6b107
chore: release core@0.0.6 2022-11-18 13:27:36 +11:00
Danish Arora a3da9f4f9b
Merge pull request #1024 from waku-org/danisharora/cursor-support-store
feat!: support for cursors on store API
2022-11-17 13:07:56 +05:30
danisharora099 9f0493221e
commit package-lock 2022-11-17 13:03:36 +05:30
danisharora099 100eb4c4b4
Merge branch 'master' into danisharora/cursor-support-store 2022-11-17 13:00:48 +05:30