upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/tollgate_main.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-22 03:48:46 +0530
committerYour Name <you@example.com>2026-05-22 03:48:46 +0530
commited06f7eeab28c1fa6242c4ea6c3b9c933661fc06 (patch)
tree96230dd069102688318f73b60b8322255ea30cad /main/tollgate_main.c
parent7009d2e0ac346376733863966374eac296e0471e (diff)
feat(cvm): fix CVM MCP roundtrip - task creation, subscription, relay selection
- Move CVM server start before mint_health_start (avoids RAM fragmentation) - Fix NIP-01 subscription: #p tag must be array not string - Fix read loop: tolerate TLS timeouts, don't disconnect - Reduce TLS timeout from 15s to 5s for faster event delivery - Add WS frame logging for debugging - Sign test events with board's nsec (--sec flag) for owner auth - Change default CVM relay to nos.lol (forwards ephemeral kind 25910) - MCP get_config and get_balance roundtrips confirmed working - Unit tests pass (16/16)
Diffstat (limited to 'main/tollgate_main.c')
-rw-r--r--main/tollgate_main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c
index 60503eb..2d4fa22 100644
--- a/main/tollgate_main.c
+++ b/main/tollgate_main.c
@@ -237,6 +237,12 @@ static void start_services(void)
237 session_manager_init(); 237 session_manager_init();
238 238
239 const tollgate_config_t *cfg = tollgate_config_get(); 239 const tollgate_config_t *cfg = tollgate_config_get();
240
241 if (cfg->cvm_enabled) {
242 cvm_server_init();
243 cvm_server_start();
244 }
245
240 mint_health_init(cfg->accepted_mints, cfg->accepted_mint_count); 246 mint_health_init(cfg->accepted_mints, cfg->accepted_mint_count);
241 mint_health_start(); 247 mint_health_start();
242 248
@@ -268,19 +274,13 @@ static void start_services(void)
268 274
269 xTaskCreate(publish_wifistr_task, "wifistr_init", 16384, NULL, 3, NULL); 275 xTaskCreate(publish_wifistr_task, "wifistr_init", 16384, NULL, 3, NULL);
270 276
271 const tollgate_config_t *cfg2 = tollgate_config_get(); 277 if (cfg->mining_enabled) {
272 if (cfg2->cvm_enabled) {
273 cvm_server_init();
274 cvm_server_start();
275 }
276
277 if (cfg2->mining_enabled) {
278 ESP_LOGI(TAG, "Mining subsystem enabled, initializing..."); 278 ESP_LOGI(TAG, "Mining subsystem enabled, initializing...");
279 mining_payment_init(); 279 mining_payment_init();
280 stratum_client_init(); 280 stratum_client_init();
281 stratum_proxy_init(cfg2->mining_port); 281 stratum_proxy_init(cfg->mining_port);
282 282
283 if (cfg2->mining_payout_mode != MINING_PAYOUT_UPSTREAM) { 283 if (cfg->mining_payout_mode != MINING_PAYOUT_UPSTREAM) {
284 stratum_client_start(); 284 stratum_client_start();
285 } 285 }
286 286