diff --git a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs index ce23388eaf..fddd65de33 100644 --- a/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs +++ b/crates/subspace-farmer/src/bin/subspace-farmer/commands/farm.rs @@ -1,7 +1,6 @@ mod dsn; use crate::commands::farm::dsn::configure_dsn; -use crate::commands::shared::print_disk_farm_info; use crate::utils::shutdown_signal; use anyhow::anyhow; use bytesize::ByteSize; @@ -493,7 +492,17 @@ where }; if !no_info { - print_disk_farm_info(disk_farm.directory, disk_farm_index); + let info = single_disk_farm.info(); + println!("Single disk farm {disk_farm_index}:"); + println!(" ID: {}", info.id()); + println!(" Genesis hash: 0x{}", hex::encode(info.genesis_hash())); + println!(" Public key: 0x{}", hex::encode(info.public_key())); + println!( + " Allocated space: {} ({})", + bytesize::to_string(info.allocated_space(), true), + bytesize::to_string(info.allocated_space(), false) + ); + println!(" Directory: {}", disk_farm.directory.display()); } single_disk_farms.push(single_disk_farm); diff --git a/crates/subspace-farmer/src/single_disk_farm.rs b/crates/subspace-farmer/src/single_disk_farm.rs index 13b50477b4..4f22220089 100644 --- a/crates/subspace-farmer/src/single_disk_farm.rs +++ b/crates/subspace-farmer/src/single_disk_farm.rs @@ -223,6 +223,7 @@ impl SingleDiskFarmInfo { } /// Summary of single disk farm for presentational purposes +#[derive(Debug)] pub enum SingleDiskFarmSummary { /// Farm was found and read successfully Found { @@ -1312,6 +1313,11 @@ impl SingleDiskFarm { self.single_disk_farm_info.id() } + /// Info of this farm + pub fn info(&self) -> &SingleDiskFarmInfo { + &self.single_disk_farm_info + } + /// Number of sectors in this farm pub fn total_sectors_count(&self) -> SectorIndex { self.total_sectors_count