Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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
64 changes: 4 additions & 60 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 1 addition & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ readme = "README.md"
[dependencies]
cli = { package = "polkadot-cli", path = "cli" }
futures = "0.3.4"
service = { package = "polkadot-service", path = "service" }
service = { package = "polkadot-service", path = "node/service" }
parity-util-mem = { version = "*", default-features = false, features = ["jemalloc-global"] }

[dev-dependencies]
Expand All @@ -36,9 +36,7 @@ members = [
"runtime/westend",
"runtime/test-runtime",
"runtime/test-runtime/client",
"service",
"statement-table",
"service",
"validation",
"xcm",
"xcm/xcm-builder",
Expand Down Expand Up @@ -81,9 +79,6 @@ panic = "unwind"

[features]
runtime-benchmarks=["cli/runtime-benchmarks"]
service-rewr= [
"cli/service-rewr",
]

# Configuration for building a .deb package - for use with `cargo-deb`
[package.metadata.deb]
Expand Down
8 changes: 3 additions & 5 deletions cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "mas
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-tracing = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "polkadot-service", path = "../service", default-features = false, optional = true }
service-new = { package = "polkadot-service-new", path = "../node/service", default-features = false, optional = true }
service = { package = "polkadot-service", path = "../node/service", default-features = false, optional = true }

tokio = { version = "0.2.13", features = ["rt-threaded"], optional = true }
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
Expand All @@ -43,7 +42,7 @@ sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master",
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }

[features]
default = [ "wasmtime", "db", "cli", "service-old", "trie-memory-tracker" ]
default = [ "wasmtime", "db", "cli", "full-node", "trie-memory-tracker" ]
wasmtime = [ "sc-cli/wasmtime" ]
db = [ "service/db" ]
cli = [
Expand All @@ -52,13 +51,12 @@ cli = [
"sc-service",
"frame-benchmarking-cli",
]
service-old = [ "service/full-node" ]
browser = [
"wasm-bindgen",
"wasm-bindgen-futures",
"browser-utils",
"service",
]
runtime-benchmarks = [ "service/runtime-benchmarks" ]
service-rewr = [ "service-new/full-node" ]
trie-memory-tracker = [ "sp-trie/memory-tracker" ]
full-node = [ "service/full-node" ]
4 changes: 4 additions & 0 deletions cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ pub struct RunCmd {
#[structopt(long = "force-westend")]
pub force_westend: bool,

/// Force using Rococo native runtime.
#[structopt(long = "force-rococo")]
pub force_rococo: bool,

/// Enable the authority discovery module on validator or sentry nodes.
///
/// When enabled:
Expand Down
28 changes: 18 additions & 10 deletions cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.

use log::info;
#[cfg(not(feature = "service-rewr"))]
use service::{IdentifyVariant, self};
#[cfg(feature = "service-rewr")]
use service_new::{IdentifyVariant, self as service};
use sc_cli::{SubstrateCli, Result, RuntimeVersion, Role};
use crate::cli::{Cli, Subcommand};
use std::sync::Arc;
Expand Down Expand Up @@ -48,7 +45,7 @@ impl SubstrateCli for Cli {
fn load_spec(&self, id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, String> {
let id = if id == "" {
let n = get_exec_name().unwrap_or_default();
["polkadot", "kusama", "westend"].iter()
["polkadot", "kusama", "westend", "rococo"].iter()
.cloned()
.find(|&chain| n.starts_with(chain))
.unwrap_or("polkadot")
Expand All @@ -66,6 +63,9 @@ impl SubstrateCli for Cli {
"westend-dev" => Box::new(service::chain_spec::westend_development_config()?),
"westend-local" => Box::new(service::chain_spec::westend_local_testnet_config()?),
"westend-staging" => Box::new(service::chain_spec::westend_staging_testnet_config()?),
"rococo-staging" => Box::new(service::chain_spec::rococo_staging_testnet_config()?),
"rococo-local" => Box::new(service::chain_spec::rococo_local_testnet_config()?),
"rococo" => Box::new(service::chain_spec::rococo_config()?),
path => {
let path = std::path::PathBuf::from(path);

Expand All @@ -75,7 +75,9 @@ impl SubstrateCli for Cli {

// When `force_*` is given or the file name starts with the name of one of the known chains,
// we use the chain spec for the specific chain.
if self.run.force_kusama || starts_with("kusama") {
if self.run.force_rococo || starts_with("rococo") {
Box::new(service::RococoChainSpec::from_json_file(path)?)
} else if self.run.force_kusama || starts_with("kusama") {
Box::new(service::KusamaChainSpec::from_json_file(path)?)
} else if self.run.force_westend || starts_with("westend") {
Box::new(service::WestendChainSpec::from_json_file(path)?)
Expand All @@ -91,6 +93,8 @@ impl SubstrateCli for Cli {
&service::kusama_runtime::VERSION
} else if spec.is_westend() {
&service::westend_runtime::VERSION
} else if spec.is_rococo() {
&service::rococo_runtime::VERSION
} else {
&service::polkadot_runtime::VERSION
}
Expand Down Expand Up @@ -147,7 +151,7 @@ pub fn run() -> Result<()> {
None,
authority_discovery_enabled,
grandpa_pause,
).map(|r| r.0),
).map(|full| full.task_manager),
}
})
},
Expand Down Expand Up @@ -179,10 +183,14 @@ pub fn run() -> Result<()> {
runner.async_run(|config| {
let chain_spec = config.chain_spec.cloned_box();
let network_config = config.network.clone();
let service::NewFull { task_manager, client, network_status_sinks, .. }
= service::new_full_nongeneric(
config, None, authority_discovery_enabled, grandpa_pause, false,
)?;
let service::NewFull {
task_manager,
client,
network_status_sinks,
..
} = service::build_full(
config, None, authority_discovery_enabled, grandpa_pause,
)?;
let client = Arc::new(client);

Ok((cmd.run(chain_spec, network_config, client, network_status_sinks), task_manager))
Expand Down
13 changes: 3 additions & 10 deletions cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,10 @@ mod cli;
#[cfg(feature = "cli")]
mod command;

#[cfg(not(feature = "service-rewr"))]
pub use service::{
ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
Block, self, RuntimeApiCollection, TFullClient
};

#[cfg(feature = "service-rewr")]
pub use service_new::{
self as service,
ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
Block, self, RuntimeApiCollection, TFullClient
self,
ProvideRuntimeApi, CoreApi, IdentifyVariant,
Block, RuntimeApiCollection, TFullClient
};

#[cfg(feature = "cli")]
Expand Down
95 changes: 54 additions & 41 deletions node/service/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,63 +1,76 @@
[package]
name = "polkadot-service-new"
name = "polkadot-service"
version = "0.8.3"
authors = ["Parity Technologies <[email protected]>"]
edition = "2018"

[dependencies]
parking_lot = "0.9.0"
serde = { version = "1.0.102", features = ["derive"] }
lazy_static = "1.4.0"
log = "0.4.8"
futures = "0.3.4"
slog = "2.5.2"
hex-literal = "0.2.1"
polkadot-primitives = { path = "../../primitives" }
polkadot-runtime = { path = "../../runtime/polkadot" }
polkadot-overseer = { path = "../overseer" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" }
kusama-runtime = { path = "../../runtime/kusama" }
westend-runtime = { path = "../../runtime/westend" }
polkadot-rpc = { path = "../../rpc" }
polkadot-node-core-proposer = { path = "../core/proposer" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
# Substrate Client
authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-client-db = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-network = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" }

# Substrate Primitives
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
consensus_common = { package = "sp-consensus", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa = { package = "sc-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
grandpa_primitives = { package = "sp-finality-grandpa", git = "https://github.com/paritytech/substrate", branch = "master" }
inherents = { package = "sp-inherents", git = "https://github.com/paritytech/substrate", branch = "master" }
service = { package = "sc-service", git = "https://github.com/paritytech/substrate", branch = "master", default-features = false }
telemetry = { package = "sc-telemetry", git = "https://github.com/paritytech/substrate", branch = "master" }
sc-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-blockchain = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-io = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-storage = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-transaction-pool = { git = "https://github.com/paritytech/substrate", branch = "master" }
sc-keystore = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-trie = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Substrate Pallets
pallet-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-im-online = { git = "https://github.com/paritytech/substrate", branch = "master" }
authority-discovery = { package = "sc-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
authority-discovery-primitives = { package = "sp-authority-discovery", git = "https://github.com/paritytech/substrate", branch = "master" }
babe = { package = "sc-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
babe-primitives = { package = "sp-consensus-babe", git = "https://github.com/paritytech/substrate", branch = "master" }
sp-block-builder = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
pallet-transaction-payment-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }

# Substrate Other
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }
frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
codec = { package = "parity-scale-codec", version = "1.3.4" }
sp-session = { git = "https://github.com/paritytech/substrate", branch = "master" }
sp-offchain = { package = "sp-offchain", git = "https://github.com/paritytech/substrate", branch = "master" }
prometheus-endpoint = { package = "substrate-prometheus-endpoint", git = "https://github.com/paritytech/substrate", branch = "master" }
frame-benchmarking = { git = "https://github.com/paritytech/substrate", branch = "master" }

# External Crates
codec = { package = "parity-scale-codec", version = "1.3.4" }
futures = "0.3.4"
hex-literal = "0.2.1"
lazy_static = "1.4.0"
log = "0.4.8"
parking_lot = "0.9.0"
serde = { version = "1.0.102", features = ["derive"] }
slog = "2.5.2"

# Polkadot
kusama-runtime = { path = "../../runtime/kusama" }
polkadot-node-core-proposer = { path = "../core/proposer" }
polkadot-overseer = { path = "../overseer" }
polkadot-parachain = { path = "../../parachain" }
polkadot-primitives = { path = "../../primitives" }
polkadot-rpc = { path = "../../rpc" }
polkadot-runtime = { path = "../../runtime/polkadot" }
polkadot-subsystem = { package = "polkadot-node-subsystem", path = "../subsystem" }
rococo-runtime = { package = "rococo-v1-runtime", path = "../../runtime/rococo-v1" }
westend-runtime = { path = "../../runtime/westend" }

[dev-dependencies]
polkadot-test-runtime-client = { path = "../../runtime/test-runtime/client" }
Expand Down
1 change: 1 addition & 0 deletions node/service/res/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
!/*.json
File renamed without changes.
Loading