diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 23 |
1 files changed, 23 insertions, 0 deletions
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::<libp2p::Multiaddr>() + .with_context(|| format!("libp2p-listen {address:?}")) + }) + .collect::<Result<Vec<_>>>()?; + 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!( |
