upleb.uk

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

summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-15 23:05:46 +0530
committerYour Name <you@example.com>2026-05-15 23:05:46 +0530
commitaed51d824f598f7315282936037c4d5b6e7fb4b8 (patch)
tree1ed148916cc0a90a991fb9d5e84a3197df8ae7ae /Makefile
parent1263d86314fc0760d9be8eea415ccecbc047a5eb (diff)
Fix stack overflow and heap-allocate large buffers in Cashu/payment path
- tollgate_api.c: increase httpd stack_size to 16384 (was default 4096) - cashu.c: heap-allocate b64, json_buf, post_body, resp_buf instead of stack - cashu.c: proper free() on all error paths - Makefile: replace Go-based tokens target with nutshell wallet targets - Makefile: add wallet-setup, wallet-info, wallet-balance, mint-token, send-token
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 34 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 7de799e..2ed8e07 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ PYTHON ?= python3
20.PHONY: help setup detect-ports detect-chip detect-all 20.PHONY: help setup detect-ports detect-chip detect-all
21.PHONY: flash flash-a flash-b monitor monitor-a monitor-b 21.PHONY: flash flash-a flash-b monitor monitor-a monitor-b
22.PHONY: test smoke test-api test-portal test-network test-full 22.PHONY: test smoke test-api test-portal test-network test-full
23.PHONY: tokens test-payment 23.PHONY: tokens test-payment wallet-setup wallet-info wallet-balance mint-token send-token
24.PHONY: clean erase-nvs reset serial-log 24.PHONY: clean erase-nvs reset serial-log
25.PHONY: bootstrap-config 25.PHONY: bootstrap-config
26 26
@@ -47,7 +47,12 @@ help:
47 @echo " test-full All 14 Phase 1 tests" 47 @echo " test-full All 14 Phase 1 tests"
48 @echo "" 48 @echo ""
49 @echo "Test (Phase 2):" 49 @echo "Test (Phase 2):"
50 @echo " tokens Mint test Cashu tokens (AMOUNT=21)" 50 @echo " wallet-setup Initialize nutshell wallet for test mint"
51 @echo " wallet-info Show mint info"
52 @echo " wallet-balance Show wallet balance"
53 @echo " mint-token Invoice + send test token (AMOUNT=21)"
54 @echo " send-token Send cashuA token (AMOUNT=21)"
55 @echo " tokens Alias for send-token"
51 @echo " test-payment Payment flow tests" 56 @echo " test-payment Payment flow tests"
52 @echo "" 57 @echo ""
53 @echo "Utilities:" 58 @echo "Utilities:"
@@ -165,17 +170,39 @@ test-full: test-api test-portal test-network
165 @echo "=== Full test suite passed ===" 170 @echo "=== Full test suite passed ==="
166 171
167# ────────────────────────────────────────────── 172# ──────────────────────────────────────────────
168# Phase 2: Payment Testing 173# Phase 2: Payment Testing (Nutshell wallet)
169# ────────────────────────────────────────────── 174# ──────────────────────────────────────────────
170 175
171tokens: 176wallet-setup:
172 @echo "=== Minting test tokens from $(TEST_MINT) ===" 177 @echo "=== Setting up Nutshell wallet for $(TEST_MINT) ==="
178 cashu --env-mint $(TEST_MINT) info 2>/dev/null || \
179 cashu --env-mint $(TEST_MINT) restore
180
181wallet-info:
182 @echo "=== Mint info ==="
183 cashu --env-mint $(TEST_MINT) info
184
185wallet-balance:
186 @echo "=== Wallet balance ==="
187 cashu --env-mint $(TEST_MINT) balance
188
189mint-token:
190 @echo "=== Minting test token (AMOUNT=$(or $(AMOUNT),21)) ==="
173 @AMOUNT=$${AMOUNT:-21}; \ 191 @AMOUNT=$${AMOUNT:-21}; \
174 cd scripts/mint-token && go run main.go -mint https://$(TEST_MINT) -amount $$AMOUNT 192 cashu --env-mint $(TEST_MINT) invoice $$AMOUNT && \
193 echo "--- Token (cashuA legacy) ---" && \
194 cashu --env-mint $(TEST_MINT) send --legacy $$AMOUNT
195
196send-token:
197 @AMOUNT=$${AMOUNT:-21}; \
198 echo "=== Sending $$AMOUNT sats as cashuA token ===" && \
199 cashu --env-mint $(TEST_MINT) send --legacy $$AMOUNT
200
201tokens: send-token
175 202
176test-payment: 203test-payment:
177 @echo "=== Running payment tests ===" 204 @echo "=== Running payment tests ==="
178 $(NODE) tests/payment.mjs 205 $(NODE) tests/phase2.mjs
179 206
180# ────────────────────────────────────────────── 207# ──────────────────────────────────────────────
181# Utilities 208# Utilities