Skip to content

Commit f9e883d

Browse files
authored
refactor(iroh-cli)!: Use blobs and tags cli from iroh-blobs crate (#2942)
## Description <!-- A summary of what this pull request achieves and a rough list of changes. --> ## Breaking Changes <!-- Optional, if there are any breaking changes document them, including how to migrate older code. --> ## Notes & open questions Node: depends on n0-computer/iroh-blobs#14 <!-- Any notes, remarks or open questions you have to make about the PR. --> ## 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.
1 parent 7c19da4 commit f9e883d

File tree

6 files changed

+16
-1277
lines changed

6 files changed

+16
-1277
lines changed

Cargo.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

iroh-cli/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ iroh = { version = "0.28.1", path = "../iroh", features = ["metrics"] }
4444
iroh-gossip = "0.28.1"
4545
iroh-docs = { version = "0.28.0", features = ["rpc"]}
4646
iroh-metrics = { version = "0.28.0" }
47+
iroh-blobs = { version = "0.28.1", features = ["cli"] }
4748
parking_lot = "0.12.1"
4849
pkarr = { version = "2.2.0", default-features = false }
4950
portable-atomic = "1"

iroh-cli/src/commands.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,20 @@ use std::{
66
use anyhow::{ensure, Context, Result};
77
use clap::Parser;
88
use iroh::client::Iroh;
9+
use iroh_blobs::cli::{BlobAddOptions, BlobSource};
910

10-
use self::{
11-
blobs::{BlobAddOptions, BlobSource},
12-
rpc::RpcCommands,
13-
start::RunType,
14-
};
11+
use self::{rpc::RpcCommands, start::RunType};
1512
use crate::config::{ConsoleEnv, NodeConfig};
1613

1714
pub(crate) mod authors;
18-
pub(crate) mod blobs;
1915
pub(crate) mod console;
2016
pub(crate) mod docs;
2117
pub(crate) mod doctor;
2218
pub(crate) mod gossip;
2319
pub(crate) mod net;
2420
pub(crate) mod rpc;
2521
pub(crate) mod start;
26-
pub(crate) mod tags;
22+
pub(crate) use iroh_blobs::{cli as blobs, cli::tags};
2723

2824
/// iroh is a tool for building distributed apps.
2925
///
@@ -191,7 +187,10 @@ impl Cli {
191187
|client| async move {
192188
match add_command {
193189
None => Ok(()),
194-
Some(command) => command.run(&client).await,
190+
Some(command) => {
191+
let node_addr = client.net().node_addr().await?;
192+
command.run(&client.blobs(), node_addr).await
193+
}
195194
}
196195
},
197196
)

0 commit comments

Comments
 (0)