From d1926800dfdbfba213a0b5060777055d8b1dbae4 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Oct 2026 02:22:24 +0100 Subject: add libp2p transport --- src/main.rs | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 435f83a..3ab51d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -176,6 +176,29 @@ async fn main() -> Result<()> { Arc::new(mycelium::MyceliumTransport::connect(setup).await?), ) } + #[cfg(feature = "libp2p")] + "libp2p" => { + let listen = args + .libp2p_listen + .iter() + .map(|address| { + address + .parse::() + .with_context(|| format!("libp2p-listen {address:?}")) + }) + .collect::>>()?; + let key = transport::p2p::Libp2pConfig::load_key(args.libp2p_key_file.as_deref())?; + ( + "libp2p", + Arc::new(transport::p2p::Libp2pTransport::start( + transport::p2p::Libp2pConfig { + key, + listen, + memory: false, + }, + )?), + ) + } other => anyhow::bail!("transports: no {other} in this build"), }; debug!( -- cgit v1.3.1