Commit Graph

54 Commits

Author SHA1 Message Date
Danish Arora 9fe04d85f3
chore: use `pubsubTopic`/`pubsubTopics` across the codebase (#1653)
* chore: change all references of pubSubTopic to pubsubTopic

* change references of pubSubTopics to pubsubTopics

* flag words in cspell
2023-10-16 12:52:32 +05:30
Florin Barbu b96c3bd3e1
chore: disable paralles runs locally (#1662)
* disable paralles runs locally

* add logs

* add readme info about local execution
2023-10-13 17:32:28 +03:00
Florin Barbu 347cbfa08a
chore: run tests in parallel (#1655)
* run tests in parallel

* small fixes

* small fixes

* fix setup of nodes

* fix relay tests

* fix Static Sharding: Running Nodes tests

* try with 5 threads

* try with 6 threads

* use startWithRetries as default start

* revert to 6

* set 10 jobs

* revert to back to 6

* add CI info in readme
2023-10-13 12:36:43 +03:00
fbarbu15 aa93a441d5
use loadash instead of custom function 2023-10-10 09:15:36 +03:00
fbarbu15 c9389e3d07
improve teardown nodes 2023-10-10 09:03:44 +03:00
fbarbu15 00cb2c6b28
Merge branch 'master' of https://github.com/waku-org/js-waku into chore/new-store-tests 2023-10-04 11:57:40 +03:00
Florin Barbu 29d83786b2
chore: update org (#1632)
* update org

* update other images as well

* small fix
2023-10-03 16:11:41 +05:30
fbarbu15 9371477069
new store tests 2023-10-03 10:05:32 +03:00
fbarbu15 2ff19c7901
merge master 2023-10-02 13:11:12 +03:00
Florin Barbu f1d8d6097f
chore(static sharding): add tests for multiple pubsub topics (#1624)
* new tests for static sharding

* store tests

* small fixes after ci run

* small fixes after ci run

* small fixes after ci run

* multiple pubsubtopics on nwaku node
2023-10-02 15:07:00 +05:30
fbarbu15 f307e9b6c6
intermediat commit 2023-09-29 14:03:43 +03:00
Simon-Pierre Vivier 6fa106aa7f
fix: subscription RPC & added test subscriptions (#1587)
Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
2023-09-26 00:24:49 +02:00
Florin Barbu 9ab4e86f19
chore: bump nwaku version to 0.20 (#1591) 2023-09-22 02:55:49 +02:00
Simon-Pierre Vivier 7905aa478b
fix: explicit nwaku subscriptions in tests (#1572)
* Nwaku subscriptions explicit in tests

* Subscription before each & renaming

* Fix
2023-09-19 22:45:27 +02:00
fbarbu15 e284c78701
chore: new lightpush tests (#1571)
* new lightpush tests

* fixes after CI run

* split tests into 2 files

* small fix

* address code review comments

* small fix after CI run

---------

Co-authored-by: Danish Arora <35004822+danisharora099@users.noreply.github.com>
2023-09-19 15:51:03 +05:30
fbarbu15 b42601d156
chore: new filter tests (#1552)
* add bulk of tests

* refactored and improved tests

* add more comments

* fixes after CI run

* split filter tests into mulitple suites

* split filter tests into mulitple suites
2023-09-12 23:31:35 +02:00
fbarbu15 617622c3ec manually triggerr ci with custom nim node image 2023-08-24 14:03:44 +03:00
Danish Arora 7a805a277a
bump nwaku to 0.19 (#1485) 2023-08-16 23:23:37 +05:30
Danish Arora 87717981eb
chore: upgrade libp2p and related deps (#1482)
* chore: update noise

* update: package.lock

* update: @chainsafe/libp2p-gossipsub

* rm unwanted libp2p interface deps & bump up libp2p

* refactor code for new deps

* update: new package.lock

* setup prettier, refactor eslint  and rm trailing commas

* update package.lock

* fix build

* import type for interface

* fix imports for merge

* update typedoc exports

* add: CustomEvent import

* use new libp2p interface

* add aegir as dev dep for tests
2023-08-16 20:18:13 +05:30
Sasha 51f9261a16
chore: update dependencies (#1460)
* update to latest prettier

* fix with prettier: added trailing comma

* remove deps from test package, add sinon types, fix type hack in a test, update esling prettier config

* update typescript eslint plugins

* update package-locks
2023-08-11 15:14:02 +02:00
Sasha 75808ffc9d
chore: test agains Fleets and add optional tests (#1432)
* test Prod and Test fleets in CI

* compute predefined nodes once

* remove async

* add optional test step

* fix command
2023-08-07 10:27:16 +02:00
Danish Arora 376bcf2a0a
chore: new eslint rules (#1416)
* add new eslint rules

* remove eslint scripts for build-utils

* refactor all files to fix breaking changes with new rules

* add a basic eslintrc for build-utils

* test

* fix more linting errors

* test

* update package.lock

* update stopping container

* update px node spec

* enable tests

* fix: conn manager events

* fix: peer exchange

* increase timeout on px test
2023-07-24 16:04:24 +05:30
fryorcraken.eth 008bb6ca2e
test: `topics` arg renamed to `topic` in nwaku 2023-06-30 15:14:01 +10:00
fryorcraken.eth 3b1f0adb43
test: bump nwaku to v0.18.0 2023-06-30 15:14:00 +10:00
Danish Arora b2caf10d03
fix: go-waku interop tests (#1378)
* fix interop for filter v1

* change to better desc
2023-05-23 23:45:08 +05:30
Danish Arora 6e2d1d674a
update nwaku image in run-tests script (#1375) 2023-05-23 16:53:30 +05:30
Danish Arora 8d0e647966
feat!: filter v2 (#1332)
* 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>
2023-05-23 16:06:46 +05:30
Danish Arora 94e1abdd65
chore: upgrade nwaku to v0.17.0 (#1364) 2023-05-19 01:52:06 +05:30
Danish Arora 60304bc908
chore: rename file to node.ts (#1363)
* rename file to node.ts

* update imports
2023-05-19 01:38:43 +05:30
Danish Arora d80042fc47
fix: failing px tests for nwaku master (#1355)
* 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
2023-05-19 01:28:49 +05:30
Sasha 72f97d4545
feat: add 1MB restriction to LightPush and Relay (#1351)
* add 1MB restriction to LightPush and Relay

* fix condition

* improve lightPush test

* update test

* add isomorphic-webcrypto

* import module

* add errors to SendResult and tests

* fix lint
2023-05-17 23:40:52 +02:00
Danish Arora b7d4b675bd
fix: peer-exchange go-waku interop (#1300)
* merge: master

* fix: CI

* use: js script instead of shell script to run precheck and mocha

* check for peer id instead of ws multiaddr in response
2023-04-19 13:07:29 +05:30
Danish Arora dc3774c0ed
feat: use nwaku/go-waku docker images instead of building binaries (#1259)
* 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`
2023-04-17 10:29:36 +05:30
fryorcraken.eth de0a2e595c
test: bump nwaku to v0.16.0 2023-03-23 14:51:10 +11:00
fryorcraken.eth 3a92355543
chore: code improvement
- 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
2023-03-21 08:59:25 +11:00
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
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 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
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
fryorcraken.eth afa7262604
test: replace nwaku ip with local ip 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
fryorcraken.eth edf5d438cb
test: remove `--nat` option when starting nwaku 2022-12-15 13:54:07 +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 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
fryorcraken.eth 88c6ec6ef4
chore: add '.js' extensions to local import
As per ESM standard.
2022-12-02 15:54:30 +11:00
fryorcraken.eth a8ab53a6c5
tests: Use in-memory DB instead of sqlite (in memory) 2022-11-17 14:28:01 +11:00
fryorcraken.eth 909a8f94c2
test: set nwaku logs to trace
Can now be done via command line argument.
2022-11-17 12:07:53 +11:00
fryorcraken.eth 862a33f239
test: reduce log verbosity 2022-11-15 22:01:27 +11:00