mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-19 01:51:02 +00:00
New service initial commit (#1234)
* New service initial commit * More separation of the new and old services * Fix review comments * Adds polkadot.json * Fix browser build * Remove unused import * Update node/service/src/lib.rs Co-authored-by: Fedor Sakharov <fedor.sakharov@gmail.com> * Remove duplicate json files Co-authored-by: Robert Habermeier <rphmeier@gmail.com>
This commit is contained in:
@@ -23,7 +23,8 @@ sp-runtime = { 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-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
service = { package = "polkadot-service", path = "../service", default-features = false }
|
||||
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 }
|
||||
|
||||
tokio = { version = "0.2.13", features = ["rt-threaded"], optional = true }
|
||||
frame-benchmarking-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }
|
||||
@@ -38,7 +39,7 @@ browser-utils = { package = "substrate-browser-utils", git = "https://github.com
|
||||
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
[features]
|
||||
default = [ "wasmtime", "db", "cli" ]
|
||||
default = [ "wasmtime", "db", "cli", "service-old" ]
|
||||
wasmtime = [ "sc-cli/wasmtime" ]
|
||||
db = [ "service/db" ]
|
||||
cli = [
|
||||
@@ -46,11 +47,13 @@ cli = [
|
||||
"sc-cli",
|
||||
"sc-service",
|
||||
"frame-benchmarking-cli",
|
||||
"service/full-node",
|
||||
]
|
||||
service-old = [ "service/full-node" ]
|
||||
browser = [
|
||||
"wasm-bindgen",
|
||||
"wasm-bindgen-futures",
|
||||
"browser-utils",
|
||||
"service",
|
||||
]
|
||||
runtime-benchmarks = ["service/runtime-benchmarks"]
|
||||
runtime-benchmarks = [ "service/runtime-benchmarks" ]
|
||||
service-rewr = [ "service-new/full-node" ]
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
// 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_executor::NativeExecutionDispatch;
|
||||
use sc_cli::{SubstrateCli, Result};
|
||||
use crate::cli::{Cli, Subcommand};
|
||||
@@ -206,7 +209,7 @@ pub fn run() -> Result<()> {
|
||||
if cfg!(feature = "browser") {
|
||||
Err(sc_cli::Error::Input("Cannot run validation worker in browser".into()))
|
||||
} else {
|
||||
#[cfg(not(feature = "browser"))]
|
||||
#[cfg(all(not(feature = "browser"), not(feature = "service-rewr")))]
|
||||
service::run_validation_worker(&cmd.mem_id)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -26,11 +26,19 @@ mod cli;
|
||||
#[cfg(feature = "cli")]
|
||||
mod command;
|
||||
|
||||
#[cfg(not(feature = "service-rewr"))]
|
||||
pub use service::{
|
||||
AbstractService, ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
|
||||
Block, self, RuntimeApiCollection, TFullClient
|
||||
};
|
||||
|
||||
#[cfg(feature = "service-rewr")]
|
||||
pub use service_new::{
|
||||
self as service,
|
||||
AbstractService, ProvideRuntimeApi, CoreApi, ParachainHost, IdentifyVariant,
|
||||
Block, self, RuntimeApiCollection, TFullClient
|
||||
};
|
||||
|
||||
#[cfg(feature = "cli")]
|
||||
pub use cli::*;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user