pub struct CbfBuilder { /* private fields */ }Expand description
Build a BIP 157/158 light client to fetch transactions for a Wallet.
Options:
- List of
Peer: Bitcoin full-nodes for the light client to connect to. May be empty. connections: The number of connections for the light client to maintain.scan_type: Sync, recover, or start a new wallet. For more information seeScanType.data_dir: Optional directory to store block headers and peers.
A note on recovering wallets. Developers should allow users to provide an
approximate recovery height and an estimated number of transactions for the
wallet. When determining how many scripts to check filters for, the Wallet
lookahead value will be used. To ensure all transactions are recovered, the
lookahead should be roughly the number of transactions in the wallet history.
Implementations§
Source§impl CbfBuilder
impl CbfBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Start a new CbfBuilder
Sourcepub fn connections(&self, connections: u8) -> Arc<Self>
pub fn connections(&self, connections: u8) -> Arc<Self>
The number of connections for the light client to maintain. Default is two.
Sourcepub fn data_dir(&self, data_dir: String) -> Arc<Self>
pub fn data_dir(&self, data_dir: String) -> Arc<Self>
Directory to store block headers and peers. If none is provided, the current working directory will be used.
Sourcepub fn scan_type(&self, scan_type: ScanType) -> Arc<Self>
pub fn scan_type(&self, scan_type: ScanType) -> Arc<Self>
Select between syncing, recovering, or scanning for new wallets.
Sourcepub fn peers(&self, peers: Vec<Peer>) -> Arc<Self>
pub fn peers(&self, peers: Vec<Peer>) -> Arc<Self>
Bitcoin full-nodes to attempt a connection with.
Sourcepub fn configure_timeout_millis(
&self,
handshake: u64,
response: u64,
) -> Arc<Self>
pub fn configure_timeout_millis( &self, handshake: u64, response: u64, ) -> Arc<Self>
Configure the time in milliseconds that a node has to:
- Respond to the initial connection
- Respond to a request
Sourcepub fn socks5_proxy(&self, proxy: Socks5Proxy) -> Arc<Self>
pub fn socks5_proxy(&self, proxy: Socks5Proxy) -> Arc<Self>
Configure connections to be established through a Socks5 proxy. The vast majority of the time, the connection is to a local Tor daemon, which is typically exposed at 127.0.0.1:9050`.
Sourcepub fn build(&self, wallet: &Wallet) -> CbfComponents
pub fn build(&self, wallet: &Wallet) -> CbfComponents
Construct a CbfComponents for a Wallet.
Trait Implementations§
Source§impl Clone for CbfBuilder
impl Clone for CbfBuilder
Source§fn clone(&self) -> CbfBuilder
fn clone(&self) -> CbfBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<UT> LiftRef<UT> for CbfBuilder
impl<UT> LiftRef<UT> for CbfBuilder
type LiftType = Arc<CbfBuilder>
Source§impl<UT> LowerError<UT> for CbfBuilder
impl<UT> LowerError<UT> for CbfBuilder
Source§fn lower_error(obj: Self) -> RustBuffer
fn lower_error(obj: Self) -> RustBuffer
Source§impl<UT> LowerReturn<UT> for CbfBuilder
impl<UT> LowerReturn<UT> for CbfBuilder
Source§type ReturnType = <Arc<CbfBuilder> as LowerReturn<UniFfiTag>>::ReturnType
type ReturnType = <Arc<CbfBuilder> as LowerReturn<UniFfiTag>>::ReturnType
Source§fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
fn lower_return(obj: Self) -> Result<Self::ReturnType, RustCallError>
§fn handle_failed_lift(
error: LiftArgsError,
) -> Result<Self::ReturnType, RustCallError>
fn handle_failed_lift( error: LiftArgsError, ) -> Result<Self::ReturnType, RustCallError>
Source§impl<UT> TypeId<UT> for CbfBuilder
impl<UT> TypeId<UT> for CbfBuilder
const TYPE_ID_META: MetadataBuffer
Auto Trait Implementations§
impl Freeze for CbfBuilder
impl RefUnwindSafe for CbfBuilder
impl Send for CbfBuilder
impl Sync for CbfBuilder
impl Unpin for CbfBuilder
impl UnwindSafe for CbfBuilder
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,
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T>
unsafe fn consume_handle(handle: Handle) -> Arc<T>
Arc<> Read more