To use the client, connect to a Bitcoin Core node via its JSON-RPC interface. This example assumes the node is running on localhost:8332 with password authentication enabled.
You will need to use Client::new with an Auth::UserPass credential and call methods provided by the RpcApi trait.
extern crate bitcoincore_rpc;
use bitcoincore_rpc::{Auth, Client, RpcApi};
fn main() {
let rpc = Client::new("http://localhost:8332",
Auth::UserPass("<FILL RPC USERNAME>".to_string(),
"<FILL RPC PASSWORD>".to_string())).unwrap();
let best_block_hash = rpc.get_best_block_hash().unwrap();
println!("best block hash: {}", best_block_hash);
}