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: support setting DiscV5 and DNS-discovery in libwaku #2455

Closed
Ivansete-status opened this issue Feb 19, 2024 · 1 comment · Fixed by #2711
Closed

chore: support setting DiscV5 and DNS-discovery in libwaku #2455

Ivansete-status opened this issue Feb 19, 2024 · 1 comment · Fixed by #2711
Assignees

Comments

@Ivansete-status
Copy link
Collaborator

Ivansete-status commented Feb 19, 2024

Background

Epic: #2420

Details

This should be straightforward to achieve once the #2452 is completed. The basic idea is that the libwaku user should be able to set up DiscV5 and/or DNS-discovery the node managed by libwaku.

It is interesting to create an example where this can be tested. cwaku_example.c can serve as an inspiration.

@richard-ramos
Copy link
Member

In go-waku bindings we had the following configuration items and functions available. Perhaps we could consider adding them to nwaku:

discv5: boolean, determine whether discv5 should be enabled or not
discV5BootstrapNodes: array of enrs
discV5UDPPort: int containing the udp port. Using 0 would automatically find an open port

dnsDiscoveryURLs: list of enrtrees. These would automatically be used as bootstrap nodes, and also added to the peerstore
dnsDiscoveryNameServer: list of nameservers to use to resolve the enrtree
extern char* waku_dns_discovery(char* url, char* nameserver, int timeoutMs)

Returns a list of multiaddress given a url to a DNS discoverable ENR tree

Parameters
    char* url: URL containing a discoverable ENR tree
    char* nameserver: The nameserver to resolve the ENR tree url. If NULL or empty, it will automatically use the default system dns.
    int timeoutMs: Timeout value in milliseconds to execute the call. If the function execution takes longer than this value, the execution will be canceled and an error returned. Use 0 for no timeout.
extern char* waku_discv5_update_bootnodes(char* bootnodes)

Update the bootnode list used for discovering new peers via DiscoveryV5

Parameters
    The bootnodes param should contain a JSON array containing the bootnode ENRs i.e. `["enr:...", "enr:..."]`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants