Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge subspace-executor executable into subspace-node #366

Merged
merged 7 commits into from
Apr 17, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/subspace-node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ include = [
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
cirrus-node = { version = "0.1.0", path = "../../cumulus/node" }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add it to runtime-benchmarks feature below?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should, but runtime-benchmarks is actually unused at present. It also reminds me that we might also want to actually integrate try-runtime feature for convenient runtime upgrade testing.

clap = { version = "3.1.8", features = ["derive"] }
frame-benchmarking-cli = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", rev = "c4f3d028621edb293d2c423516221aa396f76a2d" }
frame-support = { version = "4.0.0-dev", git = "https://github.com/paritytech/substrate", rev = "c4f3d028621edb293d2c423516221aa396f76a2d" }
Expand Down
8 changes: 8 additions & 0 deletions crates/subspace-node/src/bin/subspace-node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ fn set_default_ss58_version<C: AsRef<dyn ChainSpec>>(chain_spec: C) {
fn main() -> std::result::Result<(), Error> {
let cli = Cli::from_args();

if !cli.secondarychain_args.is_empty() {
println!("Unimplemented: Run an executor with an embedded primary full node");
return Ok(());
}

match &cli.subcommand {
Some(Subcommand::Key(cmd)) => cmd.run(&cli)?,
Some(Subcommand::BuildSpec(cmd)) => {
Expand Down Expand Up @@ -222,6 +227,9 @@ fn main() -> std::result::Result<(), Error> {
}
})?;
}
Some(Subcommand::Executor(_cmd)) => {
unimplemented!("Executor subcommand");
}
None => {
let runner = cli.create_runner(&cli.run.base)?;
set_default_ss58_version(&runner.config().chain_spec);
Expand Down
13 changes: 13 additions & 0 deletions crates/subspace-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ pub enum Subcommand {
/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),

/// Run executor sub-commands.
#[clap(subcommand)]
Executor(cirrus_node::cli::Subcommand),

/// Sub-commands concerned with benchmarking.
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
Expand All @@ -94,6 +98,11 @@ pub struct RunCmd {

/// Subspace Cli.
#[derive(Debug, Parser)]
#[clap(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
/// Various utility commands.
#[clap(subcommand)]
Expand All @@ -102,6 +111,10 @@ pub struct Cli {
/// Run a node.
#[clap(flatten)]
pub run: RunCmd,

/// Secondarychain arguments
#[clap(raw = true)]
pub secondarychain_args: Vec<String>,
}

impl SubstrateCli for Cli {
Expand Down