pub struct Config {Show 15 fields
pub alias: Alias,
pub listen: Vec<SocketAddr>,
pub peers: PeerConfig,
pub connect: HashSet<ConnectAddress>,
pub external_addresses: Vec<Address>,
pub proxy: Option<SocketAddr>,
pub onion: Option<AddressConfig>,
pub network: Network,
pub log: LogLevel,
pub relay: Relay,
pub limits: Limits,
pub workers: Workers,
pub seeding_policy: DefaultSeedingPolicy,
pub extra: Map<String, Value>,
pub secret: Option<PathBuf>,
}Expand description
Service configuration.
Fields§
§alias: AliasNode alias.
listen: Vec<SocketAddr>Socket address (a combination of IPv4 or IPv6 address and TCP port) to listen on.
peers: PeerConfigPeer configuration.
connect: HashSet<ConnectAddress>Peers to connect to on startup. Connections to these peers will be maintained.
external_addresses: Vec<Address>Specify the node’s public addresses
proxy: Option<SocketAddr>Global proxy.
onion: Option<AddressConfig>Onion address config.
network: NetworkPeer-to-peer network.
log: LogLevelLog level.
relay: RelayWhether or not our node should relay messages.
limits: LimitsConfigured service limits.
workers: WorkersNumber of worker threads to spawn.
seeding_policy: DefaultSeedingPolicyDefault seeding policy.
extra: Map<String, Value>Extra fields that aren’t supported.
secret: Option<PathBuf>Path to a file containing an Ed25519 secret key, in OpenSSH format, i.e.
with the -----BEGIN OPENSSH PRIVATE KEY----- header. The corresponding
public key will be used as the Node ID.
A decryption password cannot be configured, but passed at runtime via
the environment variable RAD_PASSPHRASE.
Implementations§
Source§impl Config
impl Config
pub fn test(alias: Alias) -> Config
pub fn new(alias: Alias) -> Config
pub fn peer(&self, id: &PublicKey) -> Option<&Address>
pub fn peers(&self) -> impl Iterator<Item = PublicKey>
pub fn is_persistent(&self, id: &PublicKey) -> bool
Sourcepub fn is_relay(&self) -> bool
pub fn is_relay(&self) -> bool
Are we a relay node? This determines what we do with gossip messages from other peers.
pub fn features(&self) -> Features
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Config, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Config
impl Serialize for Config
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more