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/config/mod.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 21a8733..dd025a2 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -242,6 +242,20 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ Some("mycelium"), "The transports this node uses, in order of preference: mycelium, libp2p (in builds with the libp2p feature). A peer is reached on the first one both have; nodes on several carry the traffic between nodes that share none.", ), + option( + "libp2p-listen", + Kind::List, + "MULTIADDR,[MULTIADDR...]", + None, + "With the libp2p transport: where to listen, e.g. /ip4/0.0.0.0/tcp/9661 and /ip4/0.0.0.0/udp/9661/quic-v1. Without, the node only connects out. The addresses it listens on are published in the member list.", + ), + option( + "libp2p-key-file", + Kind::Text, + "PATH", + None, + "With the libp2p transport: its key (Ed25519, 32 raw bytes), which makes its peer ID; a new one each start if absent (the node ID stays the same either way).", + ), option( "mycelium-rest-url", Kind::Text, @@ -351,6 +365,11 @@ pub(crate) struct Settings { pub(crate) blob_chunk: u64, #[serde(default = "default_transports")] pub(crate) transports: Vec, + #[serde(default)] + #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] + pub(crate) libp2p_listen: Vec, + #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] + pub(crate) libp2p_key_file: Option, pub(crate) mycelium_rest_url: Option, pub(crate) mycelium_key_file: Option, pub(crate) mycelium_network_key_file: Option, -- cgit v1.3.1