diff --git a/crates/subspace-node/Cargo.toml b/crates/subspace-node/Cargo.toml index 145423f694e..ee77e2c54a6 100644 --- a/crates/subspace-node/Cargo.toml +++ b/crates/subspace-node/Cargo.toml @@ -43,7 +43,6 @@ sc-consensus-subspace = { version = "0.1.0", path = "../sc-consensus-subspace" } sc-subspace-chain-specs = { version = "0.1.0", path = "../sc-subspace-chain-specs" } sc-executor = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c" } sc-service = { version = "0.10.0-dev", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c", default-features = false } -sc-storage-monitor = { version = "0.1.0", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c", default-features = false } sc-telemetry = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c" } sc-tracing = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c" } sc-utils = { version = "4.0.0-dev", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c" } @@ -64,6 +63,10 @@ system-domain-runtime = { version = "0.1.0", path = "../../domains/runtime/syste thiserror = "1.0.38" tokio = "1.25.0" +# TODO: Convert to regular dependency once https://github.com/paritytech/substrate/pull/13466 is in our fork +[target.'cfg(unix)'.dependencies] +sc-storage-monitor = { version = "0.1.0", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c", default-features = false } + [build-dependencies] substrate-build-script-utils = { version = "3.0.0", git = "https://github.com/subspace/substrate", rev = "50fdd4fd3853b15c019fc96a0eb7dbffe1ff042c" } diff --git a/crates/subspace-node/src/bin/subspace-node.rs b/crates/subspace-node/src/bin/subspace-node.rs index 8f0bc21c58b..46b856943f8 100644 --- a/crates/subspace-node/src/bin/subspace-node.rs +++ b/crates/subspace-node/src/bin/subspace-node.rs @@ -24,6 +24,7 @@ use sc_cli::{ChainSpec, CliConfiguration, SubstrateCli}; use sc_consensus_slots::SlotProportion; use sc_executor::NativeExecutionDispatch; use sc_service::PartialComponents; +#[cfg(unix)] use sc_storage_monitor::StorageMonitorService; use sc_subspace_chain_specs::ExecutionChainSpec; use sc_utils::mpsc::tracing_unbounded; @@ -362,6 +363,7 @@ fn main() -> Result<(), Error> { set_default_ss58_version(&runner.config().chain_spec); runner.run_node_until_exit(|primary_chain_config| async move { let tokio_handle = primary_chain_config.tokio_handle.clone(); + #[cfg(unix)] let database_source = primary_chain_config.database.clone(); let maybe_system_domain_chain_spec = primary_chain_config @@ -477,6 +479,7 @@ fn main() -> Result<(), Error> { })? }; + #[cfg(unix)] StorageMonitorService::try_spawn( cli.storage_monitor, database_source, diff --git a/crates/subspace-node/src/lib.rs b/crates/subspace-node/src/lib.rs index 36453ad486a..add37171185 100644 --- a/crates/subspace-node/src/lib.rs +++ b/crates/subspace-node/src/lib.rs @@ -29,6 +29,7 @@ use clap::Parser; use sc_cli::{RunCmd, SubstrateCli}; use sc_executor::{NativeExecutionDispatch, RuntimeVersion}; use sc_service::ChainSpec; +#[cfg(unix)] use sc_storage_monitor::StorageMonitorParams; use sc_subspace_chain_specs::ConsensusChainSpec; use sc_telemetry::serde_json; @@ -224,6 +225,7 @@ pub struct Cli { pub domain_args: Vec, /// Parameters used to create the storage monitor. + #[cfg(unix)] #[clap(flatten)] pub storage_monitor: StorageMonitorParams, }