Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Update cli to new sc-cli API #935

Merged
merged 41 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
2a2ed8e
Initial commit
cecton Mar 24, 2020
44ed5c6
Switch substrate to branch cecton-the-revenge-of-the-cli
cecton Mar 24, 2020
1690b05
Adapting code
cecton Mar 24, 2020
8ea2ad7
Update Cargo.lock
cecton Mar 24, 2020
d675fe2
Adapting code
cecton Mar 24, 2020
c67277a
Adapt more code
cecton Mar 24, 2020
711d47a
Implement force_kusama parameter
cecton Mar 24, 2020
6057c42
Revert dependency update
cecton Mar 24, 2020
1681355
Adapt code to use ref to SubstrateCli object
cecton Mar 25, 2020
1bae550
Updated to latest version
cecton Mar 25, 2020
738d91d
Updated with latest changes
cecton Mar 26, 2020
24a7a32
Bump spec vesion
cecton Mar 26, 2020
e449dc9
Fixed tests
cecton Mar 26, 2020
a2dbe42
WIP
cecton Mar 26, 2020
5ef5fb6
More fixes
cecton Mar 26, 2020
9d0facf
Update from parent 'origin/master' (no conflict)
cecton Mar 26, 2020
2f5a915
Update from parent 'origin/master' (conflicts)
cecton Mar 26, 2020
8671462
Update from parent 'origin/master' (no conflict)
cecton Mar 26, 2020
b835d3f
Cargo.lock
cecton Mar 26, 2020
5d4e853
Update from parent 'origin/master' (no conflict)
cecton Mar 27, 2020
56f5304
Update from parent 'origin/master' (conflicts)
cecton Mar 27, 2020
e765f1a
Updated code
cecton Mar 27, 2020
2a6125f
Fixed and adapt
cecton Mar 27, 2020
6ae179d
Fixed dependency issue with wasm
cecton Mar 27, 2020
f311088
Adapted code
cecton Mar 27, 2020
68deba8
Update from parent 'origin/master' (conflicts)
cecton Mar 30, 2020
8de5120
Update from parent 'origin/master' (no conflict)
cecton Mar 31, 2020
194a9d9
Revert branch change
cecton Mar 31, 2020
b0c90ce
Update from parent 'origin/master' (no conflict)
cecton Apr 2, 2020
3cfaeda
Update from parent 'origin/master' (conflicts)
cecton Apr 2, 2020
39ed769
Cargo.lock
cecton Apr 2, 2020
2ddf7f5
Merge commit 3a17550ca460c6dc71e1f5a53afc11b9b03b3724 (no conflict)
cecton Apr 6, 2020
686cbb7
Merge commit dddf83f772b5b269d96f7b4fe295afff82135ccc (conflicts)
cecton Apr 6, 2020
09cb3f1
Merge commit 587588f8aa08bca22a76525ab539e5b91bbfdc0e (no conflict)
cecton Apr 6, 2020
d41d65b
Merge commit 36e9d17e6d6c527c7a2243f2be8d1d39819be2f0 (conflicts)
cecton Apr 6, 2020
1abd782
Merge commit ed2c4cab3ad761b2f2e4bd39966d2bbc0be77ad4 (no conflict)
cecton Apr 6, 2020
6e49cf4
Cargo.lock
cecton Apr 6, 2020
c66a094
Adapt code
cecton Apr 6, 2020
f450e31
Clean-up
cecton Apr 7, 2020
e3cc92d
More clean-up
cecton Apr 7, 2020
45c0518
Cargo.lock
cecton Apr 7, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
279 changes: 139 additions & 140 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ path = "src/main.rs"
name = "polkadot"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
build = "build.rs"
edition = "2018"

[dependencies]
Expand All @@ -15,9 +14,6 @@ futures = "0.3.4"
service = { package = "polkadot-service", path = "service" }
parity-util-mem = { version = "*", default-features = false, features = ["jemalloc-global"] }

[build-dependencies]
vergen = "3.0.4"

[dev-dependencies]
assert_cmd = "0.12"
nix = "0.17"
Expand Down
7 changes: 6 additions & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "polkadot-cli"
version = "0.7.29-pre1"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
description = "Polkadot Relay-chain Client Node"
edition = "2018"

[package.metadata.wasm-pack.profile.release]
Expand All @@ -29,18 +29,23 @@ service = { package = "polkadot-service", path = "../service", default-features
tokio = { version = "0.2.13", features = ["rt-threaded"], optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
sc-service = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }

wasm-bindgen = { version = "0.2.57", optional = true }
wasm-bindgen-futures = { version = "0.4.7", optional = true }
browser-utils = { package = "substrate-browser-utils", git = "https://github.com/paritytech/substrate", branch = "master", optional = true }

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

[features]
default = [ "wasmtime", "rocksdb", "cli" ]
wasmtime = [ "sc-cli/wasmtime" ]
rocksdb = [ "service/rocksdb" ]
cli = [
"tokio",
"sc-cli",
"sc-service",
"frame-benchmarking-cli",
"service/full-node",
]
Expand Down
9 changes: 1 addition & 8 deletions build.rs → cli/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@
// You should have received a copy of the GNU General Public License
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

extern crate vergen;

use vergen::{ConstantsFlags, generate_cargo_keys};

const ERROR_MSG: &'static str = "Failed to generate metadata files";

fn main() {
generate_cargo_keys(ConstantsFlags::all()).expect(ERROR_MSG);
println!("cargo:rerun-if-changed=.git/HEAD");
substrate_build_script_utils::generate_cargo_keys();
}
6 changes: 3 additions & 3 deletions cli/src/browser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo
let config = browser_configuration(chain_spec).await?;

info!("Polkadot browser node");
info!(" version {}", config.full_version());
info!(" version {}", config.impl_version);
info!(" by Parity Technologies, 2017-2020");
info!("📋 Chain specification: {}", config.expect_chain_spec().name());
info!("🏷 Node name: {}", config.name);
info!("📋 Chain specification: {}", config.chain_spec.name());
info!("🏷 Node name: {}", config.network.node_name);
info!("👤 Role: {}", config.display_role());

// Create the service. This is the most heavy initialization step.
Expand Down
88 changes: 0 additions & 88 deletions cli/src/chain_spec.rs

This file was deleted.

29 changes: 12 additions & 17 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,23 +54,6 @@ pub struct RunCmd {
/// Force using Kusama native runtime.
#[structopt(long = "force-kusama")]
pub force_kusama: bool,
}

#[allow(missing_docs)]
#[derive(Debug, StructOpt, Clone)]
#[structopt(settings = &[
structopt::clap::AppSettings::GlobalVersion,
structopt::clap::AppSettings::ArgsNegateSubcommands,
structopt::clap::AppSettings::SubcommandsNegateReqs,
])]
pub struct Cli {
#[allow(missing_docs)]
#[structopt(subcommand)]
pub subcommand: Option<Subcommand>,

#[allow(missing_docs)]
#[structopt(flatten)]
pub run: RunCmd,

#[allow(missing_docs)]
#[structopt(long = "enable-authority-discovery")]
Expand All @@ -85,3 +68,15 @@ pub struct Cli {
#[structopt(long = "grandpa-pause", number_of_values(2))]
pub grandpa_pause: Vec<u32>,
}

#[allow(missing_docs)]
#[derive(Debug, StructOpt, Clone)]
pub struct Cli {
#[allow(missing_docs)]
#[structopt(subcommand)]
pub subcommand: Option<Subcommand>,

#[allow(missing_docs)]
#[structopt(flatten)]
pub run: RunCmd,
}
Loading