diff options
| author | Your Name <you@example.com> | 2026-05-23 06:32:21 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-23 06:32:21 +0530 |
| commit | a40cf60d5dff114bfd82aa74db767433564a29c0 (patch) | |
| tree | 6a134558a7af0fa5f7223753380b9183d34a4ed2 /components/tollgate_core/README.md | |
| parent | 0642900ae44d84cfe24abe6911dbed4cd31ab8ad (diff) | |
Phase 10a: component metadata v1.1.0, README, CHANGELOG
- idf_component.yml updated: v1.1.0, description, url, IDF >=5.3
- README.md with integration guide, API reference, dependencies
- CHANGELOG.md tracking v1.0.0 and v1.1.0 releases
- All 21 unit tests pass, ESP-IDF build passes
Diffstat (limited to 'components/tollgate_core/README.md')
| -rw-r--r-- | components/tollgate_core/README.md | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/components/tollgate_core/README.md b/components/tollgate_core/README.md new file mode 100644 index 0000000..d83d634 --- /dev/null +++ b/components/tollgate_core/README.md | |||
| @@ -0,0 +1,71 @@ | |||
| 1 | # tollgate_core | ||
| 2 | |||
| 3 | ESP-IDF component providing paid WiFi hotspot logic with Cashu e-cash payments. | ||
| 4 | |||
| 5 | ## Features | ||
| 6 | |||
| 7 | - **Session management** — time-based and bytes-based sessions with auto-expiry | ||
| 8 | - **Cashu token processing** — decode Cashu e-cash tokens, calculate allotments, multi-mint support | ||
| 9 | - **Per-client firewall** — whitelist-based NAT filtering with sandbox mode | ||
| 10 | - **DNS server** — per-client DNS hijack/forward with DoT rejection | ||
| 11 | - **Mining payment** — Stratum share tracking, hashprice calculation, difficulty conversion | ||
| 12 | - **Stratum proxy** — transparent TCP proxy for mining traffic with job management | ||
| 13 | - **Beacon price** — WiFi vendor IE construction for price/mint/geohash advertising | ||
| 14 | - **Market scanner** — discover and compare nearby TollGate prices | ||
| 15 | |||
| 16 | ## Integration | ||
| 17 | |||
| 18 | ### 1. Implement platform callbacks | ||
| 19 | |||
| 20 | ```c | ||
| 21 | #include "tollgate_platform.h" | ||
| 22 | |||
| 23 | static tollgate_platform_t platform = { | ||
| 24 | .get_price_sats = my_get_price, | ||
| 25 | .get_step_ms = my_get_step_ms, | ||
| 26 | .get_mint_url = my_get_mint_url, | ||
| 27 | .get_metric = my_get_metric, | ||
| 28 | .get_time_ms = my_get_time_ms, | ||
| 29 | // ... other callbacks | ||
| 30 | }; | ||
| 31 | ``` | ||
| 32 | |||
| 33 | ### 2. Initialize | ||
| 34 | |||
| 35 | ```c | ||
| 36 | #include "tollgate_core.h" | ||
| 37 | |||
| 38 | esp_ip4_addr_t ap_ip; | ||
| 39 | IP4_ADDR(&ap_ip, 192, 168, 4, 1); | ||
| 40 | tollgate_core_init(&platform, ap_ip); | ||
| 41 | |||
| 42 | esp_ip4_addr_t dns; | ||
| 43 | IP4_ADDR(&dns, 8, 8, 8, 8); | ||
| 44 | tollgate_core_dns_start(dns); | ||
| 45 | ``` | ||
| 46 | |||
| 47 | ### 3. Process payments | ||
| 48 | |||
| 49 | ```c | ||
| 50 | tollgate_core_process_payment(client_ip, cashu_token_string); | ||
| 51 | ``` | ||
| 52 | |||
| 53 | ### 4. Tick | ||
| 54 | |||
| 55 | Call `tollgate_core_tick()` periodically (e.g., every second) to expire sessions. | ||
| 56 | |||
| 57 | ## API Reference | ||
| 58 | |||
| 59 | See `include/tollgate_core.h` for the public API and `include/tollgate_platform.h` for platform callbacks. | ||
| 60 | |||
| 61 | ## Dependencies | ||
| 62 | |||
| 63 | - ESP-IDF >= 5.3 | ||
| 64 | - mbedtls (SHA-256, HMAC) | ||
| 65 | - cJSON | ||
| 66 | - lwip | ||
| 67 | - esp_wifi (for beacon/market features) | ||
| 68 | |||
| 69 | ## License | ||
| 70 | |||
| 71 | Proprietary — see repository for details. | ||