Struct bitcoincore_rpc::Client

source ·
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.

Create a new Client.

Query an object implementing Querable type

Call an cmd rpc with given args list

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

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

Generate new address under own control

Mine block_num blocks and pay coinbase to address

Returns hashes of the generated blocks

Mark a block as invalid by block_hash

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

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

Results provided in getpeerinfo, pingtime and pingwait fields are decimal seconds.

Ping command is handled in queue with all other commands, so it measures processing backlog, not just network ping.

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

Arguments
  1. timeout: Time in milliseconds to wait for a response. 0 indicates no timeout.

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

Arguments
  1. blockhash: Block hash to wait for.
  2. timeout: Time in milliseconds to wait for a response. 0 indicates no timeout.

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.
Get the TypeId of this object.