From 81f2dc52dc42d01c89dff45a5407ec40b8863052 Mon Sep 17 00:00:00 2001 From: Your Name Date: Tue, 19 May 2026 02:31:19 +0530 Subject: feat: local Nostr relay with relay selection, sync, and integration tests Local Nostr relay (NIP-01) on port 4869 with LittleFS 4MB storage. All events published locally first, then synced to public relays via REQ-diff. Relay selection via NIP-11 HTTP probing with NIP-77 scoring and auto-failover. Components: - wisp_relay: 16-file local relay (ws_server, storage_engine, sub_manager, broadcaster, relay_validator, router, handlers, rate_limiter, nip11, deletion, flash_monitor, relay_types) - esp_littlefs: LittleFS VFS integration (git submodule) - negentropy: for future NIP-77 binary sync (git submodule) New source files: - local_relay.c/h: thin wrapper for relay init/start/publish - relay_selector.c/h: NIP-11 probe + scoring + auto-failover - sync_manager.c/h: REQ-diff sync (primary 30min, fallback 6h) Bug fixes: - config.c: use-after-free (cJSON_Delete before seed_relays/sync parsing) - local_relay: moved init to app_main for boot-time start (not gated on STA IP) Flash layout: 4MB LittleFS partition at 0x500000 for relay_store Test results (Board B, live hardware): - Smoke: ping + HTTP 4869 + NIP-11: PASS - NIP-11 info document: 10/11 PASS - WS pub/sub (connect, REQ/EOSE, EVENT/OK, CLOSE, concurrent): 6/6 PASS - Unit tests (relay_validator + relay_selector): 13/13 PASS Hardware test make targets in physical-router-test-automation/: - make relay-build, relay-flash-b, relay-test-smoke/nip11/pubsub/sync/full --- partitions.csv | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'partitions.csv') diff --git a/partitions.csv b/partitions.csv index 8998d84..10bda86 100644 --- a/partitions.csv +++ b/partitions.csv @@ -2,4 +2,5 @@ nvs, data, nvs, 0x9000, 0x6000, phy_init, data, phy, 0xf000, 0x1000, factory, app, factory, 0x10000, 0x3F0000, -storage, data, spiffs, 0x410000,0xF0000, +storage, data, spiffs, 0x410000,0xF0000, +relay_store, data, 0x99, 0x500000,0x400000, -- cgit v1.2.3