pub struct Config {Show 14 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: Level,
pub relay: Relay,
pub limits: Limits,
pub workers: usize,
pub seeding_policy: DefaultSeedingPolicy,
pub extra: Map<String, Value>,
}
Expand description
Service configuration.
Fields§
§alias: Alias
Node alias.
listen: Vec<SocketAddr>
Socket address (a combination of IPv4 or IPv6 address and TCP port) to listen on.
peers: PeerConfig
Peer 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: Network
Peer-to-peer network.
log: Level
Log level.
relay: Relay
Whether or not our node should relay messages.
limits: Limits
Configured service limits.
workers: usize
Number of worker threads to spawn.
seeding_policy: DefaultSeedingPolicy
Default seeding policy.
extra: Map<String, Value>
Extra fields that aren’t supported.
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>,
Deserialize this value from the given Serde deserializer. Read more
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,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin 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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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