Struct Config

Source
pub struct Config {
    pub storage_dir_path: String,
    pub network: Network,
    pub listening_addresses: Option<Vec<SocketAddress>>,
    pub announcement_addresses: Option<Vec<SocketAddress>>,
    pub node_alias: Option<NodeAlias>,
    pub trusted_peers_0conf: Vec<PublicKey>,
    pub probing_liquidity_limit_multiplier: u64,
    pub anchor_channels_config: Option<AnchorChannelsConfig>,
    pub sending_parameters: Option<SendingParameters>,
}
Expand description

Represents the configuration of an Node instance.

§Defaults

ParameterValue
storage_dir_path/tmp/ldk_node/
log_dir_pathNone
networkBitcoin
listening_addressesNone
node_aliasNone
default_cltv_expiry_delta144
onchain_wallet_sync_interval_secs80
wallet_sync_interval_secs30
fee_rate_cache_update_interval_secs600
trusted_peers_0conf[]
probing_liquidity_limit_multiplier3
log_levelDebug
anchor_channels_configSome(..)
sending_parametersNone

See AnchorChannelsConfig and SendingParameters for more information regarding their respective default values.

Fields§

§storage_dir_path: String

The path where the underlying LDK and BDK persist their data.

§network: Network

The used Bitcoin network.

§listening_addresses: Option<Vec<SocketAddress>>

The addresses on which the node will listen for incoming connections.

Note: We will only allow opening and accepting public channels if the node_alias and the listening_addresses are set.

§announcement_addresses: Option<Vec<SocketAddress>>

The addresses which the node will announce to the gossip network that it accepts connections on.

Note: If unset, the listening_addresses will be used as the list of addresses to announce.

§node_alias: Option<NodeAlias>

The node alias that will be used when broadcasting announcements to the gossip network.

The provided alias must be a valid UTF-8 string and no longer than 32 bytes in total.

Note: We will only allow opening and accepting public channels if the node_alias and the listening_addresses are set.

§trusted_peers_0conf: Vec<PublicKey>

A list of peers that we allow to establish zero confirmation channels to us.

Note: Allowing payments via zero-confirmation channels is potentially insecure if the funding transaction ends up never being confirmed on-chain. Zero-confirmation channels should therefore only be accepted from trusted peers.

§probing_liquidity_limit_multiplier: u64

The liquidity factor by which we filter the outgoing channels used for sending probes.

Channels with available liquidity less than the required amount times this value won’t be used to send pre-flight probes.

§anchor_channels_config: Option<AnchorChannelsConfig>

Configuration options pertaining to Anchor channels, i.e., channels for which the option_anchors_zero_fee_htlc_tx channel type is negotiated.

Please refer to AnchorChannelsConfig for further information on Anchor channels.

If set to Some, we’ll try to open new channels with Anchors enabled, i.e., new channels will be negotiated with the option_anchors_zero_fee_htlc_tx channel type if supported by the counterparty. Note that this won’t prevent us from opening non-Anchor channels if the counterparty doesn’t support option_anchors_zero_fee_htlc_tx. If set to None, new channels will be negotiated with the legacy option_static_remotekey channel type only.

Note: If set to None after some Anchor channels have already been opened, no dedicated emergency on-chain reserve will be maintained for these channels, which can be dangerous if only insufficient funds are available at the time of channel closure. We will however still try to get the Anchor spending transactions confirmed on-chain with the funds available.

§sending_parameters: Option<SendingParameters>

Configuration options for payment routing and pathfinding.

Setting the SendingParameters provides flexibility to customize how payments are routed, including setting limits on routing fees, CLTV expiry, and channel utilization.

Note: If unset, default parameters will be used, and you will be able to override the parameters on a per-payment basis in the corresponding method calls.

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,