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: support dns for p2p node #304

Merged
merged 4 commits into from
Apr 12, 2023
Merged

feat: support dns for p2p node #304

merged 4 commits into from
Apr 12, 2023

Conversation

joeylichang
Copy link
Contributor

@joeylichang joeylichang commented Apr 12, 2023

Description

Support DNS for p2p bootstrap node

Rationale

Use for k8s ALB and NLB

Example

N/A

Changes

Notable changes:

N/A

@joeylichang joeylichang added the r4r Ready for review label Apr 12, 2023
Copy link
Collaborator

@sysvm sysvm left a comment

Choose a reason for hiding this comment

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

LGTM

if net.ParseIP(host) == nil {
hosts, err := net.LookupHost(host)
if err != nil {
err = fmt.Errorf("failed to parser bootstrap '%s' domain", boot)
Copy link
Collaborator

Choose a reason for hiding this comment

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

fix parser to parse

Copy link
Collaborator

Choose a reason for hiding this comment

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

why use '%s' not %s?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

return peersID, addrs, err
}
if len(hosts) == 0 {
err = fmt.Errorf("failed to parser bootstrap '%s' domain, the empty ip list", boot)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

highlight

break
}
if net.ParseIP(host) == nil {
err = fmt.Errorf("failed to parser bootstrap '%s' domain, no usable ip", boot)
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Contributor Author

Choose a reason for hiding this comment

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

highlight

@will-2012 will-2012 merged commit bfb3877 into develop Apr 12, 2023
@joeylichang joeylichang deleted the feat-p2pdns branch April 12, 2023 13:35
BarryTong65 pushed a commit that referenced this pull request Apr 14, 2023
* feat: support dns for p2p node

* fix: ut error

* fix: only support ipv4

* fix: cr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
r4r Ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants