global: snapshot

This commit is contained in:
nym21
2024-12-13 19:55:32 +01:00
parent f6f4660cd2
commit 795791219e
315 changed files with 1931 additions and 4144 deletions

23
src/utils/rpc.rs Normal file
View File

@@ -0,0 +1,23 @@
use biter::bitcoincore_rpc::Client;
use crate::structs::Config;
impl From<&Config> for Client {
fn from(config: &Config) -> Self {
create_rpc(config).unwrap()
}
}
fn create_rpc(config: &Config) -> color_eyre::Result<Client> {
Ok(Client::new(
&format!(
"http://{}:{}",
config
.rpcconnect
.as_ref()
.unwrap_or(&"localhost".to_owned()),
config.rpcport.unwrap_or(8332)
),
config.to_rpc_auth().unwrap(),
)?)
}