diff --git a/prdoc/pr_5250.prdoc b/prdoc/pr_5250.prdoc new file mode 100644 index 000000000000..2cac6b2383e3 --- /dev/null +++ b/prdoc/pr_5250.prdoc @@ -0,0 +1,12 @@ +title: Export `MetricsService` and add public constructor to `RpcHandlers` + +doc: + - audience: Node Dev + description: | + `sc-service` was missing just a couple of things in public API in order to make it possible to recreate its + `spawn_tasks`, specifically `MetricsService` struct and `RpcHandlers` didn't have public constructor, which were + both finally addressed. + +crates: + - name: sc-service + bump: patch diff --git a/substrate/client/service/src/builder.rs b/substrate/client/service/src/builder.rs index c8ccae28741e..aa0efdc3ae91 100644 --- a/substrate/client/service/src/builder.rs +++ b/substrate/client/service/src/builder.rs @@ -508,7 +508,7 @@ where }; let rpc = start_rpc_servers(&config, gen_rpc_module, rpc_id_provider)?; - let rpc_handlers = RpcHandlers(Arc::new(gen_rpc_module(sc_rpc::DenyUnsafe::No)?.into())); + let rpc_handlers = RpcHandlers::new(Arc::new(gen_rpc_module(sc_rpc::DenyUnsafe::No)?.into())); // Spawn informant task spawn_handle.spawn( diff --git a/substrate/client/service/src/lib.rs b/substrate/client/service/src/lib.rs index f54146a58979..efd9dad76bd4 100644 --- a/substrate/client/service/src/lib.rs +++ b/substrate/client/service/src/lib.rs @@ -64,6 +64,7 @@ pub use self::{ }, client::{ClientConfig, LocalCallExecutor}, error::Error, + metrics::MetricsService, }; #[allow(deprecated)] pub use builder::new_native_or_wasm_executor; @@ -109,6 +110,11 @@ pub trait ClientExt> { } impl RpcHandlers { + /// Create PRC handlers instance. + pub fn new(inner: Arc>) -> Self { + Self(inner) + } + /// Starts an RPC query. /// /// The query is passed as a string and must be valid JSON-RPC request object.