upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--AGENTS.md6
-rw-r--r--main/config.c4
-rw-r--r--main/mint_health.c7
-rw-r--r--main/tollgate_api.c16
-rw-r--r--main/tollgate_platform.c2
5 files changed, 7 insertions, 28 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 7c7d8d7..99caf41 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -87,7 +87,7 @@ nvs_flash_init()
87 "nsec": "<64-char hex>", 87 "nsec": "<64-char hex>",
88 "wifi_networks": [{"ssid":"...", "password":"..."}], 88 "wifi_networks": [{"ssid":"...", "password":"..."}],
89 "ap_password": "", 89 "ap_password": "",
90 "mint_url": "https://testnut.cashu.space", 90 "mint_url": "https://testnut-nutshell.mints.orangesync.tech",
91 "price_per_step": 21, 91 "price_per_step": 21,
92 "step_size_ms": 60000, 92 "step_size_ms": 60000,
93 "nostr_geohash": "u281w0dfz", 93 "nostr_geohash": "u281w0dfz",
@@ -199,7 +199,7 @@ make flash-b # flash to Board B
199### Integration Tests (`tests/integration/`) 199### Integration Tests (`tests/integration/`)
200- Node.js scripts that run curl/ping/nmcli against a live ESP32 board 200- Node.js scripts that run curl/ping/nmcli against a live ESP32 board
201- Require `TOLLGATE_IP` env var (default: auto-detect or error) 201- Require `TOLLGATE_IP` env var (default: auto-detect or error)
202- Token generation via nutshell CLI: `cashu -h https://testnut.cashu.space send --legacy 21` 202- Token generation via nutshell CLI: `cashu -h https://testnut-nutshell.mints.orangesync.tech send --legacy 21`
203 203
204### E2E Tests (`tests/e2e/`) 204### E2E Tests (`tests/e2e/`)
205- Playwright browser tests 205- Playwright browser tests
@@ -217,7 +217,7 @@ make flash-b # flash to Board B
217 217
218## External Dependencies 218## External Dependencies
219 219
220- **Test mint:** `testnut.cashu.space` — auto-pays lightning invoices 220- **Test mint:** `testnut-nutshell.mints.orangesync.tech` — Nutshell/0.20.0, works with cashu CLI
221- **Nostr relays:** `relay.damus.io`, `nos.lol`, `relay.anzenkodo.workers.dev`, `nostr.koning-degraaf.nl` — for wifistr events 221- **Nostr relays:** `relay.damus.io`, `nos.lol`, `relay.anzenkodo.workers.dev`, `nostr.koning-degraaf.nl` — for wifistr events
222- **Seed relays:** `relay.orangesync.tech` (NIP-77), `relay.damus.io`, `nos.lol`, `relay.nostr.band`, `relay.anzenkodo.workers.dev`, `nostr.koning-degraaf.nl`, `knostr.neutrine.com`, `nostr.einundzwanzig.space` — for relay selection and sync 222- **Seed relays:** `relay.orangesync.tech` (NIP-77), `relay.damus.io`, `nos.lol`, `relay.nostr.band`, `relay.anzenkodo.workers.dev`, `nostr.koning-degraaf.nl`, `knostr.neutrine.com`, `nostr.einundzwanzig.space` — for relay selection and sync
223- **CVM relay:** `relay.primal.net` — for ContextVM kind 25910 events and CEP-6 announcements 223- **CVM relay:** `relay.primal.net` — for ContextVM kind 25910 events and CEP-6 announcements
diff --git a/main/config.c b/main/config.c
index 9d0d54c..e3cbf46 100644
--- a/main/config.c
+++ b/main/config.c
@@ -71,8 +71,8 @@ esp_err_t tollgate_config_init(void)
71 "{\"ssid\":\"c03rad0r\",\"password\":\"c03rad0r123\"}" 71 "{\"ssid\":\"c03rad0r\",\"password\":\"c03rad0r123\"}"
72 "]," 72 "],"
73 "\"ap_password\":\"\"," 73 "\"ap_password\":\"\","
74 "\"mint_url\":\"https://testnut.cashu.space\"," 74 "\"mint_url\":\"https://testnut-nutshell.mints.orangesync.tech\","
75 "\"accepted_mints\":[\"https://testnut.cashu.space\"]," 75 "\"accepted_mints\":[\"https://testnut-nutshell.mints.orangesync.tech\"],"
76 "\"price_per_step\":21," 76 "\"price_per_step\":21,"
77 "\"step_size_ms\":60000," 77 "\"step_size_ms\":60000,"
78 "\"nostr_geohash\":\"u281w0dfz\"," 78 "\"nostr_geohash\":\"u281w0dfz\","
diff --git a/main/mint_health.c b/main/mint_health.c
index 26d73a6..a551295 100644
--- a/main/mint_health.c
+++ b/main/mint_health.c
@@ -7,7 +7,6 @@
7#include "freertos/semphr.h" 7#include "freertos/semphr.h"
8#include <string.h> 8#include <string.h>
9#include <stdlib.h> 9#include <stdlib.h>
10#include <errno.h>
11 10
12static const char *TAG = "mint_health"; 11static const char *TAG = "mint_health";
13 12
@@ -64,16 +63,13 @@ static bool probe_mint(const char *url)
64 }; 63 };
65 esp_http_client_handle_t client = esp_http_client_init(&config); 64 esp_http_client_handle_t client = esp_http_client_init(&config);
66 if (!client) { 65 if (!client) {
67 ESP_LOGE(TAG, "probe: init failed for %s", probe_url);
68 s_last_probe_err = -1; 66 s_last_probe_err = -1;
69 return false; 67 return false;
70 } 68 }
71 69
72 esp_err_t err = esp_http_client_open(client, 0); 70 esp_err_t err = esp_http_client_open(client, 0);
73 if (err != ESP_OK) { 71 if (err != ESP_OK) {
74 ESP_LOGE(TAG, "probe: open failed for %s err=0x%x", probe_url, err); 72 ESP_LOGD(TAG, "probe open failed: %s err=0x%x", probe_url, err);
75 int sc = esp_http_client_get_status_code(client);
76 ESP_LOGE(TAG, "probe: status=%d errno=%d(%s)", sc, errno, strerror(errno));
77 s_last_probe_err = err; 73 s_last_probe_err = err;
78 esp_http_client_cleanup(client); 74 esp_http_client_cleanup(client);
79 return false; 75 return false;
@@ -81,7 +77,6 @@ static bool probe_mint(const char *url)
81 77
82 int content_length = esp_http_client_fetch_headers(client); 78 int content_length = esp_http_client_fetch_headers(client);
83 int status = esp_http_client_get_status_code(client); 79 int status = esp_http_client_get_status_code(client);
84 ESP_LOGI(TAG, "probe: %s -> status=%d len=%d", probe_url, status, content_length);
85 s_last_probe_err = 0; 80 s_last_probe_err = 0;
86 81
87 char *resp = NULL; 82 char *resp = NULL;
diff --git a/main/tollgate_api.c b/main/tollgate_api.c
index 5ac0543..80fe6ed 100644
--- a/main/tollgate_api.c
+++ b/main/tollgate_api.c
@@ -6,9 +6,6 @@
6#include "captive_portal.h" 6#include "captive_portal.h"
7#include "firewall.h" 7#include "firewall.h"
8#include "lwip/dns.h" 8#include "lwip/dns.h"
9#include "lwip/netdb.h"
10#include "esp_http_client.h"
11#include "esp_crt_bundle.h"
12#include "esp_heap_caps.h" 9#include "esp_heap_caps.h"
13#include "nucula_wallet.h" 10#include "nucula_wallet.h"
14#include "mint_health.h" 11#include "mint_health.h"
@@ -734,19 +731,6 @@ static esp_err_t api_get_debug(httpd_req_t *req)
734 cJSON_AddStringToObject(root, "sta_ip", sta_ip_str); 731 cJSON_AddStringToObject(root, "sta_ip", sta_ip_str);
735 cJSON_AddStringToObject(root, "sta_gw", sta_gw_str); 732 cJSON_AddStringToObject(root, "sta_gw", sta_gw_str);
736 733
737 struct addrinfo hints = {0}, *res = NULL;
738 hints.ai_family = AF_INET;
739 int dns_rc = getaddrinfo("testnut-compat.mints.orangesync.tech", NULL, &hints, &res);
740 if (dns_rc == 0 && res) {
741 struct sockaddr_in *addr = (struct sockaddr_in *)res->ai_addr;
742 char resolved[16];
743 snprintf(resolved, sizeof(resolved), IPSTR, IP2STR(&(esp_ip4_addr_t){.addr=addr->sin_addr.s_addr}));
744 cJSON_AddStringToObject(root, "dns_resolve", resolved);
745 } else {
746 cJSON_AddStringToObject(root, "dns_resolve", dns_rc == 0 ? "no-addr" : "FAIL");
747 }
748 if (res) freeaddrinfo(res);
749
750 char *json = cJSON_PrintUnformatted(root); 734 char *json = cJSON_PrintUnformatted(root);
751 httpd_resp_set_type(req, "application/json"); 735 httpd_resp_set_type(req, "application/json");
752 httpd_resp_sendstr(req, json); 736 httpd_resp_sendstr(req, json);
diff --git a/main/tollgate_platform.c b/main/tollgate_platform.c
index 4083c4e..fe8ac2d 100644
--- a/main/tollgate_platform.c
+++ b/main/tollgate_platform.c
@@ -22,7 +22,7 @@ static int32_t platform_get_step_ms(void)
22static const char *platform_get_mint_url(void) 22static const char *platform_get_mint_url(void)
23{ 23{
24 const tollgate_config_t *cfg = tollgate_config_get(); 24 const tollgate_config_t *cfg = tollgate_config_get();
25 return cfg ? cfg->mint_url : "https://testnut.cashu.space"; 25 return cfg ? cfg->mint_url : "https://testnut-nutshell.mints.orangesync.tech";
26} 26}
27 27
28static const char *platform_get_metric(void) 28static const char *platform_get_metric(void)