Skip to content

Commit 6cb15a5

Browse files
authored
make esplora url configurable (#490)
1 parent 213276a commit 6cb15a5

File tree

16 files changed

+31
-11
lines changed

16 files changed

+31
-11
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# 0.3.8
2+
3+
* Add `esplora_base_url` as config parameter to be able to use a custom esplora based block explorer
4+
* Add `node_ids` filter to `list` notifications endpoint
5+
* Fixed an issue where events weren't propagated if no one was subscribed to the push notifications
6+
* Run payment checks on startup
7+
18
# 0.3.7
29

310
* Fix request recourse to accept validation - does not require a request to accept anymore

crates/bcr-ebill-api/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bcr-ebill-api"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
edition = "2024"
55

66
[lib]

crates/bcr-ebill-api/src/external/bitcoin.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@ impl BitcoinClient {
7979
pub fn request_url(&self, path: &str) -> String {
8080
match get_config().bitcoin_network() {
8181
Network::Bitcoin => {
82-
format!("https://blockstream.info/api{path}")
82+
format!("{}/api{path}", get_config().esplora_base_url)
8383
}
8484
_ => {
85-
format!("https://blockstream.info/testnet/api{path}")
85+
format!("{}/testnet/api{path}", get_config().esplora_base_url)
8686
}
8787
}
8888
}
8989

9090
pub fn link_url(&self, path: &str) -> String {
9191
match get_config().bitcoin_network() {
9292
Network::Bitcoin => {
93-
format!("https://blockstream.info{path}")
93+
format!("{}{path}", get_config().esplora_base_url)
9494
}
9595
_ => {
96-
format!("https://blockstream.info/testnet{path}")
96+
format!("{}/testnet{path}", get_config().esplora_base_url)
9797
}
9898
}
9999
}

crates/bcr-ebill-api/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ pub use persistence::notification::NotificationFilter;
2323
#[derive(Debug, Clone)]
2424
pub struct Config {
2525
pub bitcoin_network: String,
26+
pub esplora_base_url: String,
2627
pub nostr_relay: String,
2728
pub surreal_db_connection: String,
2829
pub data_dir: String,

crates/bcr-ebill-api/src/tests/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ pub mod tests {
315315
None => {
316316
crate::init(crate::Config {
317317
bitcoin_network: "mainnet".to_string(),
318+
esplora_base_url: "https://blockstream.info".to_string(),
318319
nostr_relay: "ws://localhost:8080".to_string(),
319320
surreal_db_connection: "ws://localhost:8800".to_string(),
320321
data_dir: ".".to_string(),

crates/bcr-ebill-core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bcr-ebill-core"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
edition = "2024"
55

66
[lib]

crates/bcr-ebill-persistence/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bcr-ebill-persistence"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
edition = "2024"
55

66
[lib]

crates/bcr-ebill-transport/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bcr-ebill-transport"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
edition = "2024"
55

66
[lib]

crates/bcr-ebill-wasm/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bcr-ebill-wasm"
3-
version = "0.3.7"
3+
version = "0.3.8"
44
edition = "2024"
55

66
[lib]

crates/bcr-ebill-wasm/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ async function start() {
3131
let config = {
3232
log_level: "debug",
3333
bitcoin_network: "testnet",
34+
esplora_base_url: "https://blockstream.info",
3435
nostr_relay: "wss://bitcr-cloud-run-05-550030097098.europe-west1.run.app",
3536
job_runner_initial_delay_seconds: 1,
3637
job_runner_check_interval_seconds: 600,

0 commit comments

Comments
 (0)