mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-24 06:39:58 -07:00
global: snapshot
This commit is contained in:
@@ -1,19 +1,14 @@
|
||||
use std::path::Path;
|
||||
|
||||
use bitcoincore_rpc::RpcApi;
|
||||
use brk_rpc::{Auth, Client};
|
||||
|
||||
fn main() {
|
||||
brk_logger::init(None).unwrap();
|
||||
|
||||
let bitcoin_dir = Path::new(&std::env::var("HOME").unwrap())
|
||||
.join("Library")
|
||||
.join("Application Support")
|
||||
.join("Bitcoin");
|
||||
let bitcoin_dir = Client::default_bitcoin_path();
|
||||
|
||||
let auth = Auth::CookieFile(bitcoin_dir.join(".cookie"));
|
||||
|
||||
let client = Client::new("http://localhost:8332", auth).unwrap();
|
||||
let client = Client::new(Client::default_url(), auth).unwrap();
|
||||
|
||||
loop {
|
||||
println!("{:?}", client.call(|c| c.get_block_count()).unwrap());
|
||||
|
||||
Reference in New Issue
Block a user