Skip to content

Commit

Permalink
Merge pull request #32 from OriginTrail/upgrade/103/dependecy-update
Browse files Browse the repository at this point in the history
Runtime and client upgrade 1.0.3 for Mainnet - Polkadot v0.9.27 dependencies update
  • Loading branch information
NZT48 authored Aug 29, 2022
2 parents 8317bf9 + 19091c0 commit d26904a
Show file tree
Hide file tree
Showing 10 changed files with 3,599 additions and 3,745 deletions.
4,717 changes: 2,213 additions & 2,504 deletions Cargo.lock

Large diffs are not rendered by default.

120 changes: 64 additions & 56 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "origintrail-parachain-node"
version = "1.0.0"
version = "1.0.3"
authors = ["TraceLabs"]
description = "OriginTrail Parachain - Cumulus FRAME-based Substrate Node"
license = "GPL-3.0-only"
Expand All @@ -14,77 +14,85 @@ name = "origintrail-parachain"
path = "src/main.rs"

[dependencies]
clap = { version = "3.1", features = ["derive"] }
clap = { version = "3.2.15", features = ["derive"] }
derive_more = "0.99.2"
log = "0.4.14"
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.132", features = ["derive"] }
serde = { version = "1.0.140", features = ["derive"] }
hex-literal = "0.3.4"
jsonrpc-core = "18.0.0"
jsonrpsee = { version = "0.14.0", features = ["server"] }

# Local
origintrail-parachain-runtime = { path = "../runtime" }

# Substrate
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", features = ["wasmtime"] }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", features = ["wasmtime"] }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18", features = ["wasmtime"] }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", features = [
"wasmtime",
] }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", features = [
"wasmtime",
] }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27", features = [
"wasmtime",
] }
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }

# Polkadot
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.18" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.18" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.27" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "release-v0.9.27" }

# Cumulus
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-primitives-core ={ git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.18" }
cumulus-client-cli = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-client-collator = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-client-consensus-aura = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-client-consensus-common = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-client-network = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-client-service = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-primitives-core = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-primitives-parachain-inherent = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-relay-chain-inprocess-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }
cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.27" }

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.18" }
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" }

[features]
default = []
runtime-benchmarks = [
"origintrail-parachain-runtime/runtime-benchmarks",
"polkadot-cli/runtime-benchmarks",
Expand Down
154 changes: 68 additions & 86 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,118 +1,100 @@
use crate::chain_spec;
use clap::Parser;
use std::path::PathBuf;

/// Sub-commands supported by the collator.
#[derive(Debug, clap::Subcommand)]
pub enum Subcommand {
/// Export the genesis state of the parachain.
#[clap(name = "export-genesis-state")]
ExportGenesisState(ExportGenesisStateCommand),
/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),

/// Export the genesis wasm of the parachain.
#[clap(name = "export-genesis-wasm")]
ExportGenesisWasm(ExportGenesisWasmCommand),

/// Build a chain specification.
BuildSpec(sc_cli::BuildSpecCmd),

/// Validate blocks.
CheckBlock(sc_cli::CheckBlockCmd),

/// Export blocks.
ExportBlocks(sc_cli::ExportBlocksCmd),
/// Validate blocks.
CheckBlock(sc_cli::CheckBlockCmd),

/// Export the state of a given block into a chain spec.
ExportState(sc_cli::ExportStateCmd),
/// Export blocks.
ExportBlocks(sc_cli::ExportBlocksCmd),

/// Import blocks.
ImportBlocks(sc_cli::ImportBlocksCmd),
/// Export the state of a given block into a chain spec.
ExportState(sc_cli::ExportStateCmd),

/// Remove the whole chain.
PurgeChain(cumulus_client_cli::PurgeChainCmd),
/// Import blocks.
ImportBlocks(sc_cli::ImportBlocksCmd),

/// Revert the chain to a previous state.
/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),

/// The custom benchmark subcommmand benchmarking runtime pallets.
#[clap(name = "benchmark", about = "Benchmark runtime pallets.")]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// Try some testing command against a specified runtime state.
TryRuntime(try_runtime_cli::TryRuntimeCmd),
}

/// Command for exporting the genesis state of the parachain
#[derive(Debug, Parser)]
pub struct ExportGenesisStateCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
pub output: Option<PathBuf>,
/// Remove the whole chain.
PurgeChain(cumulus_client_cli::PurgeChainCmd),

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
pub raw: bool,
/// Export the genesis state of the parachain.
ExportGenesisState(cumulus_client_cli::ExportGenesisStateCommand),

/// The name of the chain for that the genesis state should be exported.
#[clap(long)]
pub chain: Option<String>,
}

/// Command for exporting the genesis wasm file.
#[derive(Debug, Parser)]
pub struct ExportGenesisWasmCommand {
/// Output file name or stdout if unspecified.
#[clap(parse(from_os_str))]
pub output: Option<PathBuf>,
/// Export the genesis wasm of the parachain.
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
pub raw: bool,
/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
Benchmark(frame_benchmarking_cli::BenchmarkCmd),

/// The name of the chain for that the genesis wasm file should be exported.
#[clap(long)]
pub chain: Option<String>,
/// Try some testing command against a specified runtime state.
TryRuntime(try_runtime_cli::TryRuntimeCmd),
}

#[derive(Debug, Parser)]
#[derive(Debug, clap::Parser)]
#[clap(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
pub run: cumulus_client_cli::RunCmd,
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,

#[clap(flatten)]
pub run: cumulus_client_cli::RunCmd,

/// Disable automatic hardware benchmarks.
///
/// By default these benchmarks are automatically ran at startup and measure
/// the CPU speed, the memory bandwidth and the disk speed.
///
/// The results are then printed out in the logs, and also sent as part of
/// telemetry, if telemetry is enabled.
#[clap(long)]
pub no_hardware_benchmarks: bool,

/// Relay chain arguments
#[clap(raw = true)]
pub relay_chain_args: Vec<String>,
/// Relay chain arguments
#[clap(raw = true)]
pub relay_chain_args: Vec<String>,
}

#[derive(Debug)]
pub struct RelayChainCli {
/// The actual relay chain cli object.
pub base: polkadot_cli::RunCmd,
/// The actual relay chain cli object.
pub base: polkadot_cli::RunCmd,

/// Optional chain id that should be passed to the relay chain.
pub chain_id: Option<String>,
/// Optional chain id that should be passed to the relay chain.
pub chain_id: Option<String>,

/// The base path that should be used by the relay chain.
pub base_path: Option<PathBuf>,
/// The base path that should be used by the relay chain.
pub base_path: Option<PathBuf>,
}

impl RelayChainCli {
/// Parse the relay chain CLI parameters using the para chain `Configuration`.
pub fn new<'a>(
para_config: &sc_service::Configuration,
relay_chain_args: impl Iterator<Item = &'a String>,
) -> Self {
let extension = chain_spec::Extensions::try_get(&*para_config.chain_spec);
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config.base_path.as_ref().map(|x| x.path().join("polkadot"));
Self { base_path, chain_id, base: polkadot_cli::RunCmd::parse_from(relay_chain_args) }
}
/// Parse the relay chain CLI parameters using the para chain `Configuration`.
pub fn new<'a>(
para_config: &sc_service::Configuration,
relay_chain_args: impl Iterator<Item = &'a String>,
) -> Self {
let extension = crate::chain_spec::Extensions::try_get(&*para_config.chain_spec);
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config
.base_path
.as_ref()
.map(|x| x.path().join("polkadot"));
Self {
base_path,
chain_id,
base: clap::Parser::parse_from(relay_chain_args),
}
}
}
Loading

0 comments on commit d26904a

Please sign in to comment.