pub struct LndDaemon {
pub alias: String,
pub container: SpawnedContainer,
pub cert_hex: String,
pub macaroon_hex: String,
pub rpc_socket: String,
pub p2p_socket: String,
pub public_key: String,
}Expand description
A running LND container and authenticated connection material.
Fields§
§alias: StringLND alias.
container: SpawnedContainerDocker container metadata.
cert_hex: StringHex-encoded TLS certificate.
macaroon_hex: StringHex-encoded admin macaroon.
rpc_socket: StringHost gRPC socket, usually 127.0.0.1:<port>.
p2p_socket: StringHost P2P socket, usually 127.0.0.1:<port>.
public_key: StringLND identity public key.
Implementations§
Source§impl LndDaemon
impl LndDaemon
Sourcepub async fn spawn(
docker: &DockerClient,
bitcoind: &BitcoinCore,
config: LndConfig,
) -> Result<Self, LndError>
pub async fn spawn( docker: &DockerClient, bitcoind: &BitcoinCore, config: LndConfig, ) -> Result<Self, LndError>
Spawn an LND container, initialize its wallet, and wait for chain sync.
Sourcepub fn node_config(&self) -> LndNodeConfig
pub fn node_config(&self) -> LndNodeConfig
Build an lnd_grpc_rust connection config for this node.
Sourcepub async fn connect(&self) -> Result<LndClient, LndError>
pub async fn connect(&self) -> Result<LndClient, LndError>
Connect to this node using its TLS certificate and admin macaroon.
Sourcepub async fn wait_synced_to_chain(&self) -> Result<GetInfoResponse, LndError>
pub async fn wait_synced_to_chain(&self) -> Result<GetInfoResponse, LndError>
Wait until GetInfo reports synced_to_chain.
Sourcepub async fn new_address(&self) -> Result<String, LndError>
pub async fn new_address(&self) -> Result<String, LndError>
Generate a new LND wallet address.
Sourcepub async fn connect_peer(
&self,
public_key: impl Into<String>,
host: impl Into<String>,
) -> Result<ConnectPeerResponse, LndError>
pub async fn connect_peer( &self, public_key: impl Into<String>, host: impl Into<String>, ) -> Result<ConnectPeerResponse, LndError>
Connect this LND node to a peer by public key and host socket.
Sourcepub async fn wallet_balance(
&self,
min_confs: i32,
) -> Result<WalletBalanceResponse, LndError>
pub async fn wallet_balance( &self, min_confs: i32, ) -> Result<WalletBalanceResponse, LndError>
Return LND wallet balance with the given minimum confirmations.
Sourcepub async fn list_unspent(
&self,
min_confs: i32,
max_confs: i32,
) -> Result<Vec<Utxo>, LndError>
pub async fn list_unspent( &self, min_confs: i32, max_confs: i32, ) -> Result<Vec<Utxo>, LndError>
Return wallet UTXOs matching the confirmation range.
Sourcepub async fn wait_for_spendable_balance(
&self,
minimum_sat: i64,
) -> Result<WalletBalanceResponse, LndError>
pub async fn wait_for_spendable_balance( &self, minimum_sat: i64, ) -> Result<WalletBalanceResponse, LndError>
Wait until confirmed wallet balance is at least minimum_sat.
Sourcepub async fn wait_for_spendable_utxos(
&self,
minimum_sat: i64,
) -> Result<Vec<Utxo>, LndError>
pub async fn wait_for_spendable_utxos( &self, minimum_sat: i64, ) -> Result<Vec<Utxo>, LndError>
Wait until spendable UTXOs total at least minimum_sat.
Sourcepub async fn open_channel_sync(
&self,
remote_public_key: &str,
local_funding_amount_sat: i64,
push_sat: i64,
) -> Result<ChannelPoint, LndError>
pub async fn open_channel_sync( &self, remote_public_key: &str, local_funding_amount_sat: i64, push_sat: i64, ) -> Result<ChannelPoint, LndError>
Open a public channel synchronously through LND.
Sourcepub async fn pending_channels(
&self,
) -> Result<PendingChannelsResponse, LndError>
pub async fn pending_channels( &self, ) -> Result<PendingChannelsResponse, LndError>
Return LND pending channel state.
Sourcepub async fn list_channels(
&self,
remote_public_key: Option<&str>,
) -> Result<Vec<Channel>, LndError>
pub async fn list_channels( &self, remote_public_key: Option<&str>, ) -> Result<Vec<Channel>, LndError>
List channels, optionally filtered by remote public key.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for LndDaemon
impl RefUnwindSafe for LndDaemon
impl Send for LndDaemon
impl Sync for LndDaemon
impl Unpin for LndDaemon
impl UnsafeUnpin for LndDaemon
impl UnwindSafe for LndDaemon
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request