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: adding waku_dial_peer and get_connected_peers to libwaku #3149

Merged
merged 7 commits into from
Oct 30, 2024

Conversation

gabrielmer
Copy link
Contributor

@gabrielmer gabrielmer commented Oct 25, 2024

Description

Adding new procedures to libwaku to be able to dial peers using a specific protocol and to be able to retrieve the peerIds of all connected nodes

Changes

  • added waku_dial_peer to libwaku
  • added waku_get_connected_peers to libwaku
  • passing missing parameter in waku_dial_peer_by_id
  • allowing to dial peers without specifying a protocol

Issue

#3076

Copy link

github-actions bot commented Oct 25, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:3149

Built from af29e62

@gabrielmer gabrielmer changed the title feat: adding waku_dial_peer to libwaku feat: adding waku_dial_peer and get_connected_peers to libwaku Oct 28, 2024
@gabrielmer gabrielmer marked this pull request as ready for review October 28, 2024 11:07
Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! For it! Just added a couple of comments that I hope you find useful

of DIAL_PEER_BY_ID:
let peerId = PeerId.init($self[].peerId).valueOr:
error "DIAL_PEER_BY_ID failed", error = $error
return err($error)
let conn = await waku.node.peerManager.dialPeer(peerId, $self[].protocol)
if conn.isNone():
if $self[].protocol != "" and conn.isNone():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How we should handle the condition of $self[].protocol == "" and conn.isNone()?
The same question applies to the DIAL_PEER operation:)

waku/node/peer_manager/peer_manager.nim Outdated Show resolved Hide resolved
@gabrielmer gabrielmer marked this pull request as draft October 30, 2024 09:28
@gabrielmer gabrielmer marked this pull request as ready for review October 30, 2024 12:44
Copy link
Collaborator

@Ivansete-status Ivansete-status left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for it! 💯

@gabrielmer gabrielmer merged commit 507b1fc into master Oct 30, 2024
9 of 11 checks passed
@gabrielmer gabrielmer deleted the feat-add-dialpeer-to-libwaku branch October 30, 2024 14:26
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.

3 participants