mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 07:41:08 +00:00
Use libp2p's implementation of a wasm websocket transport (#5089)
* Update to libp2p 0.16.2 * Use libp2ps implementation of a wasm websocket transport * Remove explicit Configuration type in node-cli Co-authored-by: Pierre Krieger <pierre.krieger1708@gmail.com>
This commit is contained in:
@@ -26,25 +26,23 @@ use futures::{prelude::*, channel::{oneshot, mpsc}, future::{poll_fn, ok}, compa
|
||||
use std::task::Poll;
|
||||
use std::pin::Pin;
|
||||
use sc_chain_spec::Extension;
|
||||
use libp2p_wasm_ext::{ExtTransport, ffi};
|
||||
|
||||
pub use libp2p::wasm_ext::{ExtTransport, ffi::Transport};
|
||||
pub use console_error_panic_hook::set_once as set_console_error_panic_hook;
|
||||
pub use console_log::init_with_level as init_console_log;
|
||||
|
||||
/// Create a service configuration from a chain spec and the websocket transport.
|
||||
/// Create a service configuration from a chain spec.
|
||||
///
|
||||
/// This configuration contains good defaults for a browser light client.
|
||||
pub async fn browser_configuration<G, E>(
|
||||
transport: Transport,
|
||||
chain_spec: ChainSpec<G, E>,
|
||||
) -> Result<Configuration<G, E>, Box<dyn std::error::Error>>
|
||||
pub async fn browser_configuration<G, E>(chain_spec: ChainSpec<G, E>)
|
||||
-> Result<Configuration<G, E>, Box<dyn std::error::Error>>
|
||||
where
|
||||
G: RuntimeGenesis,
|
||||
E: Extension,
|
||||
{
|
||||
let name = chain_spec.name().to_string();
|
||||
|
||||
let transport = ExtTransport::new(transport);
|
||||
let transport = ExtTransport::new(ffi::websocket_transport());
|
||||
let mut config = Configuration::default();
|
||||
config.network.boot_nodes = chain_spec.boot_nodes().to_vec();
|
||||
config.telemetry_endpoints = chain_spec.telemetry_endpoints().clone();
|
||||
|
||||
Reference in New Issue
Block a user