File tree Expand file tree Collapse file tree
substrate/client/service/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ title: Export `MetricsService` and add public constructor to `RpcHandlers`
2+
3+ doc:
4+ - audience: Node Dev
5+ description: |
6+ `sc-service` was missing just a couple of things in public API in order to make it possible to recreate its
7+ `spawn_tasks`, specifically `MetricsService` struct and `RpcHandlers` didn't have public constructor, which were
8+ both finally addressed.
9+
10+ crates:
11+ - name: sc-service
12+ bump: patch
Original file line number Diff line number Diff line change @@ -509,7 +509,7 @@ where
509509 } ;
510510
511511 let rpc = start_rpc_servers ( & config, gen_rpc_module, rpc_id_provider) ?;
512- let rpc_handlers = RpcHandlers ( Arc :: new ( gen_rpc_module ( sc_rpc:: DenyUnsafe :: No ) ?. into ( ) ) ) ;
512+ let rpc_handlers = RpcHandlers :: new ( Arc :: new ( gen_rpc_module ( sc_rpc:: DenyUnsafe :: No ) ?. into ( ) ) ) ;
513513
514514 // Spawn informant task
515515 spawn_handle. spawn (
Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ pub use self::{
6262 } ,
6363 client:: { ClientConfig , LocalCallExecutor } ,
6464 error:: Error ,
65+ metrics:: MetricsService ,
6566} ;
6667#[ allow( deprecated) ]
6768pub use builder:: new_native_or_wasm_executor;
@@ -101,6 +102,11 @@ const DEFAULT_PROTOCOL_ID: &str = "sup";
101102pub struct RpcHandlers ( Arc < RpcModule < ( ) > > ) ;
102103
103104impl RpcHandlers {
105+ /// Create PRC handlers instance.
106+ pub fn new ( inner : Arc < RpcModule < ( ) > > ) -> Self {
107+ Self ( inner)
108+ }
109+
104110 /// Starts an RPC query.
105111 ///
106112 /// The query is passed as a string and must be valid JSON-RPC request object.
You can’t perform that action at this time.
0 commit comments