19 Commits

Author SHA1 Message Date
fa98283df6 version 2026-01-19 20:03:17 -04:00
d5fe22cc14 bal server route / 2025-11-03 09:36:56 -04:00
83749afddd update version 2025-11-03 08:53:58 -04:00
dd075508b7 fix bal-pusher zmq connection stability 2025-11-03 08:46:13 -04:00
4ac492ba79 fix bal-pusher zmq connection stability 2025-11-03 07:42:09 -04:00
ae52b2b4e5 . 2025-11-01 19:02:15 -04:00
7c8ed123aa send times to welist
ED25519 times signing
2025-11-01 18:34:35 -04:00
d937ee9364 send time to welist server 2025-10-31 16:01:15 -04:00
3018e64fb7 release: bal-server-0.2.2 2025-10-31 15:13:09 -04:00
2234bb9147 bugdfix 2025-09-23 13:55:00 -04:00
fe1c4ee2c8 bal-pusher.env 2025-07-19 07:15:53 -04:00
ca10284479 logs about current block 2025-07-19 07:12:18 -04:00
afd21a5f2a bal-pusher readme 2025-07-16 04:50:40 -04:00
d154567aeb release: bal-server-0.2.1 2025-07-16 04:26:02 -04:00
8965a06dbe release: bal-server-0.2.1 2025-07-16 04:25:17 -04:00
134504e870 release: bal-server-0.2.1 2025-07-16 03:58:42 -04:00
66f34cb29f pusher fix 2025-07-16 03:47:28 -04:00
36edfcd073 fixed network db_field 2025-07-15 15:18:37 -04:00
9e89ae884e fixed db field network 2025-07-15 15:12:21 -04:00
6 changed files with 42 additions and 41 deletions

4
Cargo.lock generated
View File

@@ -124,8 +124,8 @@ dependencies = [
] ]
[[package]] [[package]]
name = "bal-server" name = "bal_server"
version = "0.1.0" version = "0.2.3"
dependencies = [ dependencies = [
"base64 0.22.1", "base64 0.22.1",
"bitcoin", "bitcoin",

View File

@@ -1,33 +1,33 @@
[package] [package]
name = "bal-server" name = "bal_server"
version = "0.1.0" version = "0.2.3"
edition = "2021" edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
base64 = "0.22.1" base64 = { version = "0.22.1" }
bs58 = "0.4.0" bs58 = { version = "0.4.0" }
bytes = "1.2" bytes = { version = "1.2" }
bitcoin = { version = "0.32.5" } bitcoin = { version = "0.32.5" }
bitcoincore-rpc = "0.19.0" bitcoincore-rpc = { version = "0.19.0" }
bitcoincore-rpc-json = "0.19.0" bitcoincore-rpc-json = { version = "0.19.0" }
byteorder = "1.5.0" byteorder = { version = "1.5.0" }
confy = "0.6.1" confy = { version = "0.6.1" }
chrono = "0.4.40" chrono = { version = "0.4.40" }
env_logger = "0.11.5" env_logger = { version = "0.11.5" }
hex = "0.4.3" hex = { version = "0.4.3" }
hex-conservative = "0.1.1" hex-conservative = { version = "0.1.1" }
hyper = { version = "1.3.1", features = ["http1","server"] } hyper = { version = "1.3.1", features = ["http1","server"] }
hyper-util = { version = "0.1.3", features = ["tokio"] } hyper-util = { version = "0.1.3", features = ["tokio"] }
http-body-util = "0.1" http-body-util = { version = "0.1" }
log = "0.4.21" log = { version = "0.4.21" }
openssl = { version = "0.10.74", features = ["vendored"] } openssl = { version = "0.10.74", features = ["vendored"] }
sha2 = "0.10.8" sha2 = { version = "0.10.8" }
serde = { version = "1.0.152", features = ["derive"] } serde = { version = "1.0.152", features = ["derive"] }
serde_json = "1.0.116" serde_json = { version = "1.0.116" }
sqlite = "0.34.0" sqlite = { version = "0.34.0" }
regex = "1.10.4" regex = { version = "1.10.4" }
reqwest = { version = "0.12.24", features = ["json","socks"] } reqwest = { version = "0.12.24", features = ["json","socks"] }
tokio = { version = "1", features = ["rt", "net","macros","rt-multi-thread"] } # Keep only necessary runtime components tokio = { version = "1", features = ["rt", "net","macros","rt-multi-thread"] } # Keep only necessary runtime components
zmq = "0.10.0" zmq = { version = "0.10.0" }

View File

@@ -79,7 +79,7 @@ To use `bal-pusher`, you need to compile and install Bitcoin with ZMQ (ZeroMQ) s
Once the application is installed and configured, you can start `bal-pusher` by running the following command: Once the application is installed and configured, you can start `bal-pusher` by running the following command:
```bash ```bash
$ bal-pusher $ bal-pusher [bitcoin|testnet|regtest|]
``` ```
This will start the service, which will listen for Bitcoin blocks via ZMQ and push transactions from the database when their locktime exceeds the median time past. This will start the service, which will listen for Bitcoin blocks via ZMQ and push transactions from the database when their locktime exceeds the median time past.

View File

@@ -12,5 +12,5 @@ BAL_PUSHER_SEND_STATS=true
WELIST_SERVER_URL=http://welist.bitcoin-after.life WELIST_SERVER_URL=http://welist.bitcoin-after.life
SSL_KEY_PATH=/home/bal/privkey.pem SSL_KEY_PATH=/home/bal/privkey.pem
#your server domain. do not add https or final / only domain. #your server domain. do not final / only domain.
BAL_SERVER_URL="https://we.bitcoin-after.life" BAL_SERVER_URL="https://we.bitcoin-after.life"

View File

@@ -316,8 +316,10 @@ async fn send_stats_report(cfg: &MyConfig, bcinfo: GetBlockchainInfoResult) -> R
let client = rClient::new(); let client = rClient::new();
let url = format!("{}/ping",welist_url); let url = format!("{}/ping",welist_url);
debug!("welist url: {}",url);
let chain=bcinfo.chain.to_string().to_lowercase(); let chain=bcinfo.chain.to_string().to_lowercase();
let message = format!("{0}{1}{2}{3}{4}",cfg.url,chain,bcinfo.blocks,bcinfo.median_time,bcinfo.best_block_hash); let message = format!("{0}{1}{2}{3}{4}",cfg.url,chain,bcinfo.blocks,bcinfo.median_time,bcinfo.best_block_hash);
trace!("message to be sent: {}",message);
let sign = sign_message(cfg.ssl_key_path.as_str(),&message.as_str()); let sign = sign_message(cfg.ssl_key_path.as_str(),&message.as_str());
let response = client.post(url) let response = client.post(url)
.header("User-Agent", format!("bal-pusher/{}",VERSION)) .header("User-Agent", format!("bal-pusher/{}",VERSION))
@@ -330,7 +332,11 @@ async fn send_stats_report(cfg: &MyConfig, bcinfo: GetBlockchainInfoResult) -> R
"last_block_hash": bcinfo.best_block_hash, "last_block_hash": bcinfo.best_block_hash,
"signature": sign, "signature": sign,
})) }))
.send().await?; .send().await?;
if !response.status().is_success() {
warn!("Non-success response: {} {}", response.status(), response.status().canonical_reason().unwrap_or(""));
}
let body = &(response.text().await?); let body = &(response.text().await?);
info!("Report to welist({})\tSent: {}", welist_url,body); info!("Report to welist({})\tSent: {}", welist_url,body);
}else { }else {

View File

@@ -26,15 +26,10 @@ use log::{ info, error, trace, debug};
use serde_json; use serde_json;
use chrono::Utc; use chrono::Utc;
#[path = "../db.rs"] use bal_server::db::{ create_database, get_next_address_index, insert_xpub, save_new_address, get_last_used_address_by_ip, execute_insert };
mod db; use bal_server::xpub::new_address_from_xpub;
use crate::db::{ create_database, get_next_address_index, insert_xpub, save_new_address, get_last_used_address_by_ip, execute_insert };
const VERSION:&str=env!("CARGO_PKG_VERSION");
#[path = "../xpub.rs"]
mod xpub;
use crate::xpub::new_address_from_xpub;
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 {