Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit f4a52a3

Browse files
committed
Fix browser node compilation
1 parent 0e6406d commit f4a52a3

File tree

3 files changed

+21
-12
lines changed

3 files changed

+21
-12
lines changed

cli/src/browser.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo
4646
info!("👤 Role: {}", config.display_role());
4747

4848
// Create the service. This is the most heavy initialization step.
49-
let service = service::kusama_new_light(config)
49+
let (keep_alive, rpc_handlers) = service::kusama_new_light(config)
5050
.map_err(|e| format!("{:?}", e))?;
5151

52-
Ok(browser_utils::start_client(service))
52+
Ok(browser_utils::start_client(keep_alive.task_manager, rpc_handlers))
5353
}

cli/src/command.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub fn run() -> Result<()> {
118118

119119
runtime.run_node(
120120
|config| {
121-
service::kusama_new_light(config)
121+
service::kusama_new_light(config).map(|(components, _)| components)
122122
},
123123
|config| {
124124
service::kusama_new_full(
@@ -136,7 +136,7 @@ pub fn run() -> Result<()> {
136136
} else if chain_spec.is_westend() {
137137
runtime.run_node(
138138
|config| {
139-
service::westend_new_light(config)
139+
service::westend_new_light(config).map(|(components, _)| components)
140140
},
141141
|config| {
142142
service::westend_new_full(
@@ -154,7 +154,7 @@ pub fn run() -> Result<()> {
154154
} else {
155155
runtime.run_node(
156156
|config| {
157-
service::polkadot_new_light(config)
157+
service::polkadot_new_light(config).map(|(components, _)| components)
158158
},
159159
|config| {
160160
service::polkadot_new_full(

service/src/lib.rs

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use grandpa::{self, FinalityProofProvider as GrandpaFinalityProofProvider};
3030
use sc_executor::native_executor_instance;
3131
use log::info;
3232
pub use service::{
33-
Role, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis,
33+
Role, PruningMode, TransactionPoolOptions, Error, RuntimeGenesis, RpcHandlers,
3434
TFullClient, TLightClient, TFullBackend, TLightBackend, TFullCallExecutor, TLightCallExecutor,
3535
Configuration, ChainSpec, ServiceBuilderCommand, ServiceComponents, KeepAliveServiceComponents,
3636
};
@@ -635,9 +635,12 @@ macro_rules! new_light {
635635
})?
636636
.build_light()
637637
.map(|ServiceComponents { task_manager, telemetry, base_path, rpc, rpc_handlers, .. }| {
638-
KeepAliveServiceComponents {
639-
task_manager, other: Box::new((telemetry, base_path, rpc, rpc_handlers))
640-
}
638+
(
639+
KeepAliveServiceComponents {
640+
task_manager, other: Box::new((telemetry, base_path, rpc))
641+
},
642+
rpc_handlers,
643+
)
641644
})
642645
}}
643646
}
@@ -777,19 +780,25 @@ pub struct FullNodeHandles {
777780
}
778781

779782
/// Create a new Polkadot service for a light client.
780-
pub fn polkadot_new_light(mut config: Configuration) -> Result<KeepAliveServiceComponents, ServiceError>
783+
pub fn polkadot_new_light(mut config: Configuration) -> Result<
784+
(KeepAliveServiceComponents, RpcHandlers), ServiceError
785+
>
781786
{
782787
new_light!(config, polkadot_runtime::RuntimeApi, PolkadotExecutor)
783788
}
784789

785790
/// Create a new Kusama service for a light client.
786-
pub fn kusama_new_light(mut config: Configuration) -> Result<KeepAliveServiceComponents, ServiceError>
791+
pub fn kusama_new_light(mut config: Configuration) -> Result<
792+
(KeepAliveServiceComponents, RpcHandlers), ServiceError
793+
>
787794
{
788795
new_light!(config, kusama_runtime::RuntimeApi, KusamaExecutor)
789796
}
790797

791798
/// Create a new Westend service for a light client.
792-
pub fn westend_new_light(mut config: Configuration, ) -> Result<KeepAliveServiceComponents, ServiceError>
799+
pub fn westend_new_light(mut config: Configuration, ) -> Result<
800+
(KeepAliveServiceComponents, RpcHandlers), ServiceError
801+
>
793802
{
794803
new_light!(config, westend_runtime::RuntimeApi, KusamaExecutor)
795804
}

0 commit comments

Comments
 (0)