Package 

Class CbfClient

  • All Implemented Interfaces:
    java.lang.AutoCloseable , org.bitcoindevkit.CbfClientInterface , org.bitcoindevkit.Disposable

    
    public class CbfClient
     implements Disposable, AutoCloseable, CbfClientInterface
                        

    A `CbfClient` handles wallet updates from a `CbfNode`.

    • Method Detail

      • averageFeeRate

         FeeRate averageFeeRate(BlockHash blockhash)

        Fetch the average fee rate for a block by requesting it from a peer. Not recommend for resource-limited devices.

      • broadcast

         Wtxid broadcast(Transaction transaction)

        Broadcast a transaction to the network, erroring if the node has stopped running.

      • connect

         Unit connect(Peer peer)

        Add another `Peer` to attempt a connection with.

      • isRunning

         Boolean isRunning()

        Check if the node is still running in the background.

      • lookupHost

         List<IpAddress> lookupHost(String hostname)

        Query a Bitcoin DNS seeder using the configured resolver.

        This is not a generic DNS implementation. Host names are prefixed with a x849 to filter for compact block filter nodes from the seeder. For example dns.myseeder.com will be queried as x849.dns.myseeder.com. This has no guarantee to return any IpAddr.

      • minBroadcastFeerate

         FeeRate minBroadcastFeerate()

        The minimum fee rate required to broadcast a transcation to all connected peers.

      • nextInfo

         Info nextInfo()

        Return the next available info message from a node. If none is returned, the node has stopped.

      • nextWarning

         Warning nextWarning()

        Return the next available warning message from a node. If none is returned, the node has stopped.

      • shutdown

         Unit shutdown()

        Stop the `CbfNode`. Errors if the node is already stopped.

      • update

         Update update()

        Return an `Update`. This is method returns once the node syncs to the rest of the network or a new block has been gossiped.