-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcommand.rs
More file actions
60 lines (50 loc) · 1.33 KB
/
command.rs
File metadata and controls
60 lines (50 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
use crate::chain_spec;
use crate::cli::Cli;
use crate::service;
use sc_cli::SubstrateCli;
impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
"Datdot Node"
}
fn impl_version() -> &'static str {
env!("SUBSTRATE_CLI_IMPL_VERSION")
}
fn description() -> &'static str {
env!("CARGO_PKG_DESCRIPTION")
}
fn author() -> &'static str {
env!("CARGO_PKG_AUTHORS")
}
fn support_url() -> &'static str {
"https://github.com/playproject-io/datdot-substrate/issues"
}
fn copyright_start_year() -> i32 {
2019
}
fn executable_name() -> &'static str {
env!("CARGO_PKG_NAME")
}
fn load_spec(&self, id: &str) -> Result<Box<dyn sc_service::ChainSpec>, String> {
Ok(match id {
"dev" => Box::new(chain_spec::dev_config()),
"" | "local" => Box::new(chain_spec::local_testnet_config()),
path => Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
)?),
})
}
}
/// Parse and run command line arguments
pub fn run() -> sc_cli::Result<()> {
let cli = Cli::from_args();
match &cli.subcommand {
Some(subcommand) => {
let runner = cli.create_runner(subcommand)?;
runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config)))
}
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node(service::new_light, service::new_full, runtime::VERSION)
}
}
}