Struct bitcoin_rpc::BitcoinRpc[][src]

pub struct BitcoinRpc { /* fields omitted */ }

A Handle to a Bitcoin JSON-RPC connection

Methods

impl BitcoinRpc
[src]

Creates a client to a bitcoind JSON-RPC server.

Returns the numbers of block in the longest chain.

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

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.

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

Returns the number of connections to other nodes.

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.

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

Attempts to add or remove a node from the addnode list.

Or try a connection to a node once.

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).

Arguments:

  1. node: The node (see getpeerinfo for nodes)
  2. command: AddNode::Add to add a node to the list, AddNode::Remove to remove a node from the list, AddNode::OneTry to try a connection to the node once

Auto Trait Implementations

impl Send for BitcoinRpc

impl Sync for BitcoinRpc