mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 15:41:02 +00:00
Add parachain pallets to rialto runtime (#1053)
* use BABE to author blocks on Rialto (previously: Aura) * removed extra script * use bp_rialto::Moment * fix tests * Babe should control session end * add parachain pallets to Rialto runtime * add parachain pallets to rialto runtime + add parachains inherent data provider to node * remove script again * fmt * allow unlicensed crates * spellcheck * fix compilation
This commit is contained in:
committed by
Bastian Köcher
parent
74024b028c
commit
79143f6ec6
@@ -15,7 +15,6 @@
|
||||
// along with Parity Bridges Common. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use crate::cli::{Cli, Subcommand};
|
||||
use crate::service;
|
||||
use crate::service::new_partial;
|
||||
use rialto_runtime::{Block, RuntimeApi};
|
||||
use sc_cli::{ChainSpec, Role, RuntimeVersion, SubstrateCli};
|
||||
@@ -78,7 +77,7 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
if cfg!(feature = "runtime-benchmarks") {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
|
||||
runner.sync_run(|config| cmd.run::<Block, service::Executor>(config))
|
||||
runner.sync_run(|config| cmd.run::<Block, crate::service::Executor>(config))
|
||||
} else {
|
||||
println!(
|
||||
"Benchmarking wasn't enabled when building the node. \
|
||||
@@ -97,43 +96,43 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
}
|
||||
Some(Subcommand::CheckBlock(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
runner.async_run(|mut config| {
|
||||
let PartialComponents {
|
||||
client,
|
||||
task_manager,
|
||||
import_queue,
|
||||
..
|
||||
} = new_partial(&config)?;
|
||||
} = new_partial(&mut config).map_err(service_error)?;
|
||||
Ok((cmd.run(client, import_queue), task_manager))
|
||||
})
|
||||
}
|
||||
Some(Subcommand::ExportBlocks(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
runner.async_run(|mut config| {
|
||||
let PartialComponents {
|
||||
client, task_manager, ..
|
||||
} = new_partial(&config)?;
|
||||
} = new_partial(&mut config).map_err(service_error)?;
|
||||
Ok((cmd.run(client, config.database), task_manager))
|
||||
})
|
||||
}
|
||||
Some(Subcommand::ExportState(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
runner.async_run(|mut config| {
|
||||
let PartialComponents {
|
||||
client, task_manager, ..
|
||||
} = new_partial(&config)?;
|
||||
} = new_partial(&mut config).map_err(service_error)?;
|
||||
Ok((cmd.run(client, config.chain_spec), task_manager))
|
||||
})
|
||||
}
|
||||
Some(Subcommand::ImportBlocks(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
runner.async_run(|mut config| {
|
||||
let PartialComponents {
|
||||
client,
|
||||
task_manager,
|
||||
import_queue,
|
||||
..
|
||||
} = new_partial(&config)?;
|
||||
} = new_partial(&mut config).map_err(service_error)?;
|
||||
Ok((cmd.run(client, import_queue), task_manager))
|
||||
})
|
||||
}
|
||||
@@ -143,32 +142,62 @@ pub fn run() -> sc_cli::Result<()> {
|
||||
}
|
||||
Some(Subcommand::Revert(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.async_run(|config| {
|
||||
runner.async_run(|mut config| {
|
||||
let PartialComponents {
|
||||
client,
|
||||
task_manager,
|
||||
backend,
|
||||
..
|
||||
} = new_partial(&config)?;
|
||||
} = new_partial(&mut config).map_err(service_error)?;
|
||||
Ok((cmd.run(client, backend), task_manager))
|
||||
})
|
||||
}
|
||||
Some(Subcommand::Inspect(cmd)) => {
|
||||
let runner = cli.create_runner(cmd)?;
|
||||
runner.sync_run(|config| cmd.run::<Block, RuntimeApi, service::Executor>(config))
|
||||
runner.sync_run(|config| cmd.run::<Block, RuntimeApi, crate::service::Executor>(config))
|
||||
}
|
||||
Some(Subcommand::PvfPrepareWorker(cmd)) => {
|
||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||
builder.with_colors(false);
|
||||
let _ = builder.init();
|
||||
|
||||
polkadot_node_core_pvf::prepare_worker_entrypoint(&cmd.socket_path);
|
||||
Ok(())
|
||||
}
|
||||
Some(crate::cli::Subcommand::PvfExecuteWorker(cmd)) => {
|
||||
let mut builder = sc_cli::LoggerBuilder::new("");
|
||||
builder.with_colors(false);
|
||||
let _ = builder.init();
|
||||
|
||||
polkadot_node_core_pvf::execute_worker_entrypoint(&cmd.socket_path);
|
||||
Ok(())
|
||||
}
|
||||
None => {
|
||||
let runner = cli.create_runner(&cli.run)?;
|
||||
runner
|
||||
.run_node_until_exit(|config| async move {
|
||||
match config.role {
|
||||
Role::Light => Err(sc_service::Error::Other(
|
||||
"Light client is not supported by this node".into(),
|
||||
)),
|
||||
_ => service::new_full(config),
|
||||
}
|
||||
})
|
||||
.map_err(sc_cli::Error::Service)
|
||||
|
||||
// some parameters that are used by polkadot nodes, but that are not used by our binary
|
||||
// let jaeger_agent = None;
|
||||
// let grandpa_pause = None;
|
||||
// let no_beefy = true;
|
||||
// let telemetry_worker_handler = None;
|
||||
// let is_collator = crate::service::IsCollator::No;
|
||||
let overseer_gen = crate::overseer::RealOverseerGen;
|
||||
runner.run_node_until_exit(|config| async move {
|
||||
match config.role {
|
||||
Role::Light => Err(sc_cli::Error::Service(sc_service::Error::Other(
|
||||
"Light client is not supported by this node".into(),
|
||||
))),
|
||||
_ => crate::service::build_full(config, overseer_gen)
|
||||
.map(|full| full.task_manager)
|
||||
.map_err(service_error),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// We don't want to change 'service.rs' too much to ease future updates => it'll keep using
|
||||
// its own error enum like original polkadot service does.
|
||||
fn service_error(err: crate::service::Error) -> sc_cli::Error {
|
||||
sc_cli::Error::Application(Box::new(err))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user