diff --git a/substrate/core/service/src/builder.rs b/substrate/core/service/src/builder.rs
index cf91d1b267..b2a6cc731a 100644
--- a/substrate/core/service/src/builder.rs
+++ b/substrate/core/service/src/builder.rs
@@ -14,9 +14,8 @@
// You should have received a copy of the GNU General Public License
// along with Substrate. If not, see .
-use crate::{NewService, NetworkStatus, NetworkState, error::{self, Error}, DEFAULT_PROTOCOL_ID};
+use crate::{Service, NetworkStatus, NetworkState, error::{self, Error}, DEFAULT_PROTOCOL_ID};
use crate::{SpawnTaskHandle, start_rpc_servers, build_network_future, TransactionPoolAdapter};
-use crate::TaskExecutor;
use crate::status_sinks;
use crate::config::Configuration;
use client::{
@@ -33,13 +32,13 @@ use futures03::{
FutureExt as _, TryFutureExt as _,
StreamExt as _, TryStreamExt as _,
};
-use keystore::{Store as Keystore, KeyStorePtr};
+use keystore::{Store as Keystore};
use log::{info, warn};
use network::{FinalityProofProvider, OnDemand, NetworkService, NetworkStateInfo, DhtEvent};
use network::{config::BoxFinalityProofRequestBuilder, specialization::NetworkSpecialization};
use parking_lot::{Mutex, RwLock};
use primitives::{Blake2Hasher, H256, Hasher};
-use rpc::{self, system::SystemInfo};
+use rpc;
use sr_primitives::generic::BlockId;
use sr_primitives::traits::{
Block as BlockT, Extrinsic, ProvideRuntimeApi, NumberFor, One, Zero, Header, SaturatedConversion
@@ -69,7 +68,7 @@ use transaction_pool::txpool::{self, ChainApi, Pool as TransactionPool};
/// generics is done when you call `build`.
///
pub struct ServiceBuilder
+ TNetP, TExPool, TRpc, Backend>
{
config: Configuration,
client: Arc,
@@ -83,7 +82,7 @@ pub struct ServiceBuilder,
rpc_extensions: TRpc,
- rpc_builder: TRpcB,
+ remote_backend: Option>>,
dht_event_tx: Option>,
marker: PhantomData<(TBl, TRtApi)>,
}
@@ -134,7 +133,7 @@ type TLightCallExecutor = client::light::call_executor::GenesisC
>,
>;
-impl ServiceBuilder<(), (), TCfg, TGen, TCSExt, (), (), (), (), (), (), (), (), (), (), ()>
+impl ServiceBuilder<(), (), TCfg, TGen, TCSExt, (), (), (), (), (), (), (), (), (), ()>
where TGen: RuntimeGenesis, TCSExt: Extension {
/// Start the service builder with a configuration.
pub fn new_full, TRtApi, TExecDisp: NativeExecutionDispatch>(
@@ -154,7 +153,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
(),
(),
(),
- FullRpcBuilder,
TFullBackend,
>, Error> {
let keystore = Keystore::open(config.keystore_path.clone(), config.keystore_password.clone())?;
@@ -190,8 +188,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
let client = Arc::new(client);
- let rpc_builder = FullRpcBuilder { client: client.clone() };
-
Ok(ServiceBuilder {
config,
client,
@@ -205,7 +201,7 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
network_protocol: (),
transaction_pool: Arc::new(()),
rpc_extensions: Default::default(),
- rpc_builder,
+ remote_backend: None,
dht_event_tx: None,
marker: PhantomData,
})
@@ -229,7 +225,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
(),
(),
(),
- LightRpcBuilder,
TLightBackend,
>, Error> {
let keystore = Keystore::open(config.keystore_path.clone(), config.keystore_password.clone())?;
@@ -259,11 +254,6 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
&config.chain_spec,
executor,
)?);
- let rpc_builder = LightRpcBuilder {
- client: client.clone(),
- remote_blockchain,
- fetcher: fetcher.clone(),
- };
Ok(ServiceBuilder {
config,
@@ -278,16 +268,16 @@ where TGen: RuntimeGenesis, TCSExt: Extension {
network_protocol: (),
transaction_pool: Arc::new(()),
rpc_extensions: Default::default(),
- rpc_builder,
+ remote_backend: Some(remote_blockchain),
dht_event_tx: None,
marker: PhantomData,
})
}
}
-impl
+impl
ServiceBuilder {
+ TNetP, TExPool, TRpc, Backend> {
/// Returns a reference to the client that was stored in this builder.
pub fn client(&self) -> &Arc {
@@ -311,7 +301,7 @@ impl, &Arc
) -> Result