From beb73a2eeacf7dbe5e292ce6e26a95a933808267 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 04:13:11 +0530 Subject: feat(mining): integrate mining subsystem into existing modules - CMakeLists.txt: add 6 mining sources + tcp_transport dependency - config.h/c: mining_payout_mode_t enum, mining config fields, JSON parsing - tollgate_main.c: mining init in start_services(), stratum_client_tick in main loop - tollgate_api.c: GET /mining/job, POST /mining/share, GET /mining/stats endpoints - session.h/c: payment_method_t enum (CASHU/MINING/BYTES) - firewall.h/c: sandbox allowlist for mining port + mint URLs - tollgate_client.h/c: TG_CLIENT_MINING state, mining discovery tag parsing - captive_portal.c: tabbed UI with Cashu/Mine tabs, live hashrate polling --- main/config.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'main/config.h') diff --git a/main/config.h b/main/config.h index 1e580e9..8b3f17e 100644 --- a/main/config.h +++ b/main/config.h @@ -15,6 +15,13 @@ #define TOLLGATE_MAX_RELAYS 4 #define TOLLGATE_MAX_SEED_RELAYS 8 +typedef enum { + MINING_PAYOUT_AUTO, + MINING_PAYOUT_POOL, + MINING_PAYOUT_UPSTREAM, + MINING_PAYOUT_PROXY_ONLY +} mining_payout_mode_t; + typedef struct { char ssid[32]; char password[64]; @@ -69,6 +76,18 @@ typedef struct { int nostr_seed_relay_count; int nostr_sync_interval_s; int nostr_fallback_sync_interval_s; + + bool mining_enabled; + mining_payout_mode_t mining_payout_mode; + char stratum_host[128]; + uint16_t stratum_port; + char stratum_user[128]; + char stratum_pass[64]; + char stratum_fallback_host[128]; + uint16_t stratum_fallback_port; + uint16_t mining_port; + uint64_t hashprice_sats_per_ghs_day; + bool mining_sandbox_mint_access; } tollgate_config_t; void tollgate_config_derive_unique(tollgate_config_t *cfg); -- cgit v1.2.3