Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: expose peerId and protocols from WakuNode #2166

Merged
merged 3 commits into from
Oct 8, 2024

Conversation

weboko
Copy link
Collaborator

@weboko weboko commented Oct 8, 2024

Problem

Previously I met people that requested to expose additional information from WakuNode object.
It is also used in dogfooding app and whenever we use it - we need to access through libp2p.

Solution

Abstract libp2p away.

@weboko weboko requested a review from a team as a code owner October 8, 2024 00:03
@weboko weboko changed the base branch from master to weboko/implement-connect October 8, 2024 00:03
Copy link

github-actions bot commented Oct 8, 2024

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
Waku node 84.23 KB (+0.74% 🔺) 1.7 s (+0.74% 🔺) 4.6 s (+225.07% 🔺) 6.3 s
Waku Simple Light Node 135.19 KB (-0.2% 🔽) 2.8 s (-0.2% 🔽) 6.2 s (+49.6% 🔺) 8.9 s
ECIES encryption 22.94 KB (0%) 459 ms (0%) 1.3 s (-26.78% 🔽) 1.8 s
Symmetric encryption 22.39 KB (0%) 448 ms (0%) 1.1 s (-20.68% 🔽) 1.5 s
DNS discovery 72.28 KB (0%) 1.5 s (0%) 3.5 s (+18.32% 🔺) 4.9 s
Peer Exchange discovery 73.88 KB (0%) 1.5 s (0%) 2.3 s (-41.36% 🔽) 3.8 s
Local Peer Cache Discovery 67.63 KB (0%) 1.4 s (0%) 2.9 s (+68.24% 🔺) 4.2 s
Privacy preserving protocols 75.71 KB (+1.19% 🔺) 1.6 s (+1.19% 🔺) 2.3 s (-40.71% 🔽) 3.8 s
Waku Filter 78.58 KB (-0.12% 🔽) 1.6 s (-0.12% 🔽) 2.4 s (-19.71% 🔽) 4 s
Waku LightPush 76.83 KB (-0.08% 🔽) 1.6 s (-0.08% 🔽) 3.1 s (-16.25% 🔽) 4.7 s
History retrieval protocols 76.09 KB (+0.17% 🔺) 1.6 s (+0.17% 🔺) 2.8 s (-19.37% 🔽) 4.3 s
Deterministic Message Hashing 7.38 KB (0%) 148 ms (0%) 262 ms (-22.31% 🔽) 409 ms

@weboko weboko merged commit 027a1d1 into weboko/implement-connect Oct 8, 2024
11 of 12 checks passed
@weboko weboko deleted the weboko/wakunode-api branch October 8, 2024 11:14
weboko added a commit that referenced this pull request Oct 8, 2024
…#2161)

* fix comment of default number of peers

* export default number of peers from base protocol sdk

* rename to light_push, move class to separate file

* move waitForRemotePeer to sdk package

* add todo to move waitForGossipSubPeerInMesh into @waku/relay

* clean up waitForRemotePeer, split metadata await from event and optimise, decouple from protocol implementations

* simplify and rename ILightPush interface

* use only connected peers in light push based on connections instead of peer renewal mechanism

* improve readability of result processing in light push

* fix check & update tests

* address tests, add new test cases, fix racing condition in StreamManager

* use libp2p.getPeers

* feat: confirm metadata and protocols needed in waitForRemotePeer

* rely on passed protocols and fallback to mounted

* add I prefix to Waku interface

* implement waku.connect method

* add docs to IWaku interface

* remove export and usage of waitForRemotePeer

* move wait for remote peer related to Realy out of @waku/sdk

* change tests to use new API

* fix linting

* update size limit

* rename .connect to .waitForPeer

* export waitForRemotePeer and mark as deprecated

* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer (#2163)

* feat: add mocha tests to @waku/sdk and cover waitForRemotePeer

* add waitForRemote UTs

* remove junk

* feat: expose peerId and protocols from WakuNode (#2166)

* chore: expose peerId and protocols from WakuNode

* remove unused method

* move to private method

* rename to waitForPeers

* up test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants