Skip to content

Commit

Permalink
Merge pull request #29 from DoraFactory/polkadot-v0.9.25
Browse files Browse the repository at this point in the history
Polkadot v0.9.25
  • Loading branch information
tinydjp authored Aug 2, 2022
2 parents cc26c62 + 99d0d81 commit dc70c44
Show file tree
Hide file tree
Showing 26 changed files with 2,810 additions and 1,578 deletions.
2,243 changes: 1,127 additions & 1,116 deletions Cargo.lock

Large diffs are not rendered by default.

116 changes: 59 additions & 57 deletions node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@ edition = "2021"
build = "build.rs"

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

[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]

[dependencies]
jsonrpsee = { version = "0.13.0", features = ["server"] }
clap = { version = "3.1", features = [ "derive" ] }
tracing-core = "=0.1.26" # TODO: Higher version will break log format, stick to this version until upstream upgrade.

jsonrpsee = { version = "0.14.0", features = ["server"] }
clap = { version = "3.2.5", features = [ "derive" ] }
serde = { version = "1.0.137", features = ["derive"] }
hex-literal = "0.3.1"
derive_more = "0.99.2"
Expand All @@ -25,70 +27,70 @@ dorafactory-node-runtime = { path = "../runtime" , version = "0.2.0"}

# Substrate Dependencies
## FRAME dependencies
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
frame-support = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
pallet-transaction-payment-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
substrate-frame-rpc-system = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

## Substrate Client Dependencies
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-service = { git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "polkadot-v0.9.22" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sc-basic-authorship = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-rpc = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-rpc-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-service = { git = "https://github.com/paritytech/substrate", features = ["wasmtime"] , branch = "polkadot-v0.9.25" }
sc-telemetry = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-transaction-pool-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sc-sysinfo = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

## Substrate Primitive Dependencies
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.22" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-consensus = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-consensus-aura = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-finality-grandpa = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-inherents = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-keystore = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-offchain = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-timestamp = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.25" }

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

# Polkadot dependencies
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.22" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.22" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.22" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.22" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.22" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.25" }
polkadot-parachain = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.25" }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.25" }
polkadot-service = { git = "https://github.com/paritytech/polkadot", branch = "release-v0.9.25" }
cumulus-relay-chain-interface = { git = "https://github.com/paritytech/cumulus", branch = "polkadot-v0.9.25" }

[[bin]]
name = "dorafactory-node"
Expand Down
10 changes: 5 additions & 5 deletions node/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ pub fn development_config() -> ChainSpec {
get_account_id_from_seed::<sr25519::Public>("Alice"),
get_collator_keys_from_seed("Alice"),
),
(
get_account_id_from_seed::<sr25519::Public>("Bob"),
get_collator_keys_from_seed("Bob"),
),
// (
// get_account_id_from_seed::<sr25519::Public>("Bob"),
// get_collator_keys_from_seed("Bob"),
// ),
],
vec![
get_account_id_from_seed::<sr25519::Public>("Bob"),
Expand All @@ -173,7 +173,7 @@ pub fn development_config() -> ChainSpec {
account("alice", 0, 0),
account("bob", 0, 0),
account("charlie", 0, 0),
PalletId(*b"DoraRewa").into_account(),
PalletId(*b"DoraRewa").into_account_truncating(),
],
dev_para_id.into(),
)
Expand Down
105 changes: 35 additions & 70 deletions node/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,46 +1,8 @@
use crate::chain_spec;
use clap::Parser;
use std::path::PathBuf;

#[derive(Debug, Parser)]
#[clap(
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,

/// 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>,
}

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

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

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

Expand All @@ -56,50 +18,53 @@ pub enum Subcommand {
/// Import blocks.
ImportBlocks(sc_cli::ImportBlocksCmd),

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

/// Remove the whole chain.
PurgeChain(cumulus_client_cli::PurgeChainCmd),

/// Revert the chain to a previous state.
Revert(sc_cli::RevertCmd),
/// Export the genesis state of the parachain.
ExportGenesisState(cumulus_client_cli::ExportGenesisStateCommand),

/// Export the genesis wasm of the parachain.
ExportGenesisWasm(cumulus_client_cli::ExportGenesisWasmCommand),

/// The custom benchmark subcommmand benchmarking runtime pallets.
/// Sub-commands concerned with benchmarking.
/// The pallet benchmarking moved to the `pallet` sub-command.
#[clap(subcommand)]
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>,
#[derive(Debug, clap::Parser)]
#[clap(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
pub struct Cli {
#[clap(subcommand)]
pub subcommand: Option<Subcommand>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
pub raw: bool,
#[clap(flatten)]
pub run: cumulus_client_cli::RunCmd,

/// The name of the chain for that the genesis state should be exported.
/// 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 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>,

/// Write output in binary. Default is to write in hex.
#[clap(short, long)]
pub raw: bool,
pub no_hardware_benchmarks: bool,

/// The name of the chain for that the genesis wasm file should be exported.
#[clap(long)]
pub chain: Option<String>,
/// Relay chain arguments
#[clap(raw = true)]
pub relay_chain_args: Vec<String>,
}

#[derive(Debug)]
Expand All @@ -120,7 +85,7 @@ impl RelayChainCli {
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 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
Expand All @@ -129,7 +94,7 @@ impl RelayChainCli {
Self {
base_path,
chain_id,
base: polkadot_cli::RunCmd::parse_from(relay_chain_args),
base: clap::Parser::parse_from(relay_chain_args),
}
}
}
Loading

0 comments on commit dc70c44

Please sign in to comment.