From dcd11d72359bff87cc3122171882272b5040cebe Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 27 Oct 2026 03:24:20 +0100 Subject: add libp2p relay support --- src/config/mod.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'src/config/mod.rs') diff --git a/src/config/mod.rs b/src/config/mod.rs index 9e63362..8ab634c 100644 --- a/src/config/mod.rs +++ b/src/config/mod.rs @@ -256,6 +256,20 @@ pub(crate) const OPTIONS: &[OptionSpec] = &[ None, "With the libp2p transport: the addresses to publish in the member list instead of those listened on, e.g. a public address forwarded to this node's listen port. Without, the listen addresses are published, loopback and link-local ones left out.", ), + option( + "libp2p-relay", + Kind::Flag, + "BOOL", + Some("false"), + "With the libp2p transport: relay for other nodes of the swarm that can't be dialled (bounded: 64 circuits, 8 per peer, each up to an hour and 1 GiB). Needs a listen address others can dial.", + ), + option( + "libp2p-relays", + Kind::List, + "MULTIADDR,[MULTIADDR...]", + None, + "With the libp2p transport: relays to be reachable through (multiaddrs, with or without the relay's peer ID), e.g. members started with libp2p-relay. Only these are used; never public ones.", + ), option( "libp2p-key-file", Kind::Text, @@ -378,6 +392,12 @@ pub(crate) struct Settings { #[serde(default)] #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] pub(crate) libp2p_announce: Vec, + #[serde(default)] + #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] + pub(crate) libp2p_relay: bool, + #[serde(default)] + #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] + pub(crate) libp2p_relays: Vec, #[cfg_attr(not(feature = "libp2p"), allow(dead_code))] pub(crate) libp2p_key_file: Option, pub(crate) mycelium_rest_url: Option, -- cgit v1.3.1