upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/CMakeLists.txt
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 18:50:20 +0530
committerYour Name <you@example.com>2026-05-18 18:50:20 +0530
commitf6369f5b87f5dab17a03315d82454fdcdd668ec9 (patch)
treebc16c22f87253eafa680a30da370b1822d855ca4 /main/CMakeLists.txt
parentd8c55d2a072433e16ae5c84b7b7c676587f6f2d9 (diff)
feat: extract tollgate_core ESP-IDF component
Extract shared TollGate business logic into a reusable ESP-IDF component that can be consumed by esp-miner via the IDF Component Manager. Component structure: components/tollgate_core/ include/tollgate_core.h — public API include/tollgate_platform.h — platform interface (config callbacks) src/tollgate_core.c — orchestrator (init, payment, tick, owner) src/tollgate_core_cashu.c/h — Cashu V3 token decode/verify src/tollgate_core_dns.c/h — per-client DNS hijack/forward src/tollgate_core_firewall.c/h — per-client NAT filter src/tollgate_core_session.c/h — session lifecycle Key design decisions: - Platform interface pattern: consumers implement tollgate_platform_t (config getters + optional spend_proofs wallet hook) - Cross-module wiring (session→firewall→dns) stays internal - No direct config.h dependency — all config via platform callbacks - spend_proofs can be NULL (accepts payment without local wallet) Standalone app updated: - main/tollgate_platform.c implements platform via config singleton - main/tollgate_main.c calls tollgate_core_init/tick/dns_start - main/tollgate_api.c routes payment through tollgate_core_process_payment - Removed cashu.c, dns_server.c, firewall.c, session.c from CMakeLists Not yet build-verified — blocked on multi-mint, price-discovery, cvm-integration, and display-fix branches merging to master.
Diffstat (limited to 'main/CMakeLists.txt')
-rw-r--r--main/CMakeLists.txt6
1 files changed, 2 insertions, 4 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index 9b0fb1c..5f195c3 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -1,10 +1,7 @@
1idf_component_register(SRCS "tollgate_main.c" 1idf_component_register(SRCS "tollgate_main.c"
2 "config.c" 2 "config.c"
3 "dns_server.c" 3 "tollgate_platform.c"
4 "captive_portal.c" 4 "captive_portal.c"
5 "firewall.c"
6 "cashu.c"
7 "session.c"
8 "tollgate_api.c" 5 "tollgate_api.c"
9 "identity.c" 6 "identity.c"
10 "nostr_event.c" 7 "nostr_event.c"
@@ -22,4 +19,5 @@ idf_component_register(SRCS "tollgate_main.c"
22 REQUIRES esp_wifi esp_event esp_netif nvs_flash esp_http_server 19 REQUIRES esp_wifi esp_event esp_netif nvs_flash esp_http_server
23 lwip json esp_http_client mbedtls esp-tls log spiffs 20 lwip json esp_http_client mbedtls esp-tls log spiffs
24 nucula_lib secp256k1 axs15231b qrcode 21 nucula_lib secp256k1 axs15231b qrcode
22 tollgate_core
25 PRIV_REQUIRES esp-tls) 23 PRIV_REQUIRES esp-tls)