mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-17 02:01:02 +00:00
Companion PR for https://github.com/paritytech/substrate/pull/7463 (#1948)
* Adapt service creation to new substrate API * Fix test * WIP * Revert "WIP" This reverts commit 816a3633e91abc943b12b2bfa77ce98b959e78b2. * WIP * Adapt to current code * Fix tests * Yet another fix * CLEANUP * WIP * WIP * WIP * Adapt code to changes on substrate * Adapt code * Introduce kick. * Fixes * WIP * WIP * WIP * WIP * Bump * Update sp-io * WIP Co-authored-by: Gav Wood <gavin@parity.io> Co-authored-by: Parity Benchmarking Bot <admin@parity.io>
This commit is contained in:
@@ -18,7 +18,7 @@ use log::info;
|
||||
use wasm_bindgen::prelude::*;
|
||||
use browser_utils::{
|
||||
Client,
|
||||
browser_configuration, set_console_error_panic_hook, init_console_log,
|
||||
browser_configuration, init_logging_and_telemetry, set_console_error_panic_hook,
|
||||
};
|
||||
|
||||
/// Starts the client.
|
||||
@@ -29,13 +29,14 @@ pub async fn start_client(chain_spec: String, log_level: String) -> Result<Clien
|
||||
.map_err(|err| JsValue::from_str(&err.to_string()))
|
||||
}
|
||||
|
||||
async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Box<dyn std::error::Error>> {
|
||||
async fn start_inner(chain_spec: String, log_directives: String) -> Result<Client, Box<dyn std::error::Error>> {
|
||||
set_console_error_panic_hook();
|
||||
init_console_log(log_level.parse()?)?;
|
||||
let telemetry_worker = init_logging_and_telemetry(&log_directives)?;
|
||||
|
||||
let chain_spec = service::PolkadotChainSpec::from_json_bytes(chain_spec.as_bytes().to_vec())
|
||||
.map_err(|e| format!("{:?}", e))?;
|
||||
let config = browser_configuration(chain_spec).await?;
|
||||
let telemetry_handle = telemetry_worker.handle();
|
||||
let config = browser_configuration(chain_spec, Some(telemetry_handle)).await?;
|
||||
|
||||
info!("Polkadot browser node");
|
||||
info!(" version {}", config.impl_version);
|
||||
@@ -45,7 +46,9 @@ async fn start_inner(chain_spec: String, log_level: String) -> Result<Client, Bo
|
||||
info!("👤 Role: {}", config.display_role());
|
||||
|
||||
// Create the service. This is the most heavy initialization step.
|
||||
let (task_manager, rpc_handlers) = service::build_light(config).map_err(|e| format!("{:?}", e))?;
|
||||
let (task_manager, rpc_handlers, _) = service::build_light(config).map_err(|e| format!("{:?}", e))?;
|
||||
|
||||
task_manager.spawn_handle().spawn("telemetry", telemetry_worker.run());
|
||||
|
||||
Ok(browser_utils::start_client(task_manager, rpc_handlers))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user