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

chore: libwaku retrieve my enr and adapt golang example #2987

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

Ivansete-status
Copy link
Collaborator

Description

Add new "get ENR" method available in libwaku

Changes

  • new waku_get_my_enr available in libwaku
  • adapt Golang example to use the new waku_get_my_enr function

Copy link

github-actions bot commented Aug 19, 2024

You can find the image built from this PR at

quay.io/wakuorg/nwaku-pr:2987

Built from 2333ec7

Copy link
Contributor

@NagyZoltanPeter NagyZoltanPeter left a comment

Choose a reason for hiding this comment

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

LGTM, added one little naming observation...

C.cGoWakuGetMyENR(self.ctx, resp)

if C.getRet(resp) == C.RET_OK {
var listenAddresses = C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a bit misleading to call it listenAddresses and not the ENR.
I remember that is different also in /debug/info API result.

Copy link
Contributor

@gabrielmer gabrielmer left a comment

Choose a reason for hiding this comment

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

LGTM, thank you! Added just a tiny question

Comment on lines 460 to 461
var listenAddresses = C.GoStringN(C.getMyCharPtr(resp), C.int(C.getMyCharLen(resp)))
return listenAddresses, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we change the variable name to enr or something like that? looks like we kept the same variable name after copy-pasting from WakuListenAddresses()

Copy link
Contributor

Choose a reason for hiding this comment

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

ooh @NagyZoltanPeter added the same comment a few minutes before I did lol. Nice!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thank you so much guys ! I'll change that

@Ivansete-status Ivansete-status merged commit 1ff9f1d into master Aug 22, 2024
9 of 11 checks passed
@Ivansete-status Ivansete-status deleted the get-node-enr-libwaku branch August 22, 2024 10:01
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