Skip to content

Commit dafd6de

Browse files
sander2grishasobol
authored andcommitted
expose substrate-cli service (paritytech#10229)
* expose substrate-cli service * chore: undo change to new_full (since new_full_base is exposed already)
1 parent dac7f41 commit dafd6de

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

bin/node/cli/src/service.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use sc_client_api::{BlockBackend, ExecutorProvider};
3030
use sc_consensus_babe::{self, SlotProportion};
3131
use sc_executor::NativeElseWasmExecutor;
3232
use sc_network::{Event, NetworkService};
33-
use sc_service::{config::Configuration, error::Error as ServiceError, TaskManager};
33+
use sc_service::{config::Configuration, error::Error as ServiceError, RpcHandlers, TaskManager};
3434
use sc_telemetry::{Telemetry, TelemetryWorker};
3535
use sp_api::ProvideRuntimeApi;
3636
use sp_core::crypto::Pair;
@@ -298,6 +298,8 @@ pub struct NewFullBase {
298298
pub network: Arc<NetworkService<Block, <Block as BlockT>::Hash>>,
299299
/// The transaction pool of the node.
300300
pub transaction_pool: Arc<TransactionPool>,
301+
/// The rpc handlers of the node.
302+
pub rpc_handlers: RpcHandlers,
301303
}
302304

303305
/// Creates a full service from the configuration.
@@ -358,7 +360,7 @@ pub fn new_full_base(
358360
let enable_grandpa = !config.disable_grandpa;
359361
let prometheus_registry = config.prometheus_registry().cloned();
360362

361-
let _rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
363+
let rpc_handlers = sc_service::spawn_tasks(sc_service::SpawnTasksParams {
362364
config,
363365
backend,
364366
client: client.clone(),
@@ -507,7 +509,7 @@ pub fn new_full_base(
507509
}
508510

509511
network_starter.start_network();
510-
Ok(NewFullBase { task_manager, client, network, transaction_pool })
512+
Ok(NewFullBase { task_manager, client, network, transaction_pool, rpc_handlers })
511513
}
512514

513515
/// Builds a new service for a full client.

0 commit comments

Comments
 (0)