mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-08 15:57:21 +00:00
Companion for https://github.com/paritytech/substrate/pull/8143
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use browser_utils::{browser_configuration, init_logging_and_telemetry, set_console_error_panic_hook, Client};
|
||||
use browser_utils::{browser_configuration, init_logging, set_console_error_panic_hook, Client};
|
||||
use log::info;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
@@ -26,12 +26,11 @@ pub async fn start_client(chain_spec: String, log_level: String) -> Result<Clien
|
||||
|
||||
async fn start_inner(chain_spec: String, log_directives: String) -> Result<Client, Box<dyn std::error::Error>> {
|
||||
set_console_error_panic_hook();
|
||||
let telemetry_worker = init_logging_and_telemetry(&log_directives)?;
|
||||
init_logging(&log_directives)?;
|
||||
|
||||
let chain_spec =
|
||||
service::PolkadotChainSpec::from_json_bytes(chain_spec.as_bytes().to_vec()).map_err(|e| format!("{:?}", e))?;
|
||||
let telemetry_handle = telemetry_worker.handle();
|
||||
let config = browser_configuration(chain_spec, Some(telemetry_handle)).await?;
|
||||
let config = browser_configuration(chain_spec).await?;
|
||||
|
||||
info!("Polkadot browser node");
|
||||
info!(" version {}", config.impl_version);
|
||||
@@ -41,9 +40,7 @@ async fn start_inner(chain_spec: String, log_directives: String) -> Result<Clien
|
||||
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))?;
|
||||
|
||||
task_manager.spawn_handle().spawn("telemetry", telemetry_worker.run());
|
||||
let (task_manager, rpc_handlers) = service::build_light(config).map_err(|e| format!("{:?}", e))?;
|
||||
|
||||
Ok(browser_utils::start_client(task_manager, rpc_handlers))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user