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

test: add test for iroh-dns-server with mainline #2250

Merged
merged 7 commits into from
Apr 29, 2024

Conversation

Frando
Copy link
Member

@Frando Frando commented Apr 29, 2024

Description

This adds a test for iroh-dns-server with mainline fallback resolution.
Needed to rework the config structure a little to not duplicate code too much.

Breaking Changes

are documented in #2188

Notes & open questions

Change checklist

  • Self-review.
  • Documentation updates if relevant.
  • Tests if relevant.
  • All breaking changes documented.

@Frando Frando force-pushed the iroh-dns-mainline-test branch from 8a6343a to 19fb463 Compare April 29, 2024 09:35
@Frando Frando requested a review from rklaehn April 29, 2024 09:35
/// Set custom bootstrap nodes.
///
/// If empty this will use the default bittorrent mainline bootstrap nodes as defined by pkarr.
pub bootstrap: Vec<SocketAddr>,
Copy link
Contributor

Choose a reason for hiding this comment

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

OK, glad we got something else to put into the mainline config section...

Self { enabled: false }
Self {
enabled: false,
bootstrap: vec![],
Copy link
Contributor

Choose a reason for hiding this comment

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

Empty means default? How do you get the default mainline bootstrap nodes?

Copy link
Contributor

Choose a reason for hiding this comment

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

I know it is annoying, but can we make this an enum Default/Custom instead of using empty as "use the defaults"?

Copy link
Member Author

Choose a reason for hiding this comment

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

Changed it to an enum. Not in the config struct, because I think it makes the toml structure more complicated, but in the option passed to the store.

} else {
let bootstrap = bootstrap
.iter()
.map(|addr| addr.to_string())
Copy link
Contributor

Choose a reason for hiding this comment

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

Can these be URLs, or why does pkarr require strings here? Hopefully that can be changed in pkarr 2.0

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point. I misread the pkarr source - these can be either "ip:port" or "domain:port" strings. changed to use strings on our end as well.

@Frando Frando merged commit 64d4d6a into iroh-dns-mainline Apr 29, 2024
19 of 20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants