pub struct Client { /* private fields */ }
Expand description

Client implements a JSON-RPC client for the Bitcoin Core daemon or compatible APIs.

Implementations

Creates a client to a bitcoind JSON-RPC server.

Can only return Err when using cookie authentication.

Create a new Client using the given jsonrpc::Client.

Get the underlying JSONRPC client.

Trait Implementations

Formats the value using the given formatter. Read more

Call an cmd rpc with given args list

Query an object implementing Querable type

Returns a data structure containing various state info regarding blockchain processing. Read more

Returns the numbers of block in the longest chain.

Returns the hash of the best (tip) block in the longest blockchain.

Get block hash at a given height

To unlock, use [unlock_unspent].

Unlock all unspent UTXOs.

👎Deprecated

Generate new address under own control

Mine block_num blocks and pay coinbase to address Read more

Mine up to block_num blocks immediately (before the RPC call returns) to an address in the wallet. Read more

Mark a block as invalid by block_hash

Mark a block as valid by block_hash

Get txids of all transactions in a memory pool

source

fn get_mempool_entry(&self, txid: &Txid) -> Result<GetMempoolEntryResult>

Get mempool data for given transaction

Get information about all known tips in the block tree, including the main chain as well as stale branches. Read more

Attempts to add a node to the addnode list. Nodes added using addnode (or -connect) are protected from DoS disconnection and are not required to be full nodes/support SegWit as other outbound peers are (though such peers will not be synced from). Read more

Attempts to remove a node from the addnode list.

Attempts to connect to a node without permanently adding it to the addnode list.

Immediately disconnects from the specified peer node.

Returns information about the given added node, or all added nodes (note that onetry addnodes are not listed here)

Return known addresses which can potentially be used to find new nodes in the network

List all banned IPs/Subnets.

Clear all banned IPs.

Attempts to add an IP/Subnet to the banned list.

Attempts to remove an IP/Subnet from the banned list.

Disable/enable all p2p network activity.

Returns data about each connected network node as an array of PeerInfo Read more

Requests that a ping be sent to all other nodes, to measure ping time. Read more

Waits for a specific new block and returns useful info about it. Returns the current block on timeout or exit. Read more

Waits for a specific new block and returns useful info about it. Returns the current block on timeout or exit. Read more

Returns statistics about the unspent transaction output set. Note this call may take some time if you are not using coinstatsindex. Read more

Returns information about network traffic, including bytes in, bytes out, and current time. Read more

Returns the estimated network hashes per second based on the last n blocks.

Returns the total uptime of the server in seconds

Submit a block

Submit a raw block

Submit a block as a hex string

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.