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

Commit

Permalink
Substrate CLI (#423)
Browse files Browse the repository at this point in the history
* Moved chain ops to substrate-service

* moved RPC to susbstrate-service WIP

* Moved RPC to substrate-service

* Version

* Removed redundadnt messages

* substrate CLI

* Removed obsolete files

* Sorted out startup messages

* Pass executable name to CLI
  • Loading branch information
arkpar authored and gavofyork committed Jul 25, 2018
1 parent d4696b9 commit 1fb72bf
Show file tree
Hide file tree
Showing 14 changed files with 78 additions and 1,131 deletions.
17 changes: 1 addition & 16 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,18 @@ name = "polkadot-cli"
version = "0.2.0"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Polkadot node implementation in Rust."
build = "build.rs"

[dependencies]
clap = { version = "~2.32", features = ["yaml"] }
backtrace = "0.3"
env_logger = "0.4"
error-chain = "0.12"
log = "0.3"
atty = "0.2"
regex = "1"
time = "0.1"
slog = "^2"
ansi_term = "0.10"
lazy_static = "1.0"
triehash = "0.1"
ed25519 = { path = "../../substrate/ed25519" }
app_dirs = "1.2"
tokio = "0.1.7"
futures = "0.1.17"
fdlimit = "0.1"
parking_lot = "0.4"
serde_json = "1.0"
serde = "1.0"
exit-future = "0.1"
substrate-cli = { path = "../../substrate/cli" }
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" }
Expand All @@ -42,7 +30,4 @@ polkadot-primitives = { path = "../primitives" }
polkadot-runtime = { path = "../runtime" }
polkadot-service = { path = "../service" }
polkadot-transaction-pool = { path = "../transaction-pool" }
names = "0.11.0"

[build-dependencies]
clap = "~2.32"
11 changes: 0 additions & 11 deletions cli/README.adoc

This file was deleted.

43 changes: 0 additions & 43 deletions cli/build.rs

This file was deleted.

41 changes: 0 additions & 41 deletions cli/doc/shell-completion.adoc

This file was deleted.

31 changes: 7 additions & 24 deletions cli/src/chain_spec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
//! Predefined chains.

use service;
use std::path::PathBuf;

/// The chain specification (this should eventually be replaced by a more general JSON-based chain
/// specification).
Expand All @@ -31,8 +30,6 @@ pub enum ChainSpec {
KrummeLanke,
/// Whatever the current runtime is with the "global testnet" defaults.
StagingTestnet,
/// Custom Genesis file.
Custom(String),
}

/// Get a chain config from a spec setting.
Expand All @@ -43,32 +40,18 @@ impl ChainSpec {
ChainSpec::Development => service::chain_spec::development_config(),
ChainSpec::LocalTestnet => service::chain_spec::local_testnet_config(),
ChainSpec::StagingTestnet => service::chain_spec::staging_testnet_config(),
ChainSpec::Custom(f) => service::ChainSpec::from_json_file(PathBuf::from(f))?,
})
}
}

impl<'a> From<&'a str> for ChainSpec {
fn from(s: &'a str) -> Self {
pub(crate) fn from(s: &str) -> Option<Self> {
match s {
"dev" => ChainSpec::Development,
"local" => ChainSpec::LocalTestnet,
"poc-1" => ChainSpec::KrummeLanke,
"krummelanke" => ChainSpec::KrummeLanke,
"staging" => ChainSpec::StagingTestnet,
s => ChainSpec::Custom(s.into()),
"dev" => Some(ChainSpec::Development),
"local" => Some(ChainSpec::LocalTestnet),
"poc-1" => Some(ChainSpec::KrummeLanke),
"" | "krummelanke" => Some(ChainSpec::KrummeLanke),
"staging" => Some(ChainSpec::StagingTestnet),
_ => None,
}
}
}

impl From<ChainSpec> for String {
fn from(s: ChainSpec) -> String {
match s {
ChainSpec::Development => "dev".into(),
ChainSpec::LocalTestnet => "local".into(),
ChainSpec::KrummeLanke => "krummelanke".into(),
ChainSpec::StagingTestnet => "staging".into(),
ChainSpec::Custom(f) => format!("custom ({})", f),
}
}
}
197 changes: 0 additions & 197 deletions cli/src/cli.yml

This file was deleted.

0 comments on commit 1fb72bf

Please sign in to comment.