-
- All Implemented Interfaces:
-
java.lang.AutoCloseable,org.bitcoindevkit.CbfBuilderInterface,org.bitcoindevkit.Disposable
public class CbfBuilder implements Disposable, AutoCloseable, CbfBuilderInterface
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 see `ScanType`.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
Walletlookaheadvalue will be used. To ensure all transactions are recovered, thelookaheadshould be roughly the number of transactions in the wallet history.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCbfBuilder.Companion
-
Constructor Summary
Constructors Constructor Description CbfBuilder(Pointer pointer)CbfBuilder(NoPointer noPointer)This constructor can be used to instantiate a fake object. CbfBuilder()Start a new `CbfBuilder`
-
Method Summary
Modifier and Type Method Description Unitdestroy()Unitclose()final PointeruniffiClonePointer()CbfComponentsbuild(Wallet wallet)Construct a `CbfComponents` for a `Wallet`. CbfBuilderconfigureTimeoutMillis(ULong handshake, ULong response)Configure the time in milliseconds that a node has to: Respond to the initial connection
Respond to a request
CbfBuilderconnections(UByte connections)The number of connections for the light client to maintain. CbfBuilderdataDir(String dataDir)Directory to store block headers and peers. CbfBuilderpeers(List<Peer> peers)Bitcoin full-nodes to attempt a connection with. CbfBuilderscanType(ScanType scanType)Select between syncing, recovering, or scanning for new wallets. CbfBuildersocks5Proxy(Socks5Proxy proxy)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 at127.0.0.1:9050`.-
-
Method Detail
-
uniffiClonePointer
final Pointer uniffiClonePointer()
-
build
CbfComponents build(Wallet wallet)
Construct a `CbfComponents` for a `Wallet`.
-
configureTimeoutMillis
CbfBuilder configureTimeoutMillis(ULong handshake, ULong response)
Configure the time in milliseconds that a node has to:
Respond to the initial connection
Respond to a request
-
connections
CbfBuilder connections(UByte connections)
The number of connections for the light client to maintain. Default is two.
-
dataDir
CbfBuilder dataDir(String dataDir)
Directory to store block headers and peers. If none is provided, the current working directory will be used.
-
peers
CbfBuilder peers(List<Peer> peers)
Bitcoin full-nodes to attempt a connection with.
-
scanType
CbfBuilder scanType(ScanType scanType)
Select between syncing, recovering, or scanning for new wallets.
-
socks5Proxy
CbfBuilder socks5Proxy(Socks5Proxy proxy)
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 at127.0.0.1:9050`.
-
-
-