pub struct SpawnedCluster { /* private fields */ }Expand description
A running regtest cluster containing Bitcoin Core and LND containers.
Implementations§
Source§impl SpawnedCluster
impl SpawnedCluster
Sourcepub async fn spawn(config: SpawnLndConfig) -> Result<Self, SpawnError>
pub async fn spawn(config: SpawnLndConfig) -> Result<Self, SpawnError>
Spawn a cluster using a validated config and a default Docker connection.
Sourcepub async fn spawn_with_docker(
docker: DockerClient,
config: SpawnLndConfig,
) -> Result<Self, SpawnError>
pub async fn spawn_with_docker( docker: DockerClient, config: SpawnLndConfig, ) -> Result<Self, SpawnError>
Spawn a cluster using a caller-provided Docker client.
Sourcepub fn cluster_id(&self) -> &str
pub fn cluster_id(&self) -> &str
Return the generated cluster id used in Docker labels.
Sourcepub fn config(&self) -> &SpawnLndConfig
pub fn config(&self) -> &SpawnLndConfig
Return the config used to spawn this cluster.
Sourcepub fn bitcoinds(&self) -> &[BitcoinCore]
pub fn bitcoinds(&self) -> &[BitcoinCore]
Return all spawned Bitcoin Core chain groups.
Sourcepub fn node(&self, alias: &str) -> Option<&SpawnedNode>
pub fn node(&self, alias: &str) -> Option<&SpawnedNode>
Look up a spawned LND node by alias.
Sourcepub fn nodes(&self) -> impl Iterator<Item = &SpawnedNode>
pub fn nodes(&self) -> impl Iterator<Item = &SpawnedNode>
Iterate spawned LND nodes in configured order.
Sourcepub fn node_aliases(&self) -> impl Iterator<Item = &str>
pub fn node_aliases(&self) -> impl Iterator<Item = &str>
Iterate node aliases in configured order.
Sourcepub fn node_configs(&self) -> Vec<LndNodeConfig>
pub fn node_configs(&self) -> Vec<LndNodeConfig>
Build connection configs for all LND nodes.
Sourcepub async fn connect_nodes(&self) -> Result<LndNodeClients, SpawnError>
pub async fn connect_nodes(&self) -> Result<LndNodeClients, SpawnError>
Connect to all LND nodes with lnd_grpc_rust.
Sourcepub async fn connect_peer(
&self,
from_alias: &str,
to_alias: &str,
) -> Result<PeerConnection, SpawnError>
pub async fn connect_peer( &self, from_alias: &str, to_alias: &str, ) -> Result<PeerConnection, SpawnError>
Connect one LND node to another over the Docker bridge network.
Sourcepub async fn connect_all_peers(&self) -> Result<Vec<PeerConnection>, SpawnError>
pub async fn connect_all_peers(&self) -> Result<Vec<PeerConnection>, SpawnError>
Connect every LND node to every other LND node.
Sourcepub async fn fund_node(&self, alias: &str) -> Result<FundingReport, SpawnError>
pub async fn fund_node(&self, alias: &str) -> Result<FundingReport, SpawnError>
Fund one LND node with DEFAULT_FUNDING_AMOUNT_BTC.
Sourcepub async fn fund_node_with_amount(
&self,
alias: &str,
amount_btc: f64,
) -> Result<FundingReport, SpawnError>
pub async fn fund_node_with_amount( &self, alias: &str, amount_btc: f64, ) -> Result<FundingReport, SpawnError>
Fund one LND node with a caller-provided BTC amount.
Sourcepub async fn fund_nodes<I, S>(
&self,
aliases: I,
) -> Result<Vec<FundingReport>, SpawnError>
pub async fn fund_nodes<I, S>( &self, aliases: I, ) -> Result<Vec<FundingReport>, SpawnError>
Batch-fund multiple LND nodes with DEFAULT_FUNDING_AMOUNT_BTC each.
Sourcepub async fn fund_nodes_with_amount<I, S>(
&self,
aliases: I,
amount_btc: f64,
) -> Result<Vec<FundingReport>, SpawnError>
pub async fn fund_nodes_with_amount<I, S>( &self, aliases: I, amount_btc: f64, ) -> Result<Vec<FundingReport>, SpawnError>
Batch-fund multiple LND nodes with the same caller-provided BTC amount.
Sourcepub async fn open_channel(
&self,
from_alias: &str,
to_alias: &str,
) -> Result<ChannelReport, SpawnError>
pub async fn open_channel( &self, from_alias: &str, to_alias: &str, ) -> Result<ChannelReport, SpawnError>
Open a public channel with DEFAULT_CHANNEL_CAPACITY_SAT.
Sourcepub async fn open_channel_with_amount(
&self,
from_alias: &str,
to_alias: &str,
local_funding_amount_sat: i64,
) -> Result<ChannelReport, SpawnError>
pub async fn open_channel_with_amount( &self, from_alias: &str, to_alias: &str, local_funding_amount_sat: i64, ) -> Result<ChannelReport, SpawnError>
Open a public channel with a caller-provided satoshi capacity.
Sourcepub async fn shutdown(&mut self) -> Result<CleanupReport, SpawnError>
pub async fn shutdown(&mut self) -> Result<CleanupReport, SpawnError>
Stop and remove all containers in this cluster unless keep_containers is set.
Trait Implementations§
Source§impl Debug for SpawnedCluster
impl Debug for SpawnedCluster
Auto Trait Implementations§
impl Freeze for SpawnedCluster
impl !RefUnwindSafe for SpawnedCluster
impl Send for SpawnedCluster
impl Sync for SpawnedCluster
impl Unpin for SpawnedCluster
impl UnsafeUnpin for SpawnedCluster
impl !UnwindSafe for SpawnedCluster
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> 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