diff options
| author | Your Name <you@example.com> | 2026-05-19 04:13:11 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 04:13:11 +0530 |
| commit | beb73a2eeacf7dbe5e292ce6e26a95a933808267 (patch) | |
| tree | 3a9b711e1475c09ed544b96358587df3e5362555 /main/config.h | |
| parent | c75230e551a778408b2e370b208aff76b74c6560 (diff) | |
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
Diffstat (limited to 'main/config.h')
| -rw-r--r-- | main/config.h | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ | |||
| 15 | #define TOLLGATE_MAX_RELAYS 4 | 15 | #define TOLLGATE_MAX_RELAYS 4 |
| 16 | #define TOLLGATE_MAX_SEED_RELAYS 8 | 16 | #define TOLLGATE_MAX_SEED_RELAYS 8 |
| 17 | 17 | ||
| 18 | typedef enum { | ||
| 19 | MINING_PAYOUT_AUTO, | ||
| 20 | MINING_PAYOUT_POOL, | ||
| 21 | MINING_PAYOUT_UPSTREAM, | ||
| 22 | MINING_PAYOUT_PROXY_ONLY | ||
| 23 | } mining_payout_mode_t; | ||
| 24 | |||
| 18 | typedef struct { | 25 | typedef struct { |
| 19 | char ssid[32]; | 26 | char ssid[32]; |
| 20 | char password[64]; | 27 | char password[64]; |
| @@ -69,6 +76,18 @@ typedef struct { | |||
| 69 | int nostr_seed_relay_count; | 76 | int nostr_seed_relay_count; |
| 70 | int nostr_sync_interval_s; | 77 | int nostr_sync_interval_s; |
| 71 | int nostr_fallback_sync_interval_s; | 78 | int nostr_fallback_sync_interval_s; |
| 79 | |||
| 80 | bool mining_enabled; | ||
| 81 | mining_payout_mode_t mining_payout_mode; | ||
| 82 | char stratum_host[128]; | ||
| 83 | uint16_t stratum_port; | ||
| 84 | char stratum_user[128]; | ||
| 85 | char stratum_pass[64]; | ||
| 86 | char stratum_fallback_host[128]; | ||
| 87 | uint16_t stratum_fallback_port; | ||
| 88 | uint16_t mining_port; | ||
| 89 | uint64_t hashprice_sats_per_ghs_day; | ||
| 90 | bool mining_sandbox_mint_access; | ||
| 72 | } tollgate_config_t; | 91 | } tollgate_config_t; |
| 73 | 92 | ||
| 74 | void tollgate_config_derive_unique(tollgate_config_t *cfg); | 93 | void tollgate_config_derive_unique(tollgate_config_t *cfg); |