diff --git a/crates/orchestrator/src/errors.rs b/crates/orchestrator/src/errors.rs index 8a65c09e40fd109a71b5463b74ac23a490f640dc..539afc7e5d760150f6056cf5c9b9476467112c44 100644 --- a/crates/orchestrator/src/errors.rs +++ b/crates/orchestrator/src/errors.rs @@ -18,7 +18,7 @@ pub enum OrchestratorError { InvariantError(&'static str), #[error("Global network spawn timeout: {0} secs")] GlobalTimeOut(u32), - #[error("Generator error")] + #[error("Generator error: {0}")] GeneratorError(#[from] generators::errors::GeneratorError), #[error("Provider error")] ProviderError(#[from] ProviderError), diff --git a/crates/orchestrator/src/generators/command.rs b/crates/orchestrator/src/generators/command.rs index 1adb49031a74e205f9682df15a7482dc5db0aca1..977c4e4de569ac5247793c3c54df4ad11f53a33c 100644 --- a/crates/orchestrator/src/generators/command.rs +++ b/crates/orchestrator/src/generators/command.rs @@ -99,7 +99,10 @@ pub fn generate_for_cumulus_node( Arg::Option(..) => false, }) { (collator_args, full_node_args) = args.split_at(index); - }; + } else { + // Assume args are those specified for collator only + collator_args = args; + } } // set our base path diff --git a/crates/orchestrator/src/generators/errors.rs b/crates/orchestrator/src/generators/errors.rs index 5da0ec75d1c33a01bdad24067a4d2596ef0813c3..77152acb647c370781cedfbe859304ee8e7c7bee 100644 --- a/crates/orchestrator/src/generators/errors.rs +++ b/crates/orchestrator/src/generators/errors.rs @@ -9,7 +9,7 @@ pub enum GeneratorError { PortGeneration(u16, String), #[error("Chain-spec build error: {0}")] ChainSpecGeneration(String), - #[error("Provider error")] + #[error("Provider error: {0}")] ProviderError(#[from] ProviderError), #[error("FileSystem error")] FileSystemError(#[from] FileSystemError), diff --git a/crates/orchestrator/src/generators/para_artifact.rs b/crates/orchestrator/src/generators/para_artifact.rs index 80176bad5a88ac344233aae3fb9fd75430685071..ebcb459c9fac6123ff716365f07128ef0282f5cb 100644 --- a/crates/orchestrator/src/generators/para_artifact.rs +++ b/crates/orchestrator/src/generators/para_artifact.rs @@ -69,6 +69,7 @@ impl ParaArtifact { ParaArtifactBuildOption::Path(path) => { let t = TransferedFile::new(PathBuf::from(path), artifact_path.as_ref().into()); scoped_fs.copy_files(vec![&t]).await?; + self.artifact_path = Some(artifact_path.as_ref().into()); }, ParaArtifactBuildOption::Command(cmd) => { let generate_subcmd = match self.artifact_type { diff --git a/crates/orchestrator/src/network.rs b/crates/orchestrator/src/network.rs index 6f4d3bbc2eab3d64377b791432d3cda53a8c4488..27f3d0866bee6f7290d8ab764b57168d9032ab7a 100644 --- a/crates/orchestrator/src/network.rs +++ b/crates/orchestrator/src/network.rs @@ -77,6 +77,10 @@ impl<T: FileSystem> Network<T> { self.ns.name().to_string() } + pub fn base_dir(&self) -> Option<&str> { + self.ns.base_dir().to_str() + } + pub fn relaychain(&self) -> &Relaychain { &self.relay } @@ -562,7 +566,7 @@ impl<T: FileSystem> Network<T> { self.parachains.get(¶_id) } - pub(crate) fn parachains(&self) -> Vec<&Parachain> { + pub fn parachains(&self) -> Vec<&Parachain> { self.parachains.values().collect() } diff --git a/crates/orchestrator/src/network/node.rs b/crates/orchestrator/src/network/node.rs index caa60b0b2664c9eb24f8f02fbd69180566bfcc49..b00666f008665262f67379373ee60975775dcfb2 100644 --- a/crates/orchestrator/src/network/node.rs +++ b/crates/orchestrator/src/network/node.rs @@ -42,6 +42,14 @@ impl NetworkNode { } } + pub fn name(&self) -> &str { + &self.name + } + + pub fn args(&self) -> Vec<&str> { + self.inner.args() + } + pub fn spec(&self) -> &NodeSpec { &self.spec } diff --git a/crates/orchestrator/src/network/parachain.rs b/crates/orchestrator/src/network/parachain.rs index e5a8e77aefa93a915c5c11fe02ea978209f230a4..3033599dac144dd34ce2c6a961231ce86f9439f1 100644 --- a/crates/orchestrator/src/network/parachain.rs +++ b/crates/orchestrator/src/network/parachain.rs @@ -167,6 +167,18 @@ impl Parachain { Ok(()) } + + pub fn para_id(&self) -> u32 { + self.para_id + } + + pub fn chain_id(&self) -> Option<&str> { + self.chain_id.as_deref() + } + + pub fn collators(&self) -> Vec<&NetworkNode> { + self.collators.iter().collect() + } } #[cfg(test)] diff --git a/crates/orchestrator/src/network/relaychain.rs b/crates/orchestrator/src/network/relaychain.rs index 356f84c2a060f06b1c4ad0792260ebad7ee165e4..be8f2bbe3746d199ce81da4e6c29ed8bb5f476cc 100644 --- a/crates/orchestrator/src/network/relaychain.rs +++ b/crates/orchestrator/src/network/relaychain.rs @@ -24,4 +24,8 @@ impl Relaychain { pub fn chain(&self) -> &str { &self.chain } + + pub fn nodes(&self) -> Vec<&NetworkNode> { + self.nodes.iter().collect() + } } diff --git a/crates/orchestrator/src/network_spec/node.rs b/crates/orchestrator/src/network_spec/node.rs index 3c315d6d42a806805d6eda3136675e0ccd57f82f..46d8bb103b7b781e922a36c42d2eda57a00b2975 100644 --- a/crates/orchestrator/src/network_spec/node.rs +++ b/crates/orchestrator/src/network_spec/node.rs @@ -275,4 +275,8 @@ impl NodeSpec { )) .contains(arg.as_ref()) } + + pub fn command(&self) -> &str { + self.command.as_str() + } }