* Update to rc6.

* Update runtime.

* Update node to rc6.

* Update client.

* Fix node.

* Add option to enable telemetry.
This commit is contained in:
David Craven
2020-07-27 09:53:02 +02:00
committed by GitHub
parent cd6b8f43f1
commit e6f3a82f99
12 changed files with 583 additions and 467 deletions
+44 -23
View File
@@ -18,42 +18,45 @@ use crate::{
chain_spec,
cli::Cli,
service,
service::new_full_params,
};
use sc_cli::SubstrateCli;
use sc_cli::{
ChainSpec,
Role,
RuntimeVersion,
SubstrateCli,
};
use sc_service::ServiceParams;
impl SubstrateCli for Cli {
fn impl_name() -> &'static str {
"Substrate Node"
fn impl_name() -> String {
"Substrate Node".into()
}
fn impl_version() -> &'static str {
env!("SUBSTRATE_CLI_IMPL_VERSION")
fn impl_version() -> String {
env!("SUBSTRATE_CLI_IMPL_VERSION").into()
}
fn description() -> &'static str {
env!("CARGO_PKG_DESCRIPTION")
fn description() -> String {
env!("CARGO_PKG_DESCRIPTION").into()
}
fn author() -> &'static str {
env!("CARGO_PKG_AUTHORS")
fn author() -> String {
env!("CARGO_PKG_AUTHORS").into()
}
fn support_url() -> &'static str {
"support.anonymous.an"
fn support_url() -> String {
"support.anonymous.an".into()
}
fn copyright_start_year() -> i32 {
2017
}
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::development_config()),
"" | "local" => Box::new(chain_spec::local_testnet_config()),
"dev" => Box::new(chain_spec::development_config()?),
"" | "local" => Box::new(chain_spec::local_testnet_config()?),
path => {
Box::new(chain_spec::ChainSpec::from_json_file(
std::path::PathBuf::from(path),
@@ -61,6 +64,10 @@ impl SubstrateCli for Cli {
}
})
}
fn native_runtime_version(_: &Box<dyn ChainSpec>) -> &'static RuntimeVersion {
&test_node_runtime::VERSION
}
}
/// Parse and run command line arguments
@@ -70,15 +77,29 @@ pub fn run() -> sc_cli::Result<()> {
match &cli.subcommand {
Some(subcommand) => {
let runner = cli.create_runner(subcommand)?;
runner.run_subcommand(subcommand, |config| Ok(new_full_start!(config).0))
runner.run_subcommand(subcommand, |config| {
let (
ServiceParams {
client,
backend,
task_manager,
import_queue,
..
},
..,
) = new_full_params(config)?;
Ok((client, backend, import_queue, task_manager))
})
}
None => {
let runner = cli.create_runner(&cli.run)?;
runner.run_node(
service::new_light,
service::new_full,
test_node_runtime::VERSION,
)
runner.run_node_until_exit(|config| {
match config.role {
Role::Light => service::new_light(config),
_ => service::new_full(config),
}
.map(|service| service.0)
})
}
}
}