pub struct BitcoinCore {
pub container: SpawnedContainer,
pub auth: BitcoinRpcAuth,
pub rpc: BitcoinRpcClient,
pub wallet_rpc: BitcoinRpcClient,
pub rpc_socket: String,
pub p2p_socket: String,
}Expand description
A running Bitcoin Core container and its RPC handles.
Fields§
§container: SpawnedContainerDocker container metadata.
auth: BitcoinRpcAuthRPC authentication generated for the node.
rpc: BitcoinRpcClientRPC client for node-level methods.
wallet_rpc: BitcoinRpcClientRPC client scoped to the default wallet.
rpc_socket: StringHost RPC socket, usually 127.0.0.1:<port>.
p2p_socket: StringHost P2P socket, usually 127.0.0.1:<port>.
Implementations§
Source§impl BitcoinCore
impl BitcoinCore
Sourcepub async fn spawn(
docker: &DockerClient,
config: BitcoinCoreConfig,
) -> Result<Self, BitcoinCoreError>
pub async fn spawn( docker: &DockerClient, config: BitcoinCoreConfig, ) -> Result<Self, BitcoinCoreError>
Spawn a Bitcoin Core container and wait until RPC is ready.
Sourcepub async fn wait_ready(&self) -> Result<BlockchainInfo, BitcoinCoreError>
pub async fn wait_ready(&self) -> Result<BlockchainInfo, BitcoinCoreError>
Wait for getblockchaininfo to succeed using the default retry policy.
Sourcepub async fn prepare_mining_wallet(
&self,
) -> Result<Vec<String>, BitcoinCoreError>
pub async fn prepare_mining_wallet( &self, ) -> Result<Vec<String>, BitcoinCoreError>
Create/load the default wallet and mine enough blocks to mature coinbase funds.
Trait Implementations§
Source§impl Clone for BitcoinCore
impl Clone for BitcoinCore
Source§fn clone(&self) -> BitcoinCore
fn clone(&self) -> BitcoinCore
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BitcoinCore
impl !RefUnwindSafe for BitcoinCore
impl Send for BitcoinCore
impl Sync for BitcoinCore
impl Unpin for BitcoinCore
impl UnsafeUnpin for BitcoinCore
impl !UnwindSafe for BitcoinCore
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> 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>
Wrap the input message
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>
Wrap the input message
T in a tonic::Request