Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cli #124

Merged
merged 10 commits into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
241 changes: 1 addition & 240 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[profile.release]
panic = 'unwind'

[workspace]
members = [
"core/merkle-mountain-range",
"core/fly-client",
"core/sr-eth-primitives",
# "darwinia-client",

"node/cli",
"node/executor",
"node/primitives",
"node/rpc",
"node/rpc-client",
"node/runtime",

"srml/balances",
"srml/ethereum-bridge",
"srml/kton",
"srml/staking",
"srml/support",
"srml/support"
]

[profile.release]
# Substrate runtime requires unwinding.
panic = "unwind"
2 changes: 1 addition & 1 deletion node/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,5 @@ wasmtime = [
"cli",
"node-executor/wasmtime",
"substrate-cli/wasmtime",
"substrate-service/wasmtime",
"substrate-service/wasmtime"
]
192 changes: 86 additions & 106 deletions node/cli/res/crayfish-fir.json

Large diffs are not rendered by default.

220 changes: 110 additions & 110 deletions node/cli/res/darwinia-fir.json

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions node/cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub use substrate_cli::{error, ExecutionStrategyParam, IntoExit, NoCustom, Share
use client::ExecutionStrategies;
use log::info;
use structopt::{clap::App, StructOpt};
use substrate_cli::{display_role, parse_and_prepare, AugmentClap, GetLogFilter, ParseAndPrepare};
use substrate_cli::{parse_and_prepare, AugmentClap, GetLogFilter, ParseAndPrepare};
use substrate_service::{AbstractService, Configuration, Roles as ServiceRoles};
use tokio::{
prelude::Future,
Expand Down Expand Up @@ -116,7 +116,7 @@ where
exit,
|exit, _cli_args, _custom_args, config: Config<_, _>| {
info!("{}", version.name);
info!("Version {}", config.full_version());
info!("version {}", config.full_version());
info!(" _____ _ _ ");
info!(" | __ \\ (_) (_) ");
info!(" | | | | __ _ _ ____ ___ _ __ _ __ _ ");
Expand All @@ -125,7 +125,7 @@ where
info!(" |_____/ \\__,_|_| \\_/\\_/ |_|_| |_|_|\\__,_|");
info!("Chain specification: {}", config.chain_spec.name());
info!("Node name: {}", config.name);
info!("Roles: {}", display_role(&config));
info!("Roles: {:?}", substrate_cli::display_role(&config));
let runtime = RuntimeBuilder::new()
.name_prefix("main-tokio-")
.build()
Expand All @@ -136,6 +136,7 @@ where
}
},
),

ParseAndPrepare::BuildSpec(cmd) => cmd.run::<NoCustom, _, _, _>(load_spec),
ParseAndPrepare::ExportBlocks(cmd) => {
cmd.run_with_builder(|config: Config<_, _>| Ok(new_full_start!(config).0), load_spec, exit)
Expand Down
6 changes: 3 additions & 3 deletions node/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#![warn(missing_docs)]
#![warn(unused_extern_crates)]

pub use substrate_cli::error;
pub mod chain_spec;

#[macro_use]
Expand Down Expand Up @@ -48,23 +49,22 @@ pub enum ChainSpec {
StagingTestnet,
}

/// Get a chain config from a spec setting.
impl ChainSpec {
pub(crate) fn load(self) -> Result<chain_spec::ChainSpec, String> {
Ok(match self {
ChainSpec::CrayfishTestnet => chain_spec::crayfish_fir_config()?,
ChainSpec::Development => chain_spec::development_config(),
ChainSpec::LocalTestnet => chain_spec::local_testnet_config(),
ChainSpec::StagingTestnet => chain_spec::staging_testnet_config(),
ChainSpec::CrayfishTestnet => chain_spec::crayfish_testnet_config(),
})
}

pub(crate) fn from(s: &str) -> Option<Self> {
match s {
"dev" => Some(ChainSpec::Development),
"local" => Some(ChainSpec::LocalTestnet),
"" | "crayfish" => Some(ChainSpec::CrayfishTestnet),
"staging" => Some(ChainSpec::StagingTestnet),
"" => Some(ChainSpec::CrayfishTestnet),
_ => None,
}
}
Expand Down
30 changes: 0 additions & 30 deletions node/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,12 @@ description = "Substrate node implementation in Rust."
edition = "2018"

[dependencies]
codec = { package = "parity-scale-codec", version = "1.0.0" }
trie-root = "0.15.2"

runtime_io = { package = "sr-io", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
state_machine = { package = "substrate-state-machine", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
substrate-executor = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
primitives = { package = "substrate-primitives", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
trie = { package = "substrate-trie", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }

node-primitives = { path = "../primitives" }
node-runtime = { path = "../runtime" }

[dev-dependencies]
criterion = "0.3.0"
wabt = "0.9.2"

test-client = { package = "substrate-test-client", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
sr-primitives = { git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
runtime_support = { package = "srml-support", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
transaction-payment = { package = "srml-transaction-payment", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
session = { package = "srml-session", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
system = { package = "srml-system", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
timestamp = { package = "srml-timestamp", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
contracts = { package = "srml-contracts", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
grandpa = { package = "srml-grandpa", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }
indices = { package = "srml-indices", git = "https://github.com/darwinia-network/substrate.git", branch = "darwinia-develop" }

balances = { package = "darwinia-balances", path = "../../srml/balances" }
node-testing = { path = "../testing" }

[features]
wasmtime = [
"substrate-executor/wasmtime",
]
stress-test = []

[[bench]]
name = "bench"
harness = false
196 changes: 0 additions & 196 deletions node/executor/benches/bench.rs

This file was deleted.

3 changes: 2 additions & 1 deletion node/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
//! A `CodeExecutor` specialization which uses natively compiled runtime when the wasm to be
//! executed is equivalent to the natively compiled code.

use substrate_executor::native_executor_instance;
pub use substrate_executor::NativeExecutor;

use substrate_executor::native_executor_instance;

// Declare an instance of the native executor named `Executor`. Include the wasm binary as the
// equivalent wasm code.
native_executor_instance!(
Expand Down
12 changes: 6 additions & 6 deletions node/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,11 +381,11 @@ impl staking::Trait for Runtime {
type SessionInterface = Self;
}

impl ethereum_bridge::Trait for Runtime {
type Event = Event;
// type Ring = Balances;
// type Hash = Hash;
}
//impl ethereum_bridge::Trait for Runtime {
// type Event = Event;
// type Ring = Balances;
// type Hash = Hash;
//}

construct_runtime!(
pub enum Runtime where
Expand Down Expand Up @@ -419,7 +419,7 @@ construct_runtime!(
Sudo: sudo,
Utility: utility::{Module, Call, Event},

EthereumBridge: ethereum_bridge::{Storage, Module, Event<T>, Call},
// EthereumBridge: ethereum_bridge::{Storage, Module, Event<T>, Call},
}
);

Expand Down
Loading