upleb.uk

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

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-19 14:14:12 +0530
committerYour Name <you@example.com>2026-05-19 14:14:12 +0530
commit163b8badec9359373a8fc016c2b1fe9ee38e6406 (patch)
tree4b33353a53a5cad297d2806fcc5326d6e5d0a4f8
parenteeba74a4a1c011e85e33dea4252b381e35a64ea4 (diff)
docs: update relay lists + add merge plan
- nostr_relays: 2->4 (+relay.anzenkodo.workers.dev, +nostr.koning-degraaf.nl) - nostr_seed_relays: 4->8 (+relay.anzenkodo.workers.dev, +nostr.koning-degraaf.nl, +knostr.neutrine.com, +nostr.einundzwanzig.space) - Add MERGE_PLAN.md with squash-merge execution checklist
-rw-r--r--AGENTS.md12
-rw-r--r--MERGE_PLAN.md119
2 files changed, 127 insertions, 4 deletions
diff --git a/AGENTS.md b/AGENTS.md
index 2c16a8a..f46de4d 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -91,13 +91,17 @@ nvs_flash_init()
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",
94 "nostr_relays": ["wss://relay.damus.io", "wss://nos.lol"], 94 "nostr_relays": ["wss://relay.damus.io", "wss://nos.lol", "wss://relay.anzenkodo.workers.dev", "wss://nostr.koning-degraaf.nl"],
95 "nostr_publish_interval_s": 21600, 95 "nostr_publish_interval_s": 21600,
96 "nostr_seed_relays": [ 96 "nostr_seed_relays": [
97 "wss://relay.orangesync.tech", 97 "wss://relay.orangesync.tech",
98 "wss://relay.damus.io", 98 "wss://relay.damus.io",
99 "wss://nos.lol", 99 "wss://nos.lol",
100 "wss://relay.nostr.band" 100 "wss://relay.nostr.band",
101 "wss://relay.anzenkodo.workers.dev",
102 "wss://nostr.koning-degraaf.nl",
103 "wss://knostr.neutrine.com",
104 "wss://nostr.einundzwanzig.space"
101 ], 105 ],
102 "nostr_sync_interval_s": 1800, 106 "nostr_sync_interval_s": 1800,
103 "nostr_fallback_sync_interval_s": 21600, 107 "nostr_fallback_sync_interval_s": 21600,
@@ -214,8 +218,8 @@ make flash-b # flash to Board B
214## External Dependencies 218## External Dependencies
215 219
216- **Test mint:** `testnut.cashu.space` — auto-pays lightning invoices 220- **Test mint:** `testnut.cashu.space` — auto-pays lightning invoices
217- **Nostr relays:** `relay.damus.io`, `nos.lol` — for wifistr events 221- **Nostr relays:** `relay.damus.io`, `nos.lol`, `relay.anzenkodo.workers.dev`, `nostr.koning-degraaf.nl` — for wifistr events
218- **Seed relays:** `relay.orangesync.tech` (NIP-77), `relay.damus.io`, `nos.lol`, `relay.nostr.band` — 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
219- **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
220- **Local relay:** Port 4869, LittleFS 4MB partition at 0x500000, max 5000 events, 21-day TTL 224- **Local relay:** Port 4869, LittleFS 4MB partition at 0x500000, max 5000 events, 21-day TTL
221- **Nutshell CLI:** `cashu` command for token generation 225- **Nutshell CLI:** `cashu` command for token generation
diff --git a/MERGE_PLAN.md b/MERGE_PLAN.md
new file mode 100644
index 0000000..ff60e4b
--- /dev/null
+++ b/MERGE_PLAN.md
@@ -0,0 +1,119 @@
1# Mining Feature: Squash-Merge Execution Plan
2
3## Overview
4Squash-merge `feature/mining-payment` into `master`, update relay config, push.
5
6## Repositories
7- **Shared repo:** `/home/c03rad0r/esp32-tollgate` (master)
8- **Mining worktree:** `/home/c03rad0r/esp32-tollgate-mining` (feature/mining-payment)
9- **Backup:** `/home/c03rad0r/mining-work-backup/`
10
11## Checklist
12
13### Phase 1: Documentation & Config Updates
14- [ ] 1.1 Write this MERGE_PLAN.md
15- [ ] 1.2 Update `config.c` — add relays to nostr_seed_relays (8/8) and nostr_relays (4/4)
16- [ ] 1.3 Update `AGENTS.md` — reflect new relay lists in shared repo
17- [ ] 1.4 Commit relay config changes to worktree
18
19### Phase 2: Rebase & Test
20- [ ] 2.1 Rebase `feature/mining-payment` onto `master`
21- [ ] 2.2 Run `make test-unit` — all 15 suites must pass
22
23### Phase 3: Backup
24- [ ] 3.1 Backup branch to `/home/c03rad0r/mining-work-backup/`
25
26### Phase 4: Squash-Merge
27- [ ] 4.1 Squash-merge `feature/mining-payment` into `master` with detailed body
28- [ ] 4.2 Run `make test-unit` on master to confirm
29- [ ] 4.3 Run `idf.py build` on master to confirm clean build
30
31### Phase 5: Push & Cleanup
32- [ ] 5.1 Push master to origin
33- [ ] 5.2 Remove git worktree
34- [ ] 5.3 Update MINING_WORKTREE_PLAN.md checklist
35
36## Relay Updates
37
38### nostr_seed_relays (TOLLGATE_MAX_SEED_RELAYS = 8)
39| Slot | Relay | Latency | Notes |
40|------|-------|---------|-------|
41| 0 | wss://relay.orangesync.tech | existing | NIP-77 |
42| 1 | wss://relay.damus.io | existing | |
43| 2 | wss://nos.lol | existing | |
44| 3 | wss://relay.nostr.band | existing | |
45| 4 | wss://relay.anzenkodo.workers.dev | 90ms | FR, NIP-01 |
46| 5 | wss://nostr.koning-degraaf.nl | 91ms | NL, NIP-01 |
47| 6 | wss://knostr.neutrine.com | 103ms | FR, NIP-01 |
48| 7 | wss://nostr.einundzwanzig.space | 106ms | DE |
49
50### nostr_relays (TOLLGATE_MAX_RELAYS = 4)
51| Slot | Relay | Notes |
52|------|-------|-------|
53| 0 | wss://relay.damus.io | existing |
54| 1 | wss://nos.lol | existing |
55| 2 | wss://relay.anzenkodo.workers.dev | NEW |
56| 3 | wss://nostr.koning-degraaf.nl | NEW |
57
58## Squash Commit Message
59```
60feat(mining): Bitcoin mining-for-bandwidth payment system
61
62New modules:
63- mining_payment.c/h: hashprice calc (nbits->difficulty->sat/GH/s/day),
64 share validation, client stats, allotment conversion (ms + bytes)
65- stratum_client.c/h: SV1 upstream pool connection (subscribe/authorize/submit)
66- stratum_proxy.c/h: Local SV1 TCP server for downstream miners, job broadcast
67- sw_miner.c/h: Software SHA256d miner (ESP32 CPU fallback)
68- asic_miner.c/h: ASIC detection stub (BM1366/BM1368 SPI)
69
70Config:
71- config.h/c: mining_payout_mode_t enum (auto/pool/upstream/proxy_only),
72 stratum pool settings, mining port, hashprice override, sandbox mint access
73- Defaults fill nostr_seed_relays (8/8) and nostr_relays (4/4) with fast relays
74
75Integration into existing modules:
76- session.h/c: payment_method_t enum (CASHU/MINING/BYTES)
77- firewall.h/c: firewall_set_mining_port(), firewall_set_sandbox_mint_access()
78- tollgate_api.c: GET /mining/job, POST /mining/share, GET /mining/stats
79- tollgate_client.h/c: TG_CLIENT_MINING state, mining discovery tag parsing
80- tollgate_main.c: mining init in start_services(), stratum_client_tick() in loop
81- captive_portal.c: tabbed Cashu/Mine UI with live hashrate polling
82
83Unit tests (69 new assertions across 4 suites):
84- test_mining_payment (23 tests): nbits->difficulty, hashprice, client stats, allotment
85- test_stratum_proxy (21 tests): job set/get, stats, type validation
86- test_session_payment_method (12 tests): PAYMENT_METHOD enum, bytes/cashu methods
87- test_tollgate_client_mining (20 tests): mining tag parsing, discovery struct
88- test_firewall_sandbox (16 tests): client grant/revoke, max clients, setters
89
90Enhanced test stubs:
91- BaseType_t/pdPASS in freertos/task.h
92- lwip: sockets.h, etharp.h, prot/ip.h, prot/ip4.h, prot/tcp.h, netif.h
93- dns_server.h, esp_wifi_ap_get_sta_list.h
94
95Build fixes:
96- cvm_server.c: replace esp_timer_get_time() with xTaskGetTickCount(),
97 fix process_relay_message() 3-arg call to 2-arg
98- stratum_proxy.c: widen task_name buffer 16->20
99- sw_miner.c: add missing #include esp_random.h
100- nucula_src: save_proofs() moved to public in wallet.hpp
101
102Nostr relay updates:
103- nostr_seed_relays: +relay.anzenkodo.workers.dev, +nostr.koning-degraaf.nl,
104 +knostr.neutrine.com, +nostr.einundzwanzig.space (8/8 slots)
105- nostr_relays: +relay.anzenkodo.workers.dev, +nostr.koning-degraaf.nl (4/4 slots)
106
107Binary: 1.2MB, 70% partition free (ESP32-S3, 16MB flash)
108```
109
110## Commits on feature/mining-payment (before squash)
1111. `c75230e` — feat(mining): add new mining source files and unit tests
1122. `beb73a2` — feat(mining): integrate mining subsystem into existing modules
1133. `473b4d1` — fix: build errors in cvm_server, stratum_proxy, sw_miner + nucula visibility
1144. `ef9ae98` — test: add 4 new unit test suites for mining modules
115
116## Rules
117- No comments in code unless explicitly requested
118- Commit + push after each checkpoint
119- Shared repo must stay on master, clean