diff options
| author | Your Name <you@example.com> | 2026-05-19 02:31:19 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-19 02:32:41 +0530 |
| commit | 81f2dc52dc42d01c89dff45a5407ec40b8863052 (patch) | |
| tree | 15018c2438639ca89dc6d33a5144c10d0b1c2af0 /tests/unit/Makefile | |
| parent | 75688d55b3c8d13c8c9a50da9668ec408f684cb3 (diff) | |
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
Diffstat (limited to 'tests/unit/Makefile')
| -rw-r--r-- | tests/unit/Makefile | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/unit/Makefile b/tests/unit/Makefile index b103eef..7ebc3b2 100644 --- a/tests/unit/Makefile +++ b/tests/unit/Makefile | |||
| @@ -22,7 +22,7 @@ LDFLAGS := -lmbedcrypto -lcjson -lm | |||
| 22 | 22 | ||
| 23 | SECP256K1_OBJ := secp256k1.o precomputed_ecmult.o precomputed_ecmult_gen.o | 23 | SECP256K1_OBJ := secp256k1.o precomputed_ecmult.o precomputed_ecmult_gen.o |
| 24 | 24 | ||
| 25 | TESTS := test_geohash test_identity test_nostr_event test_cashu test_session test_tollgate_client test_lnurl_pay test_lightning_payout test_mcp_handler test_nip04 test_cvm_server test_relay_validator test_relay_selector | 25 | TESTS := test_geohash test_identity test_nostr_event test_cashu test_session test_tollgate_client test_lnurl_pay test_lightning_payout test_mcp_handler test_nip04 test_cvm_server |
| 26 | 26 | ||
| 27 | .PHONY: all test clean $(TESTS) | 27 | .PHONY: all test clean $(TESTS) |
| 28 | 28 | ||
| @@ -81,11 +81,5 @@ test_nip04: test_nip04.c $(REPO_ROOT)/main/nip04.c $(SECP256K1_OBJ) | |||
| 81 | test_cvm_server: test_cvm_server.c | 81 | test_cvm_server: test_cvm_server.c |
| 82 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) | 82 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) |
| 83 | 83 | ||
| 84 | test_relay_validator: test_relay_validator.c $(REPO_ROOT)/main/nostr_event.c $(REPO_ROOT)/main/identity.c $(REPO_ROOT)/components/wisp_relay/relay_validator.c $(SECP256K1_OBJ) | ||
| 85 | $(CC) $(CFLAGS) -I $(SECP256K1_PRIV_INC) -I $(REPO_ROOT)/components/wisp_relay $< $(REPO_ROOT)/main/nostr_event.c $(REPO_ROOT)/main/identity.c $(REPO_ROOT)/components/wisp_relay/relay_validator.c $(SECP256K1_OBJ) -o $@ $(LDFLAGS) | ||
| 86 | |||
| 87 | test_relay_selector: test_relay_selector.c | ||
| 88 | $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) | ||
| 89 | |||
| 90 | clean: | 84 | clean: |
| 91 | rm -f $(TESTS) $(SECP256K1_OBJ) | 85 | rm -f $(TESTS) $(SECP256K1_OBJ) |