Companion for substrate#10632 (#4689)

* Companion for substrate#10632

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* cargo format

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix bags-list

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Update Substrate

* Fix

Signed-off-by: koushiro <koushiro.cqx@gmail.com>

* Fix bridges test

* FMT

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
Qinxuan Chen
2022-01-25 18:58:17 +08:00
committed by GitHub
parent 6b7e40cd6c
commit f4ec9b0341
14 changed files with 335 additions and 358 deletions
+15 -15
View File
@@ -14,9 +14,9 @@ wasm-opt = false
crate-type = ["cdylib", "rlib"]
[dependencies]
clap = { version = "3.0", features = ["derive"], optional = true }
log = "0.4.13"
thiserror = "1.0.30"
structopt = { version = "0.3.25", optional = true }
futures = "0.3.19"
service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }
@@ -39,11 +39,11 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
[features]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-native" ]
wasmtime = [ "sc-cli/wasmtime" ]
db = [ "service/db" ]
default = ["wasmtime", "db", "cli", "full-node", "trie-memory-tracker", "polkadot-native"]
wasmtime = ["sc-cli/wasmtime"]
db = ["service/db"]
cli = [
"structopt",
"clap",
"sc-cli",
"sc-service",
"sc-tracing",
@@ -52,19 +52,19 @@ cli = [
"polkadot-node-core-pvf",
"polkadot-performance-test",
]
runtime-benchmarks = [ "service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks" ]
trie-memory-tracker = [ "sp-trie/memory-tracker" ]
full-node = [ "service/full-node" ]
try-runtime = [ "service/try-runtime" ]
fast-runtime = [ "service/fast-runtime" ]
runtime-benchmarks = ["service/runtime-benchmarks", "polkadot-node-metrics/runtime-benchmarks"]
trie-memory-tracker = ["sp-trie/memory-tracker"]
full-node = ["service/full-node"]
try-runtime = ["service/try-runtime"]
fast-runtime = ["service/fast-runtime"]
# Configure the native runtimes to use. Polkadot is enabled by default.
#
# Validators require the native runtime currently
polkadot-native = [ "service/polkadot-native" ]
kusama-native = [ "service/kusama-native" ]
westend-native = [ "service/westend-native" ]
rococo-native = [ "service/rococo-native" ]
polkadot-native = ["service/polkadot-native"]
kusama-native = ["service/kusama-native"]
westend-native = ["service/westend-native"]
rococo-native = ["service/rococo-native"]
malus = [ "full-node", "service/malus" ]
malus = ["full-node", "service/malus"]
runtime-metrics = ["service/runtime-metrics", "polkadot-node-metrics/runtime-metrics"]
+18 -17
View File
@@ -16,10 +16,10 @@
//! Polkadot CLI library.
use structopt::StructOpt;
use clap::{AppSettings, Parser};
#[allow(missing_docs)]
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub enum Subcommand {
/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),
@@ -43,15 +43,15 @@ pub enum Subcommand {
Revert(sc_cli::RevertCmd),
#[allow(missing_docs)]
#[structopt(name = "prepare-worker", setting = structopt::clap::AppSettings::Hidden)]
#[clap(name = "prepare-worker", setting = AppSettings::Hidden)]
PvfPrepareWorker(ValidationWorkerCommand),
#[allow(missing_docs)]
#[structopt(name = "execute-worker", setting = structopt::clap::AppSettings::Hidden)]
#[clap(name = "execute-worker", setting = AppSettings::Hidden)]
PvfExecuteWorker(ValidationWorkerCommand),
/// The custom benchmark subcommand benchmarking runtime pallets.
#[structopt(name = "benchmark", about = "Benchmark runtime pallets.")]
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),
/// Runs performance checks such as PVF compilation in order to measure machine
@@ -67,33 +67,34 @@ pub enum Subcommand {
TryRuntime,
/// Key management CLI utilities
#[clap(subcommand)]
Key(sc_cli::KeySubcommand),
}
#[allow(missing_docs)]
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct ValidationWorkerCommand {
/// The path to the validation host's socket.
pub socket_path: String,
}
#[allow(missing_docs)]
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct RunCmd {
#[allow(missing_docs)]
#[structopt(flatten)]
#[clap(flatten)]
pub base: sc_cli::RunCmd,
/// Force using Kusama native runtime.
#[structopt(long = "force-kusama")]
#[clap(long = "force-kusama")]
pub force_kusama: bool,
/// Force using Westend native runtime.
#[structopt(long = "force-westend")]
#[clap(long = "force-westend")]
pub force_westend: bool,
/// Force using Rococo native runtime.
#[structopt(long = "force-rococo")]
#[clap(long = "force-rococo")]
pub force_rococo: bool,
/// Setup a GRANDPA scheduled voting pause.
@@ -102,26 +103,26 @@ pub struct RunCmd {
/// blocks). After the given block number is finalized the GRANDPA voter
/// will temporarily stop voting for new blocks until the given delay has
/// elapsed (i.e. until a block at height `pause_block + delay` is imported).
#[structopt(long = "grandpa-pause", number_of_values(2))]
#[clap(long = "grandpa-pause", number_of_values(2))]
pub grandpa_pause: Vec<u32>,
/// Enable the BEEFY gadget (only on Rococo or Wococo for now).
#[structopt(long)]
#[clap(long)]
pub beefy: bool,
/// Add the destination address to the jaeger agent.
///
/// Must be valid socket address, of format `IP:Port`
/// commonly `127.0.0.1:6831`.
#[structopt(long)]
#[clap(long)]
pub jaeger_agent: Option<std::net::SocketAddr>,
}
#[allow(missing_docs)]
#[derive(Debug, StructOpt)]
#[derive(Debug, Parser)]
pub struct Cli {
#[structopt(subcommand)]
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,
#[structopt(flatten)]
#[clap(flatten)]
pub run: RunCmd,
}