Commit Graph

61 Commits

Author SHA1 Message Date
Danish Arora 199f6ab2ff
feat: local discovery (#1811)
* 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
2024-02-16 20:06:27 +05:30
Arseniy Klempner 1bc1eb5091
feat: add function to validate autoshard content topic 2023-11-15 22:28:25 -08:00
Danish Arora 3166a5135e
chore!: change all instances of `PubSubTopic` to `PubsubTopic` (#1703)
* rename all PubSub patterns

* feat: forbid identifiers with camelcase pubSub (#1709)

---------

Co-authored-by: Arseniy Klempner <adklempner@gmail.com>
2023-11-14 18:52:52 +03:00
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 29d83786b2
chore: update org (#1632)
* update org

* update other images as well

* small fix
2023-10-03 16:11:41 +05:30
Danish Arora a3c45b6e1a
feat(static-sharding)!: allow multiple pubSubTopics (#1586)
* `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>
2023-09-27 15:28:07 +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
Danish Arora d483644a4b
chore!: remove filter v1 (#1433)
* 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
2023-07-26 11:30:48 +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 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
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
Sasha 4d7b3e39e6
fix: prettier and cspell ignore CHANGELOG (#1235) 2023-03-13 23:40:41 +01: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
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
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
fryorcraken.eth 795e3b67b5
chore: update dictionary 2022-12-13 13:46:03 +11:00
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 f59f00b7e9
test: fix spelling 2022-09-26 10:02:06 +10:00
fryorcraken.eth b2c7e4185f
feat: make message encoding more generic 2022-09-20 12:23:01 +10:00
fryorcraken.eth ade8277c00
chore: fix spelling 2022-09-13 13:37:52 +10:00
Franck Royer b9aef19a47
fix: new spellings 2022-07-20 12:44:47 +10:00
Felicio Mununga 793699ac73
update .cspell.json 2022-05-29 18:32:18 +02:00
Franck Royer 95d1ef4b4a
Ignore imports when check spell 2022-05-19 15:17:18 +10:00
Franck dc90279905
Rename nim-waku to nwaku 2022-04-06 12:39:18 +10:00
Franck R b257885204
test: Fix flackiness (#474) 2022-02-01 12:54:54 +11:00
Franck R c7fe1bd789
Rename DappConnect to Waku Connect (#427) 2022-01-24 15:00:11 +11:00
Franck Royer e47335f4c0
Implement DNS Discovery and ENR tree 2022-01-13 15:38:22 +11:00
F 07d2c81d1d
Example: rename file and point to docs website
- GitHub automatically print README.md file in folder.
- Point to docs website that contains some external examples.
2021-12-13 11:38:12 +11:00
F 01c66f7e89
Add ENR with multiaddr
Imported from https://github.com/D4nte/discv5/pull/1
Replaced bcrypto backend with secp256k1.
2021-12-06 14:29:08 +11:00
Franck Royer 137c1dfcc0
Add jswaku 2021-10-13 08:09:55 +11:00
Franck Royer e0d199ef14
Add word 2021-08-30 15:13:03 +10:00
Franck Royer 3f95934250
Replace deprecated package for libp2p-noise 2021-08-19 11:26:34 +10:00
Franck Royer 140791cc91
Provide easy way to bootstrap when creating Waku node 2021-08-13 16:18:00 +10:00
Franck Royer f801538f71
Spelling 2021-08-13 15:58:40 +10:00
Franck Royer 5076fa553c
Enable spelling for guides and fix it 2021-08-09 12:36:53 +10:00
Franck Royer a5e91b3269
Update discussion channels 2021-07-28 17:12:03 +10:00
Franck Royer ea33b9cd8a
Rename `keepAlive` option to `pingKeepAlive`
In preparation for introducing a relay keep alive feature.
2021-07-27 16:06:57 +10:00
Franck Royer f95d9aec3c
Add version 1 support to waku relay, test decryption against nim-waku 2021-07-09 15:50:16 +10:00
Franck Royer 34e6ac5247
Add version 1 support to WakuMessage 2021-07-09 15:50:15 +10:00
Franck Royer f2a2233c77
Add encrypt/decrypt asymmetric 2021-07-09 15:50:15 +10:00
Franck Royer f97dc4de81
Implement Waku Message Version 1 encoding and signature 2021-07-09 14:49:09 +10:00
Franck Royer 4284be142f
Fix spelling 2021-06-29 16:21:32 +10:00
Franck Royer 3a7c7a1bb7
Fix spelling 2021-06-22 13:21:23 +10:00
Franck Royer ca74f7f87a
Update chat content topic to new testnet value
Resolves #180
2021-05-28 14:32:05 +10:00
Franck Royer de3aea626a
Implement Light Push protocol 2021-05-19 12:29:29 +10:00
Franck Royer eed1d39ec5 Clarify content topic format 2021-05-14 09:14:08 +00:00
Franck Royer 0dc2ee8d40
Use status fleet instead of jdev 2021-05-14 15:49:35 +10:00
Franck Royer 0ffde9cf42
Add documentation to the readme 2021-05-12 13:35:25 +10:00
Franck Royer 40fd7ff365
Use Typedoc comment style 2021-05-11 09:06:22 +10:00
Franck Royer 94ff4ca40f
Use one cspell file for all project inc examples 2021-05-05 16:40:23 +10:00