Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 22 additions & 2 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@ pub trait Platform {
NodeIdentifier::Geth => new_geth_node(context),
NodeIdentifier::LighthouseGeth => new_lighthouse_geth_node(context),
NodeIdentifier::ReviveDevNode => new_revive_dev_node(context),
NodeIdentifier::Zombienet => new_zombienet_node(context),
NodeIdentifier::Zombienet => {
#[cfg(unix)]
{
new_zombienet_node(context)
}
#[cfg(not(unix))]
{
anyhow::bail!("Zombienet is not supported on this platform")
}
}
NodeIdentifier::PolkadotOmniNode => new_polkadot_omni_node(context),
}
}
Expand All @@ -87,7 +96,16 @@ pub trait Platform {
NodeIdentifier::Geth => export_geth_genesis(context),
NodeIdentifier::LighthouseGeth => export_lighthouse_geth_genesis(context),
NodeIdentifier::ReviveDevNode => export_revive_dev_node_genesis(context),
NodeIdentifier::Zombienet => export_zombienet_genesis(context),
NodeIdentifier::Zombienet => {
#[cfg(unix)]
{
export_zombienet_genesis(context)
}
#[cfg(not(unix))]
{
anyhow::bail!("Zombienet is not supported on this platform")
}
}
NodeIdentifier::PolkadotOmniNode => export_polkadot_omni_node_genesis(context),
}
}
Expand Down Expand Up @@ -372,6 +390,7 @@ fn new_revive_dev_node(
}))
}

#[cfg(unix)]
fn new_zombienet_node(
context: Context,
) -> Result<JoinHandle<Result<Box<dyn NodeApi + Send + Sync>>>> {
Expand Down Expand Up @@ -438,6 +457,7 @@ fn export_revive_dev_node_genesis(context: Context) -> Result<serde_json::Value>
SubstrateNode::node_genesis(revive_dev_node_path, export_chainspec_command, &wallet)
}

#[cfg(unix)]
fn export_zombienet_genesis(context: Context) -> Result<serde_json::Value> {
let polkadot_parachain_path = context.as_polkadot_parachain_configuration().path.as_path();
let wallet = context.as_wallet_configuration().wallet();
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ fn main() -> anyhow::Result<()> {
let mut context = Context::try_parse()?;
context.update_for_profile();

// The `tokio-debug` variant returns `()`, but the default variant returns a `WorkerGuard`
// that must be held until `main` exits to keep the non-blocking tracing writer alive.
#[allow(clippy::let_unit_value)]
let _guard = setup_tracing(context.as_log_configuration())?;

Expand Down
3 changes: 3 additions & 0 deletions crates/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ serde_yaml_ng = { workspace = true }
sp-core = { workspace = true }
sp-runtime = { workspace = true }
subxt = { workspace = true }
# Zombienet uses `std::os::unix` which prevents compiling retester on Windows.
# For running pre-link-only contract compilations on Windows, Zombienet is gated.
[target.'cfg(unix)'.dependencies]
zombienet-sdk = { workspace = true }

[dev-dependencies]
Expand Down
2 changes: 2 additions & 0 deletions crates/node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ pub mod prelude {
pub use crate::node_implementations::lighthouse_geth::LighthouseGethNode;
pub use crate::node_implementations::polkadot_omni_node::PolkadotOmnichainNode;
pub use crate::node_implementations::substrate::SubstrateNode;
#[cfg(unix)]
pub use crate::node_implementations::zombienet::ZombienetNode;
pub use crate::provider_utils::*;
}
Expand Down Expand Up @@ -81,6 +82,7 @@ pub(crate) mod internal_prelude {
pub use toml;
pub use tower::{Layer, Service};
pub use tracing::*;
#[cfg(unix)]
pub use zombienet_sdk::{LocalFileSystem, NetworkConfig, NetworkConfigExt};

pub use revive_common::EVMVersion;
Expand Down
2 changes: 2 additions & 0 deletions crates/node/src/node_implementations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@ pub mod geth;
pub mod lighthouse_geth;
pub mod polkadot_omni_node;
pub mod substrate;
#[cfg(unix)]
pub mod zombienet;
#[cfg(unix)]
pub(crate) mod zombienet_core_assignment;
Loading