mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-29 12:37:57 +00:00
Dual execution (#311)
* Initial logic * Remove accidental file * Config * Remove accidental * Apply CLI config * Additional work. Sadly pointless. * Rearrange everything * Loop into CLI param * Implement dual execution * typo * fix tests. * Better docs * Fix bug * Add some tests * Report block information on consensus failure, tests * Fix test
This commit is contained in:
@@ -74,7 +74,7 @@ args:
|
||||
- pruning:
|
||||
long: pruning
|
||||
value_name: PRUNING_MODE
|
||||
help: Specify the pruning mode. (a number of blocks to keep or "archive"). Default is 256.
|
||||
help: Specify the pruning mode, a number of blocks to keep or "archive". Default is 256.
|
||||
takes_value: true
|
||||
- name:
|
||||
long: name
|
||||
@@ -95,6 +95,10 @@ args:
|
||||
value_name: TELEMETRY_URL
|
||||
help: The URL of the telemetry server. Implies --telemetry
|
||||
takes_value: true
|
||||
- execution:
|
||||
long: execution
|
||||
value_name: STRATEGY
|
||||
help: The means of execution used when calling into the runtime. Can be either wasm, native or both.
|
||||
subcommands:
|
||||
- build-spec:
|
||||
about: Build a spec.json file, outputing to stdout
|
||||
|
||||
@@ -218,18 +218,32 @@ pub fn run<I, T, W>(args: I, worker: W) -> error::Result<()> where
|
||||
if matches.is_present("collator") {
|
||||
info!("Starting collator");
|
||||
// TODO [rob]: collation node implementation
|
||||
service::Role::FULL
|
||||
// This isn't a thing. Different parachains will have their own collator executables and
|
||||
// maybe link to libpolkadot to get a light-client.
|
||||
service::Role::LIGHT
|
||||
} else if matches.is_present("light") {
|
||||
info!("Starting (light)");
|
||||
config.execution_strategy = service::ExecutionStrategy::NativeWhenPossible;
|
||||
service::Role::LIGHT
|
||||
} else if matches.is_present("validator") || matches.is_present("dev") {
|
||||
info!("Starting validator");
|
||||
config.execution_strategy = service::ExecutionStrategy::Both;
|
||||
service::Role::AUTHORITY
|
||||
} else {
|
||||
info!("Starting (heavy)");
|
||||
config.execution_strategy = service::ExecutionStrategy::NativeWhenPossible;
|
||||
service::Role::FULL
|
||||
};
|
||||
|
||||
if let Some(s) = matches.value_of("execution") {
|
||||
config.execution_strategy = match s {
|
||||
"both" => service::ExecutionStrategy::Both,
|
||||
"native" => service::ExecutionStrategy::NativeWhenPossible,
|
||||
"wasm" => service::ExecutionStrategy::AlwaysWasm,
|
||||
_ => return Err(error::ErrorKind::Input("Invalid execution mode specified".to_owned()).into()),
|
||||
};
|
||||
}
|
||||
|
||||
config.roles = role;
|
||||
{
|
||||
config.network.boot_nodes.extend(matches
|
||||
|
||||
Reference in New Issue
Block a user