upleb.uk

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

summaryrefslogtreecommitdiff
path: root/interop/AGENTS.md
diff options
context:
space:
mode:
Diffstat (limited to 'interop/AGENTS.md')
-rw-r--r--interop/AGENTS.md96
1 files changed, 96 insertions, 0 deletions
diff --git a/interop/AGENTS.md b/interop/AGENTS.md
new file mode 100644
index 0000000..33a2d6d
--- /dev/null
+++ b/interop/AGENTS.md
@@ -0,0 +1,96 @@
1# AGENTS.md — Interop Test Standing Instructions
2
3## Overview
4
5Cross-platform interoperability tests for ESP32 TollGate firmware vs OpenWRT TollGate (tollgate-module-basic-go). Makefile-driven tests that verify Cashu e-cash token compatibility and upstream payment flows between the two implementations.
6
7## Standing Instructions
8
91. **Always maintain these files:**
10 - `INTEROP_PLAN.md` — up-to-date interop test plan
11 - `PROGRESS.md` — checklist of done/pending items
12
132. **Testing requirements:**
14 - All interop targets must be idempotent — safe to re-run
15 - Cleanup targets must restore original state
16 - Never leave a device in a broken state
17
183. **Commit discipline:**
19 - Commit every time a test scenario passes end-to-end
20 - Push after each commit
21
224. **No comments in code** unless explicitly requested
23
245. **No secrets in git** — all secrets in `routers.env` (gitignored) or `.env`
25
266. **Device safety:**
27 - Always save upstream state before changing it
28 - Always restore upstream state after tests
29 - Use router mutex (if shared with other sessions)
30
31## Repository Context
32
33This directory lives inside `esp32-tollgate/interop/`. The parent repo has its own `AGENTS.md` with firmware testing rules. This file covers interop testing only.
34
35## Device Access
36
37| Device | Transport | Address | Notes |
38|--------|-----------|---------|-------|
39| OpenWRT (alpha) | SSH | `root@10.47.41.1` | Ethernet at `enx00e04c683d2d` |
40| ESP32 Board A | WiFi API | `10.192.45.1` | WiFi at `wlp59s0`, SSID `TollGate-C0E9CA` |
41| ESP32 Board A | Serial | `/dev/ttyACM0` | USB serial, 115200 baud |
42| ESP32 Board B | Serial | `/dev/ttyACM1` | USB serial, 115200 baud |
43
44## Token Generation
45
46| Target | Tool | Format | Command |
47|--------|------|--------|---------|
48| ESP32 | `cashu` CLI | V3 (cashuA) | `cashu --env-mint testnut.cashu.space send --legacy 21` |
49| OpenWRT | `mint-token` | V4 | `/tmp/mint-token nofee.testnut.cashu.space 1` |
50
51**ESP32 only accepts V3 tokens.** OpenWRT accepts both V3 and V4.
52
53## Mint URLs
54
55| Mint | URL | Auto-pay |
56|------|-----|----------|
57| testnut | `https://testnut.cashu.space` | Yes |
58| nofee-testnut | `https://nofee.testnut.cashu.space` | Yes |
59
60Both must be in both devices' accepted_mints for cross-platform payment.
61
62## Key Commands
63
64```bash
65# Show all device status
66make interop-status
67
68# Full setup (mints + wallets)
69make interop-setup
70
71# Run individual scenarios
72make interop-laptop-esp32
73make interop-laptop-openwrt
74make interop-openwrt-esp32
75make interop-esp32-esp32
76
77# Cleanup after tests
78make interop-cleanup
79```
80
81## Network Interfaces
82
83| Interface | Device | Purpose |
84|-----------|--------|---------|
85| `enx00e04c683d2d` | Laptop | Ethernet to OpenWRT LAN (`10.47.41.x`) |
86| `wlp59s0` | Laptop | WiFi to ESP32 AP (`10.192.45.x`) |
87
88The laptop has simultaneous connectivity to both devices via different interfaces.
89
90## Troubleshooting
91
92- **OpenWRT unreachable**: Check ethernet cable, `ip addr show enx00e04c683d2d`
93- **ESP32 unreachable**: Check WiFi connection, `nmcli dev wifi connect TollGate-C0E9CA`
94- **Token rejected**: Check mint URL matches accepted_mints on target device
95- **OpenWRT won't auto-pay**: Check wallet balance > 0, check daemon logs `logread -e tollgate-wrt -f`
96- **ESP32 serial**: `python3 -m serial.tools.miniterm /dev/ttyACM0 115200`