mirror of
https://github.com/bitcoinresearchkit/brk.git
synced 2026-04-25 07:09:59 -07:00
brk: first commit
This commit is contained in:
17
_src/structs/rpc.rs
Normal file
17
_src/structs/rpc.rs
Normal file
@@ -0,0 +1,17 @@
|
||||
use brk_parser::bitcoincore_rpc::Client;
|
||||
|
||||
use crate::structs::Config;
|
||||
|
||||
impl From<&Config> for Client {
|
||||
fn from(config: &Config) -> Self {
|
||||
Client::new(
|
||||
&format!(
|
||||
"http://{}:{}",
|
||||
config.rpcconnect().unwrap_or(&"localhost".to_owned()),
|
||||
config.rpcport().unwrap_or(8332)
|
||||
),
|
||||
config.to_rpc_auth().unwrap(),
|
||||
)
|
||||
.unwrap()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user