From dc326009440fc4fbbe80df7e67d8896303326130 Mon Sep 17 00:00:00 2001 From: Machu Pikacchu Date: Mon, 26 May 2025 19:58:49 +0000 Subject: [PATCH 1/5] get quote IDs from mint API --- roles/translator/src/lib/mod.rs | 71 +++++++++++++++++++++++---------- 1 file changed, 49 insertions(+), 22 deletions(-) diff --git a/roles/translator/src/lib/mod.rs b/roles/translator/src/lib/mod.rs index ee84188ed..5b58a0535 100644 --- a/roles/translator/src/lib/mod.rs +++ b/roles/translator/src/lib/mod.rs @@ -326,9 +326,7 @@ impl TranslatorSv2 { } }; - for quote in "es { - Self::process_quote(&wallet, &mut conn, &rt, quote); - } + Self::process_quotes_batch(&wallet, &mut conn, &rt, "es); thread::sleep(Duration::from_secs(60)); } @@ -345,32 +343,61 @@ impl TranslatorSv2 { } } - fn lookup_uuid(conn: &mut Connection, redis_key: &str) -> Option { - loop { - match conn.get(redis_key) { - Ok(val) => break Some(val), - Err(e) if e.kind() == redis::ErrorKind::TypeError => break None, - Err(e) => { - tracing::warn!("Retrying Redis lookup for key {}: {}", redis_key, e); - thread::sleep(Duration::from_secs(1)); + fn lookup_uuids_batch(quote_ids: &[String]) -> std::collections::HashMap { + use std::collections::HashMap; + + if quote_ids.is_empty() { + return HashMap::new(); + } + + let share_hashes = quote_ids.join(","); + let url = format!("http://localhost:3338/v1/mint/quote-ids/share?share_hashes={}", share_hashes); + + match ureq::get(&url).call() { + Ok(response) => { + match response.into_string() { + Ok(body) => { + match serde_json::from_str::>(&body) { + Ok(mapping) => mapping, + Err(e) => { + tracing::warn!("Failed to parse batch UUID response: {}", e); + HashMap::new() + } + } + } + Err(e) => { + tracing::warn!("Failed to read batch UUID response body: {}", e); + HashMap::new() + } } } + Err(e) => { + tracing::warn!("Failed to make batch UUID lookup request: {}", e); + HashMap::new() + } } } - fn process_quote(wallet: &Arc, conn: &mut Connection, rt: &Handle, quote: &MintQuote) { - let redis_key = format!("mint:quotes:hash:{}", quote.id); - let Some(uuid) = Self::lookup_uuid(conn, &redis_key) else { + fn process_quotes_batch(wallet: &Arc, conn: &mut Connection, rt: &Handle, quotes: &[MintQuote]) { + if quotes.is_empty() { return; - }; + } - // TODO get latest keyset - match rt.block_on(wallet.get_mining_share_proofs(&uuid, "e.id)) { - Ok(_proofs) => { - Self::log_success_and_cleanup(wallet, conn, rt, quote, &redis_key); - } - Err(e) => { - tracing::info!("Failed to mint ehash tokens for share {} error: {}", quote.id, e); + let quote_ids: Vec = quotes.iter().map(|q| q.id.clone()).collect(); + let uuid_mapping = Self::lookup_uuids_batch("e_ids); + + for quote in quotes { + if let Some(uuid) = uuid_mapping.get("e.id) { + // TODO get latest keyset + match rt.block_on(wallet.get_mining_share_proofs(uuid, "e.id)) { + Ok(_proofs) => { + let redis_key = format!("mint:quotes:hash:{}", quote.id); + Self::log_success_and_cleanup(wallet, conn, rt, quote, &redis_key); + } + Err(e) => { + tracing::info!("Failed to mint ehash tokens for share {} error: {}", quote.id, e); + } + } } } } From d5b9c23ca59c7d6cca8747f746b79d33889d18b7 Mon Sep 17 00:00:00 2001 From: Machu Pikacchu Date: Tue, 27 May 2025 00:49:52 +0000 Subject: [PATCH 2/5] Rename param + make mint addr configurable --- .../tproxy-config-hosted-pool-example.toml | 3 +++ .../tproxy-config-local-jdc-example.toml | 3 +++ .../tproxy-config-local-pool-example.toml | 3 +++ roles/translator/src/lib/mod.rs | 25 +++++++++---------- roles/translator/src/lib/proxy_config.rs | 8 ++++++ 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml b/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml index 47d4ea875..548785adc 100644 --- a/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml +++ b/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml @@ -12,6 +12,9 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 +# Mint URL for Cashu operations (adjust for hosted environment) +mint_url = "http://127.0.0.1:3338" + # Version support max_supported_version = 2 min_supported_version = 2 diff --git a/roles/translator/config-examples/tproxy-config-local-jdc-example.toml b/roles/translator/config-examples/tproxy-config-local-jdc-example.toml index 8cfd8df61..a70ef85ae 100644 --- a/roles/translator/config-examples/tproxy-config-local-jdc-example.toml +++ b/roles/translator/config-examples/tproxy-config-local-jdc-example.toml @@ -12,6 +12,9 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 +# Mint URL for Cashu operations +mint_url = "http://127.0.0.1:3338" + # Version support max_supported_version = 2 min_supported_version = 2 diff --git a/roles/translator/config-examples/tproxy-config-local-pool-example.toml b/roles/translator/config-examples/tproxy-config-local-pool-example.toml index b4359d5ab..625eaa8f2 100644 --- a/roles/translator/config-examples/tproxy-config-local-pool-example.toml +++ b/roles/translator/config-examples/tproxy-config-local-pool-example.toml @@ -12,6 +12,9 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 +# Mint URL for Cashu operations +mint_url = "http://127.0.0.1:3338" + # Version support max_supported_version = 2 min_supported_version = 2 diff --git a/roles/translator/src/lib/mod.rs b/roles/translator/src/lib/mod.rs index 5b58a0535..93a3b2b4a 100644 --- a/roles/translator/src/lib/mod.rs +++ b/roles/translator/src/lib/mod.rs @@ -8,6 +8,7 @@ use std::{ net::{IpAddr, SocketAddr}, str::FromStr, sync::Arc, + collections::HashMap, }; use tokio::{ @@ -43,12 +44,11 @@ pub struct TranslatorSv2 { wallet: Arc, } -fn create_wallet() -> Arc { +fn create_wallet(mint_url: &str) -> Arc { use cdk::cdk_database::WalletMemoryDatabase; use cdk::nuts::CurrencyUnit; let seed = rand::thread_rng().gen::<[u8; 32]>(); - let mint_url = "http://127.0.0.1:3338"; let localstore = WalletMemoryDatabase::default(); Arc::new(Wallet::new(mint_url, CurrencyUnit::Custom(HASH_CURRENCY_UNIT.to_string()), Arc::new(localstore), &seed, None).unwrap()) @@ -59,9 +59,9 @@ impl TranslatorSv2 { let mut rng = rand::thread_rng(); let wait_time = rng.gen_range(0..=3000); Self { + wallet: create_wallet(&config.mint_url), config, reconnect_wait_time: wait_time, - wallet: create_wallet(), } } @@ -308,6 +308,7 @@ impl TranslatorSv2 { fn spawn_proof_sweeper(&self) { let wallet = self.wallet.clone(); + let mint_url = self.config.mint_url.clone(); task::spawn_blocking(move || { let mut conn = match Self::connect_to_redis("redis://localhost:6379") { Some(c) => c, @@ -326,7 +327,7 @@ impl TranslatorSv2 { } }; - Self::process_quotes_batch(&wallet, &mut conn, &rt, "es); + Self::process_quotes_batch(&wallet, &mut conn, &rt, "es, &mint_url); thread::sleep(Duration::from_secs(60)); } @@ -343,15 +344,13 @@ impl TranslatorSv2 { } } - fn lookup_uuids_batch(quote_ids: &[String]) -> std::collections::HashMap { - use std::collections::HashMap; - - if quote_ids.is_empty() { + fn lookup_uuids_batch(mint_url: &str, share_hashes: &[String]) -> std::collections::HashMap { + if share_hashes.is_empty() { return HashMap::new(); } - let share_hashes = quote_ids.join(","); - let url = format!("http://localhost:3338/v1/mint/quote-ids/share?share_hashes={}", share_hashes); + let shares = share_hashes.join(","); + let url = format!("{}/v1/mint/quote-ids/share?share_hashes={}", mint_url, shares); match ureq::get(&url).call() { Ok(response) => { @@ -360,7 +359,7 @@ impl TranslatorSv2 { match serde_json::from_str::>(&body) { Ok(mapping) => mapping, Err(e) => { - tracing::warn!("Failed to parse batch UUID response: {}", e); + tracing::error!("Failed to parse batch UUID response: {}", e); HashMap::new() } } @@ -378,13 +377,13 @@ impl TranslatorSv2 { } } - fn process_quotes_batch(wallet: &Arc, conn: &mut Connection, rt: &Handle, quotes: &[MintQuote]) { + fn process_quotes_batch(wallet: &Arc, conn: &mut Connection, rt: &Handle, quotes: &[MintQuote], mint_url: &str) { if quotes.is_empty() { return; } let quote_ids: Vec = quotes.iter().map(|q| q.id.clone()).collect(); - let uuid_mapping = Self::lookup_uuids_batch("e_ids); + let uuid_mapping = Self::lookup_uuids_batch(mint_url, "e_ids); for quote in quotes { if let Some(uuid) = uuid_mapping.get("e.id) { diff --git a/roles/translator/src/lib/proxy_config.rs b/roles/translator/src/lib/proxy_config.rs index ec3711c5d..fa0f63739 100644 --- a/roles/translator/src/lib/proxy_config.rs +++ b/roles/translator/src/lib/proxy_config.rs @@ -1,6 +1,10 @@ use key_utils::Secp256k1PublicKey; use serde::Deserialize; +fn default_mint_url() -> String { + "http://127.0.0.1:3338".to_string() +} + #[derive(Debug, Deserialize, Clone)] pub struct ProxyConfig { pub upstream_address: String, @@ -13,6 +17,8 @@ pub struct ProxyConfig { pub min_extranonce2_size: u16, pub downstream_difficulty_config: DownstreamDifficultyConfig, pub upstream_difficulty_config: UpstreamDifficultyConfig, + #[serde(default = "default_mint_url")] + pub mint_url: String, } pub struct UpstreamConfig { @@ -61,6 +67,7 @@ impl ProxyConfig { max_supported_version: u16, min_supported_version: u16, min_extranonce2_size: u16, + mint_url: String, ) -> Self { Self { upstream_address: upstream.address, @@ -73,6 +80,7 @@ impl ProxyConfig { min_extranonce2_size, downstream_difficulty_config: downstream.difficulty_config, upstream_difficulty_config: upstream.difficulty_config, + mint_url, } } } From 0b2e2b03090d758e8393b25971eac8dcd6759d2f Mon Sep 17 00:00:00 2001 From: Machu Pikacchu <177660647+machuPikacchuBTC@users.noreply.github.com> Date: Thu, 29 May 2025 02:25:19 +0000 Subject: [PATCH 3/5] Use cdk wallet client method vs ureq::get --- roles/translator/src/lib/mod.rs | 45 +++++++++++++-------------------- 1 file changed, 18 insertions(+), 27 deletions(-) diff --git a/roles/translator/src/lib/mod.rs b/roles/translator/src/lib/mod.rs index 93a3b2b4a..c4f24816f 100644 --- a/roles/translator/src/lib/mod.rs +++ b/roles/translator/src/lib/mod.rs @@ -1,5 +1,5 @@ use async_channel::{bounded, unbounded}; -use cdk::wallet::{Wallet, MintQuote}; +use cdk::wallet::{client::MintConnector, MintQuote, Wallet}; use futures::FutureExt; use rand::Rng; pub use roles_logic_sv2::utils::Mutex; @@ -11,6 +11,8 @@ use std::{ collections::HashMap, }; +use cdk::{HttpClient, mint_url::MintUrl}; + use tokio::{ sync::broadcast, task::{self, AbortHandle}, @@ -42,6 +44,7 @@ pub struct TranslatorSv2 { config: ProxyConfig, reconnect_wait_time: u64, wallet: Arc, + mint_client: HttpClient, } fn create_wallet(mint_url: &str) -> Arc { @@ -58,10 +61,12 @@ impl TranslatorSv2 { pub fn new(config: ProxyConfig) -> Self { let mut rng = rand::thread_rng(); let wait_time = rng.gen_range(0..=3000); + let mint_client = HttpClient::new(MintUrl::from_str(&config.mint_url).unwrap()); Self { wallet: create_wallet(&config.mint_url), config, reconnect_wait_time: wait_time, + mint_client: mint_client, } } @@ -308,7 +313,8 @@ impl TranslatorSv2 { fn spawn_proof_sweeper(&self) { let wallet = self.wallet.clone(); - let mint_url = self.config.mint_url.clone(); + let mint_client = self.mint_client.clone(); + task::spawn_blocking(move || { let mut conn = match Self::connect_to_redis("redis://localhost:6379") { Some(c) => c, @@ -327,7 +333,7 @@ impl TranslatorSv2 { } }; - Self::process_quotes_batch(&wallet, &mut conn, &rt, "es, &mint_url); + Self::process_quotes_batch(&wallet, &mut conn, &rt, "es, &mint_client); thread::sleep(Duration::from_secs(60)); } @@ -344,46 +350,31 @@ impl TranslatorSv2 { } } - fn lookup_uuids_batch(mint_url: &str, share_hashes: &[String]) -> std::collections::HashMap { + fn lookup_uuids_batch(rt: &Handle, mint_client: &HttpClient, share_hashes: &[String]) -> std::collections::HashMap { if share_hashes.is_empty() { return HashMap::new(); } - let shares = share_hashes.join(","); - let url = format!("{}/v1/mint/quote-ids/share?share_hashes={}", mint_url, shares); + let quotes_shares_future = mint_client.get_quotes_shares(share_hashes.to_vec()); - match ureq::get(&url).call() { + match rt.block_on(quotes_shares_future) { Ok(response) => { - match response.into_string() { - Ok(body) => { - match serde_json::from_str::>(&body) { - Ok(mapping) => mapping, - Err(e) => { - tracing::error!("Failed to parse batch UUID response: {}", e); - HashMap::new() - } - } - } - Err(e) => { - tracing::warn!("Failed to read batch UUID response body: {}", e); - HashMap::new() - } - } - } + response.quote_ids.iter().map(|(id, uuid)| (id.clone(), uuid.clone())).collect::>() + }, Err(e) => { - tracing::warn!("Failed to make batch UUID lookup request: {}", e); + tracing::error!("Failed to lookup batch UUIDs from mint: {}", e); HashMap::new() } } } - fn process_quotes_batch(wallet: &Arc, conn: &mut Connection, rt: &Handle, quotes: &[MintQuote], mint_url: &str) { + fn process_quotes_batch(wallet: &Arc, conn: &mut Connection, rt: &Handle, quotes: &[MintQuote], mint_client: &HttpClient) { if quotes.is_empty() { return; } let quote_ids: Vec = quotes.iter().map(|q| q.id.clone()).collect(); - let uuid_mapping = Self::lookup_uuids_batch(mint_url, "e_ids); + let uuid_mapping = Self::lookup_uuids_batch(rt, mint_client, "e_ids); for quote in quotes { if let Some(uuid) = uuid_mapping.get("e.id) { @@ -394,7 +385,7 @@ impl TranslatorSv2 { Self::log_success_and_cleanup(wallet, conn, rt, quote, &redis_key); } Err(e) => { - tracing::info!("Failed to mint ehash tokens for share {} error: {}", quote.id, e); + tracing::error!("Failed to mint ehash tokens for share {} error: {}", quote.id, e); } } } From 35d65b60f5f1fca93e0b498a7655d04dfe92590c Mon Sep 17 00:00:00 2001 From: Machu Pikacchu <177660647+machuPikacchuBTC@users.noreply.github.com> Date: Thu, 29 May 2025 13:41:57 +0000 Subject: [PATCH 4/5] Import updated CDK client and enable redis feature --- roles/Cargo.lock | 33 +++++++++++++++++++-------------- roles/mint/Cargo.toml | 10 +++++----- roles/pool/Cargo.toml | 2 +- roles/translator/Cargo.toml | 2 +- 4 files changed, 26 insertions(+), 21 deletions(-) diff --git a/roles/Cargo.lock b/roles/Cargo.lock index e331974c2..ebcd09776 100644 --- a/roles/Cargo.lock +++ b/roles/Cargo.lock @@ -901,7 +901,7 @@ dependencies = [ [[package]] name = "cashu" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "bitcoin 0.32.5", "bitcoin_hashes 0.16.0", @@ -952,7 +952,7 @@ dependencies = [ [[package]] name = "cdk" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -981,15 +981,17 @@ dependencies = [ [[package]] name = "cdk-axum" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", "axum", "cdk", + "cdk-common", "futures", "moka", "paste", + "redis 0.23.3", "serde", "serde_json", "sha2 0.10.8", @@ -1001,7 +1003,7 @@ dependencies = [ [[package]] name = "cdk-cln" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "async-trait", "bitcoin 0.32.5", @@ -1018,7 +1020,7 @@ dependencies = [ [[package]] name = "cdk-common" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -1041,7 +1043,7 @@ dependencies = [ [[package]] name = "cdk-fake-wallet" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "async-trait", "bitcoin 0.32.5", @@ -1060,7 +1062,7 @@ dependencies = [ [[package]] name = "cdk-lnbits" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -1078,7 +1080,7 @@ dependencies = [ [[package]] name = "cdk-lnd" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -1094,7 +1096,7 @@ dependencies = [ [[package]] name = "cdk-mint-rpc" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "cdk", @@ -1114,7 +1116,7 @@ dependencies = [ [[package]] name = "cdk-mintd" version = "0.7.2" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "axum", @@ -1147,7 +1149,7 @@ dependencies = [ [[package]] name = "cdk-phoenixd" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -1166,7 +1168,7 @@ dependencies = [ [[package]] name = "cdk-redb" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "async-trait", "cdk-common", @@ -1182,7 +1184,7 @@ dependencies = [ [[package]] name = "cdk-sqlite" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "async-trait", "bitcoin 0.32.5", @@ -1199,7 +1201,7 @@ dependencies = [ [[package]] name = "cdk-strike" version = "0.7.1" -source = "git+https://github.com/vnprc/cdk?rev=773af52b#773af52b5977efa53fa4d094134425270497e422" +source = "git+https://github.com/vnprc/cdk?rev=64ec7f6f#64ec7f6f8681fc3707a0f5e023fcdb2fa0a60a5e" dependencies = [ "anyhow", "async-trait", @@ -3908,10 +3910,13 @@ dependencies = [ "itoa", "percent-encoding", "pin-project-lite", + "rustls 0.21.12", + "rustls-native-certs 0.6.3", "ryu", "sha1_smol", "socket2 0.4.10", "tokio", + "tokio-rustls 0.24.1", "tokio-util", "url", ] diff --git a/roles/mint/Cargo.toml b/roles/mint/Cargo.toml index 888b16c1d..5ce2bb4b0 100644 --- a/roles/mint/Cargo.toml +++ b/roles/mint/Cargo.toml @@ -17,8 +17,8 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" bitcoin = { version= "0.32.2" } -cdk = { git = "https://github.com/vnprc/cdk.git", package = "cdk", rev = "773af52b" } -cdk-axum = { git = "https://github.com/vnprc/cdk.git", package = "cdk-axum", rev = "773af52b" } -cdk-mintd = { git = "https://github.com/vnprc/cdk.git", package = "cdk-mintd", rev = "773af52b" } -cdk-sqlite = { git = "https://github.com/vnprc/cdk.git", package = "cdk-sqlite", rev = "773af52b" } -cdk-redb = { git = "https://github.com/vnprc/cdk.git", package = "cdk-redb", rev = "773af52b" } \ No newline at end of file +cdk = { git = "https://github.com/vnprc/cdk.git", package = "cdk", rev = "64ec7f6f" } +cdk-axum = { git = "https://github.com/vnprc/cdk.git", package = "cdk-axum", rev = "64ec7f6f", features = ["redis"] } +cdk-mintd = { git = "https://github.com/vnprc/cdk.git", package = "cdk-mintd", rev = "64ec7f6f" } +cdk-sqlite = { git = "https://github.com/vnprc/cdk.git", package = "cdk-sqlite", rev = "64ec7f6f" } +cdk-redb = { git = "https://github.com/vnprc/cdk.git", package = "cdk-redb", rev = "64ec7f6f" } diff --git a/roles/pool/Cargo.toml b/roles/pool/Cargo.toml index e9de61250..a2411f0ab 100644 --- a/roles/pool/Cargo.toml +++ b/roles/pool/Cargo.toml @@ -39,7 +39,7 @@ key-utils = { version = "^1.0.0", path = "../../utils/key-utils" } bip39 = { version = "2.0", features = ["rand"] } mining_sv2 = { version = "^1.0.0", path = "../../protocols/v2/subprotocols/mining" } bitcoin = { version= "0.32.2" } -cdk = { git = "https://github.com/vnprc/cdk", rev = "773af52b" } +cdk = { git = "https://github.com/vnprc/cdk", rev = "64ec7f6f" } bitcoin_hashes = { version = "0.16", features = ["serde"] } redis = { version = "0.25", features = ["tokio-comp"] } diff --git a/roles/translator/Cargo.toml b/roles/translator/Cargo.toml index 85649ff9c..a1be36c06 100644 --- a/roles/translator/Cargo.toml +++ b/roles/translator/Cargo.toml @@ -46,7 +46,7 @@ async-compat = "0.2.1" rand = "0.8.4" bitcoin = "0.30" mining_sv2 = { version = "^1.0.0", path = "../../protocols/v2/subprotocols/mining" } -cdk = { git = "https://github.com/vnprc/cdk", rev = "773af52b" } +cdk = { git = "https://github.com/vnprc/cdk", rev = "64ec7f6f" } uuid = { version = "1", features = ["v4"] } ureq = { version = "2", features = ["tls"] } # TODO delete after implementing the cdk HTTP API to retrieve quote id from header hash From 8c64904dc817476f7e8971074b81e516b3eaef44 Mon Sep 17 00:00:00 2001 From: Machu Pikacchu <177660647+machuPikacchuBTC@users.noreply.github.com> Date: Thu, 29 May 2025 14:20:52 +0000 Subject: [PATCH 5/5] Remove mint URL from config examples --- .../config-examples/tproxy-config-hosted-pool-example.toml | 3 --- .../config-examples/tproxy-config-local-jdc-example.toml | 3 --- .../config-examples/tproxy-config-local-pool-example.toml | 3 --- 3 files changed, 9 deletions(-) diff --git a/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml b/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml index 548785adc..47d4ea875 100644 --- a/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml +++ b/roles/translator/config-examples/tproxy-config-hosted-pool-example.toml @@ -12,9 +12,6 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 -# Mint URL for Cashu operations (adjust for hosted environment) -mint_url = "http://127.0.0.1:3338" - # Version support max_supported_version = 2 min_supported_version = 2 diff --git a/roles/translator/config-examples/tproxy-config-local-jdc-example.toml b/roles/translator/config-examples/tproxy-config-local-jdc-example.toml index a70ef85ae..8cfd8df61 100644 --- a/roles/translator/config-examples/tproxy-config-local-jdc-example.toml +++ b/roles/translator/config-examples/tproxy-config-local-jdc-example.toml @@ -12,9 +12,6 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 -# Mint URL for Cashu operations -mint_url = "http://127.0.0.1:3338" - # Version support max_supported_version = 2 min_supported_version = 2 diff --git a/roles/translator/config-examples/tproxy-config-local-pool-example.toml b/roles/translator/config-examples/tproxy-config-local-pool-example.toml index 625eaa8f2..b4359d5ab 100644 --- a/roles/translator/config-examples/tproxy-config-local-pool-example.toml +++ b/roles/translator/config-examples/tproxy-config-local-pool-example.toml @@ -12,9 +12,6 @@ upstream_authority_pubkey = "9auqWEzQDVyd2oe1JVGFLMLHZtCo2FFqZwtKA5gd9xbuEu7PH72 downstream_address = "0.0.0.0" downstream_port = 34255 -# Mint URL for Cashu operations -mint_url = "http://127.0.0.1:3338" - # Version support max_supported_version = 2 min_supported_version = 2