Skip to content

Commit d1578ee

Browse files
refactor(iroh-net)!: Rename the local-swarm-discovery feature to discovery-local-network (#2634)
## Description Rename the local-swarm-discovery feature to discovery-local-network to be consistent with discovery-pkarr-dht ## Breaking Changes renames the `local-swarm-discovery` feature flag in iroh-net to `discovery-local-network` ## Notes & open questions Naming is hard. Pretty sure the ff should start with `discovery-`, but should it be `discovery-local-network` or `discovery-local-swarm` or just -local...? ## Change checklist - [ ] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [ ] All breaking changes documented. Co-authored-by: Friedel Ziegelmayer <[email protected]>
1 parent 134dbee commit d1578ee

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

iroh-net/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ iroh-relay = [
146146
]
147147
metrics = ["iroh-metrics/metrics"]
148148
test-utils = ["iroh-relay"]
149-
local-swarm-discovery = ["dep:swarm-discovery", "dep:tokio-stream"]
149+
discovery-local-network = ["dep:swarm-discovery", "dep:tokio-stream"]
150150
discovery-pkarr-dht = ["pkarr/dht", "dep:genawaiter"]
151151

152152
[[bin]]

iroh-net/src/discovery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use crate::{AddrInfo, Endpoint, NodeId};
5151

5252
pub mod dns;
5353

54-
#[cfg(feature = "local-swarm-discovery")]
54+
#[cfg(feature = "discovery-local-network")]
5555
pub mod local_swarm_discovery;
5656
pub mod pkarr;
5757

iroh/Cargo.toml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ iroh-blobs = { version = "0.22.0", path = "../iroh-blobs", features = ["download
3030
iroh-base = { version = "0.22.0", path = "../iroh-base", features = ["key"] }
3131
iroh-io = { version = "0.6.0", features = ["stats"] }
3232
iroh-metrics = { version = "0.22.0", path = "../iroh-metrics", optional = true }
33-
iroh-net = { version = "0.22.0", path = "../iroh-net", features = ["local-swarm-discovery"] }
33+
iroh-net = { version = "0.22.0", path = "../iroh-net", features = ["discovery-local-network"] }
3434
nested_enum_utils = "0.1.0"
3535
num_cpus = { version = "1.15.0" }
3636
portable-atomic = "1"
@@ -67,7 +67,8 @@ metrics = ["iroh-metrics", "iroh-blobs/metrics"]
6767
fs-store = ["iroh-blobs/fs-store"]
6868
test = []
6969
examples = ["dep:clap", "dep:indicatif"]
70-
local-swarm-discovery = ["iroh-net/local-swarm-discovery", "examples", "dep:console"]
70+
discovery-local-network = ["iroh-net/discovery-local-network", "examples", "dep:console"]
71+
discovery-pkarr-dht = ["iroh-net/discovery-pkarr-dht"]
7172
test-utils = ["iroh-net/test-utils"]
7273

7374
[dev-dependencies]
@@ -117,4 +118,4 @@ required-features = ["examples"]
117118

118119
[[example]]
119120
name = "local_swarm_discovery"
120-
required-features = ["local-swarm-discovery"]
121+
required-features = ["discovery-local-network"]

iroh/examples/local_swarm_discovery.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
//! Example that runs and iroh node with local node discovery and no relay server
22
//!
33
//! Run the follow command to run the "accept" side, that hosts the content:
4-
//! $ cargo run --example local_swarm_discovery --features="local-swarm-discovery" -- accept [FILE_PATH]
4+
//! $ cargo run --example local_swarm_discovery --features="discovery-local-network" -- accept [FILE_PATH]
55
//! Wait for output that looks like the following:
6-
//! $ cargo run --example local_swarm_discovery --features="local-swarm-discovery" -- connect [NODE_ID] [HASH] -o [FILE_PATH]
6+
//! $ cargo run --example local_swarm_discovery --features="discovery-local-network" -- connect [NODE_ID] [HASH] -o [FILE_PATH]
77
//! Run that command on another machine in the same local network, replacing [FILE_PATH] to the path on which you want to save the transferred content.
88
use std::path::PathBuf;
99

0 commit comments

Comments
 (0)