From 2a86bec93273e2f4ceeab60683058c65dbb1da3d Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 18 May 2026 14:50:41 +0530 Subject: feat: multi-mint health tracker, discovery, portal, multi-wallet (Phase 3-8) - mint_health.h/c: FreeRTOS probing task, GET /v1/info every 5min, recovery threshold 3, immediate failure, mutex-protected state - cashu.c: health-gated acceptance (config match AND reachable) - tollgate_api.c: one price_per_step tag per reachable mint in discovery - captive_portal.c: mint list with green/grey indicators, /mints API, auto-refresh every 30s via JS - nucula_wallet.h/cpp: multi-wallet (up to 4), route receive to correct wallet by mint URL, balance sums across all wallets - tollgate_main.c: init health tracker + multi-wallet on service start - CMakeLists.txt: add mint_health.c --- main/tollgate_main.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'main/tollgate_main.c') diff --git a/main/tollgate_main.c b/main/tollgate_main.c index c0ff65f..5f3e0e1 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c @@ -22,6 +22,7 @@ #include "wifistr.h" #include "tollgate_client.h" #include "lightning_payout.h" +#include "mint_health.h" #include "cvm_server.h" #include "display.h" @@ -151,7 +152,15 @@ static void start_services(void) session_manager_init(); const tollgate_config_t *cfg = tollgate_config_get(); - nucula_wallet_init(cfg->mint_url); + + mint_health_init(cfg->accepted_mints, cfg->accepted_mint_count); + mint_health_start(); + + if (cfg->accepted_mint_count > 1) { + nucula_wallet_init_multi(cfg->accepted_mints, cfg->accepted_mint_count); + } else { + nucula_wallet_init(cfg->mint_url); + } lightning_payout_init(&cfg->payout); dns_server_start(ap_ip_info.ip, upstream_dns); @@ -187,6 +196,7 @@ static void stop_services(void) captive_portal_stop(); tollgate_api_stop(); dns_server_stop(); + mint_health_stop(); cvm_server_stop(); firewall_revoke_all(); s_services_running = false; -- cgit v1.2.3