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: node discovery via DNS #2045

Merged
merged 80 commits into from
Apr 15, 2024
Merged
Show file tree
Hide file tree
Changes from 60 commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
09a7973
feat: combine discovery services
Frando Mar 4, 2024
a088781
refactor: impl from iterator for combined discovery
Frando Mar 6, 2024
42f1f3b
tests: add tests for combined discovery
Frando Mar 6, 2024
8bd2ea3
chore: fmt
Frando Mar 6, 2024
6008c66
chore: fix doc link
Frando Mar 6, 2024
5a0fd66
chore: clippy
Frando Mar 6, 2024
4c81604
refactor: better controls for discovery tasks
Frando Mar 7, 2024
19e9ae7
cleanup
Frando Mar 7, 2024
2db91c8
docs and cleanup
Frando Mar 7, 2024
ed52ced
more docs
Frando Mar 7, 2024
25c847b
chore: clippy & doclinks
Frando Mar 7, 2024
b5f9728
better tracing logs
Frando Mar 7, 2024
adbc41f
fix instrumentation
Frando Mar 7, 2024
9d62fea
refactor: do not require static lifetime on discovery streams
Frando Mar 7, 2024
b5d5d55
chore: clippy
Frando Mar 7, 2024
b380b19
rename to ConcurrentDiscovery
Frando Mar 7, 2024
9383427
chore: doc link
Frando Mar 7, 2024
646de44
feat: add iroh-dns crate
Frando Feb 27, 2024
ae3e0e7
feat: discover nodes over DNS by default
Frando Feb 27, 2024
89fffc9
fix: only republish if derp url changes
Frando Feb 27, 2024
8f26558
fix(iroh-dns): do not log secret key
Frando Feb 27, 2024
58ad6f5
feat: allow to connect via node id only
Frando Feb 27, 2024
04611f2
fix: feature flags
Frando Feb 27, 2024
6ee0f97
chore: fmt
Frando Feb 27, 2024
aa4cd94
chore: fmt and clippy
Frando Feb 27, 2024
3839856
chore: remove obsolete files
Frando Feb 27, 2024
d257c0b
refactor: use z32 encoding for pkarr domain names
Frando Feb 28, 2024
b4b85de
refactor: cleanup
Frando Mar 4, 2024
1389d44
refactor: move iroh-dns into iroh-net, add docs, cleanup
Frando Mar 7, 2024
785c79b
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 18, 2024
9f21f40
fix: make NodeDiscoveryConfig pub
Frando Mar 18, 2024
44c5cc6
chore: fmt
Frando Mar 18, 2024
be08b9b
cleanup: better namings
Frando Mar 18, 2024
e0012b5
fix Cargo.lock after rebase
Frando Mar 18, 2024
d339b5c
Merge branch 'main' into feat/dns
Frando Mar 18, 2024
6c17aea
Merge branch 'main' into feat/dns
Frando Mar 21, 2024
0c47f28
tests: add tests for DNS discovery
Frando Mar 21, 2024
3531449
refactor: cleanup dns tests
Frando Mar 21, 2024
1932c5c
chore: clippy
Frando Mar 21, 2024
443285b
refactor: make pkarr relay client reusable for derper
Frando Mar 21, 2024
c819958
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 21, 2024
e519f8d
rebase fixup
Frando Mar 21, 2024
7ccae59
chore: clippy & doclinks
Frando Mar 21, 2024
c3e8f0a
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 25, 2024
f798084
refactor: use DNS resolver from MagicEndpoint
Frando Mar 25, 2024
a7f8ea0
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 25, 2024
ce48317
tests: add end-to-end test
Frando Mar 25, 2024
d1465f7
fixup
Frando Mar 25, 2024
c7cab05
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 25, 2024
536e3bd
cleanup
Frando Mar 25, 2024
9e5759d
cleanup
Frando Mar 25, 2024
180a651
chore: clippy
Frando Mar 25, 2024
877de7e
chore: clippy
Frando Mar 25, 2024
5d9df01
tests: improve dns discovery tests
Frando Mar 25, 2024
428f811
tests: increase timeout because windows is slow
Frando Mar 26, 2024
a21eadf
remove debug leftovers
Frando Mar 26, 2024
e12180a
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Mar 26, 2024
c3252b6
Update iroh-net/src/discovery/dns.rs
Frando Mar 28, 2024
3d14417
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Apr 2, 2024
7b3a0e6
Merge branch 'main' into feat/dns
Arqu Apr 2, 2024
e43d008
refactor(dns): use one DNS record per attribute (#2150)
Frando Apr 8, 2024
ed0b6a4
change: move from testdns.iroh.link to dns.iroh.link
Frando Apr 8, 2024
1ee96ba
refactor: renames for clarity
Frando Apr 8, 2024
b30358d
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Apr 8, 2024
6ac8954
chore: fmt
Frando Apr 8, 2024
4524018
tests: cleanups and improvements
Frando Apr 3, 2024
2e136a5
feat: republishing in pkarr publisher
Frando Apr 3, 2024
c47d0dc
fix: improve pkarr publisher
Frando Apr 8, 2024
a172e6c
fix: magic endpoint constructor in tests
Frando Apr 8, 2024
bc5c05b
fix: pkarr republishing
Frando Apr 8, 2024
15740c9
deps: axum
Frando Apr 8, 2024
134aeb4
fix: remove online test, will hit rate limits
Frando Apr 8, 2024
3f2f543
cleanups
Frando Apr 8, 2024
bf92de5
refactor: make PkarrRelayClient public
Frando Apr 10, 2024
cb2454e
feat: make attribute parsing generic and pub
Frando Apr 10, 2024
b857a13
Merge remote-tracking branch 'origin/main' into feat/dns
Frando Apr 10, 2024
e6f56d3
feat: pkarr relay with DNS server (#2167)
Frando Apr 11, 2024
f58dcce
Merge branch 'main' into feat/dns
rklaehn Apr 12, 2024
7b84d45
Merge branch 'main' into feat/dns
rklaehn Apr 12, 2024
22a01d1
chore: fix iroh-dns-server cargo.toml
Frando Apr 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
131 changes: 126 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion iroh-base/src/node_addr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use anyhow::Context;
use serde::{Deserialize, Serialize};
use url::Url;

use crate::key::PublicKey;
use crate::key::{NodeId, PublicKey};

/// A peer and it's addressing information.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
Expand Down Expand Up @@ -63,6 +63,12 @@ impl From<(PublicKey, Option<RelayUrl>, &[SocketAddr])> for NodeAddr {
}
}

impl From<NodeId> for NodeAddr {
fn from(node_id: NodeId) -> Self {
NodeAddr::new(node_id)
}
}

/// Addressing information to connect to a peer.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Default)]
pub struct AddrInfo {
Expand Down Expand Up @@ -142,6 +148,12 @@ impl FromStr for RelayUrl {
}
}

impl From<RelayUrl> for Url {
fn from(value: RelayUrl) -> Self {
value.0
}
}

/// Dereference to the wrapped [`Url`].
///
/// Note that [`DerefMut`] is not implemented on purpose, so this type has more flexibility
Expand Down
5 changes: 0 additions & 5 deletions iroh-cli/src/commands/blob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,6 @@ impl BlobCommands {
return Err(anyhow::anyhow!("The input arguments refer to a collection of blobs and output is set to STDOUT. Only single blobs may be passed in this case."));
}

if node_addr.info.is_empty() {
return Err(anyhow::anyhow!(
"no relay url provided and no direct addresses provided"
));
}
Copy link
Contributor

Choose a reason for hiding this comment

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

👍

let tag = match tag {
Some(tag) => SetTagOption::Named(Tag::from(tag)),
None => SetTagOption::Auto,
Expand Down
6 changes: 5 additions & 1 deletion iroh-net/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ flume = "0.11"
futures = "0.3.25"
governor = "0.6.0"
hex = "0.4.3"
hickory-proto = "0.24.0"
hickory-resolver = "0.24.0"
hostname = "0.3.1"
http = "1"
http-body-util = "0.1.0"
Expand All @@ -40,6 +42,7 @@ libc = "0.2.139"
num_enum = "0.7"
once_cell = "1.18.0"
parking_lot = "0.12.1"
pkarr = { version = "1.1.3", default-features = false, features = ["async", "relay"] }
postcard = { version = "1", default-features = false, features = ["alloc", "use-std", "experimental-derive"] }
quinn = "0.10"
quinn-proto = "0.10.5"
Expand All @@ -65,12 +68,12 @@ tokio-rustls = { version = "0.24" }
tokio-rustls-acme = { version = "0.2" }
tokio-util = { version = "0.7", features = ["io-util", "io", "codec"] }
tracing = "0.1"
hickory-resolver = "0.24.0"
url = { version = "2.4", features = ["serde"] }
watchable = "1.1.2"
webpki = { package = "rustls-webpki", version = "0.101.4", features = ["std"] }
webpki-roots = "0.25"
x509-parser = "0.15"
z32 = "1.0.3"

# iroh-relay
clap = { version = "4", features = ["derive"], optional = true }
Expand Down Expand Up @@ -106,6 +109,7 @@ tokio = { version = "1", features = ["io-util", "sync", "rt", "net", "fs", "macr
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
iroh-test = { path = "../iroh-test" }
serde_json = "1.0.107"
axum = "0.7.4"

[[bench]]
name = "key"
Expand Down
Loading
Loading