2 Commits

Author SHA1 Message Date
d5fe22cc14 bal server route / 2025-11-03 09:36:56 -04:00
83749afddd update version 2025-11-03 08:53:58 -04:00
2 changed files with 10 additions and 2 deletions

View File

@@ -36,7 +36,7 @@ use std::time::Instant;
const LOCKTIME_THRESHOLD:i64 = 5000000; const LOCKTIME_THRESHOLD:i64 = 5000000;
const VERSION:&str = "0.0.1"; const VERSION:&str = "0.0.2";
#[derive(Debug, Clone,Serialize, Deserialize)] #[derive(Debug, Clone,Serialize, Deserialize)]
struct MyConfig { struct MyConfig {
zmq_listener: String, zmq_listener: String,

View File

@@ -34,7 +34,7 @@ use crate::db::{ create_database, get_next_address_index, insert_xpub, save_new_
#[path = "../xpub.rs"] #[path = "../xpub.rs"]
mod xpub; mod xpub;
use crate::xpub::new_address_from_xpub; use crate::xpub::new_address_from_xpub;
const VERSION:&str="0.2.1"; const VERSION:&str="0.2.2";
const NETWORKS : [&str; 4]= ["bitcoin","testnet","signet","regtest"]; const NETWORKS : [&str; 4]= ["bitcoin","testnet","signet","regtest"];
#[derive(Debug, Clone,Serialize, Deserialize)] #[derive(Debug, Clone,Serialize, Deserialize)]
struct NetConfig { struct NetConfig {
@@ -112,6 +112,11 @@ async fn echo_version(
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> { ) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
Ok(Response::new(full(VERSION))) Ok(Response::new(full(VERSION)))
} }
async fn echo_home(cfg: &MyConfig
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
debug!("echo_home: {}", cfg.info );
Ok(Response::new(full(cfg.info.clone())))
}
async fn echo_pub_key( async fn echo_pub_key(
cfg: &MyConfig, cfg: &MyConfig,
) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> { ) -> Result<Response<BoxBody<Bytes, hyper::Error>>, hyper::Error> {
@@ -454,6 +459,9 @@ async fn echo(
if uri=="/.pub_key.pem" { if uri=="/.pub_key.pem" {
ret = echo_pub_key(cfg).await; ret = echo_pub_key(cfg).await;
} }
if uri=="/"{
ret = echo_home(cfg).await;
}
ret ret
} }