upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/font.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-19 02:31:19 +0530
committerYour Name <you@example.com>2026-05-19 02:32:41 +0530
commit81f2dc52dc42d01c89dff45a5407ec40b8863052 (patch)
tree15018c2438639ca89dc6d33a5144c10d0b1c2af0 /main/font.c
parent75688d55b3c8d13c8c9a50da9668ec408f684cb3 (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 'main/font.c')
-rw-r--r--main/font.c132
1 files changed, 132 insertions, 0 deletions
diff --git a/main/font.c b/main/font.c
new file mode 100644
index 0000000..b23928f
--- /dev/null
+++ b/main/font.c
@@ -0,0 +1,132 @@
1#include "font.h"
2
3const uint8_t font8x8_basic[128][8] = {
4 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
5 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
6 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
7 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
8 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
9 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
10 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
11 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
12 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
13 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
14 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
15 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
16 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
17 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
18 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
19 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
20 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
21 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
22 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
23 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
24 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
25 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
26 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
27 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
28 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
29 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
30 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
31 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
32 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
33 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
34 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
35 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
36 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
37 {0x18,0x18,0x18,0x18,0x18,0x00,0x18,0x00},
38 {0x66,0x66,0x00,0x00,0x00,0x00,0x00,0x00},
39 {0x66,0xFF,0x66,0x66,0xFF,0x66,0x00,0x00},
40 {0x18,0x3E,0x58,0x3C,0x1A,0x7C,0x18,0x00},
41 {0x62,0x66,0x0C,0x18,0x30,0x66,0x46,0x00},
42 {0x3C,0x66,0x3C,0x38,0x67,0x66,0x3F,0x00},
43 {0x18,0x18,0x30,0x00,0x00,0x00,0x00,0x00},
44 {0x0C,0x18,0x30,0x30,0x30,0x18,0x0C,0x00},
45 {0x30,0x18,0x0C,0x0C,0x0C,0x18,0x30,0x00},
46 {0x00,0x66,0x3C,0xFF,0x3C,0x66,0x00,0x00},
47 {0x00,0x18,0x18,0x7E,0x18,0x18,0x00,0x00},
48 {0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x30},
49 {0x00,0x00,0x00,0x7E,0x00,0x00,0x00,0x00},
50 {0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00},
51 {0x06,0x0C,0x18,0x30,0x60,0xC0,0x80,0x00},
52 {0x3C,0x66,0x6E,0x7E,0x76,0x66,0x3C,0x00},
53 {0x18,0x38,0x18,0x18,0x18,0x18,0x7E,0x00},
54 {0x3C,0x66,0x06,0x1C,0x30,0x60,0x7E,0x00},
55 {0x3C,0x66,0x06,0x1C,0x06,0x66,0x3C,0x00},
56 {0x1C,0x3C,0x6C,0x6C,0x7E,0x0C,0x0C,0x00},
57 {0x7E,0x60,0x7C,0x06,0x06,0x66,0x3C,0x00},
58 {0x1C,0x30,0x60,0x7C,0x66,0x66,0x3C,0x00},
59 {0x7E,0x06,0x0C,0x18,0x30,0x30,0x30,0x00},
60 {0x3C,0x66,0x66,0x3C,0x66,0x66,0x3C,0x00},
61 {0x3C,0x66,0x66,0x3E,0x06,0x0C,0x38,0x00},
62 {0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x00},
63 {0x00,0x00,0x18,0x18,0x00,0x18,0x18,0x30},
64 {0x0C,0x18,0x30,0x60,0x30,0x18,0x0C,0x00},
65 {0x00,0x00,0x7E,0x00,0x7E,0x00,0x00,0x00},
66 {0x30,0x18,0x0C,0x06,0x0C,0x18,0x30,0x00},
67 {0x3C,0x66,0x0C,0x18,0x18,0x00,0x18,0x00},
68 {0x3C,0x66,0x6E,0x6A,0x6E,0x60,0x3C,0x00},
69 {0x3C,0x66,0x66,0x7E,0x66,0x66,0x66,0x00},
70 {0x7C,0x66,0x66,0x7C,0x66,0x66,0x7C,0x00},
71 {0x3C,0x66,0x60,0x60,0x60,0x66,0x3C,0x00},
72 {0x78,0x6C,0x66,0x66,0x66,0x6C,0x78,0x00},
73 {0x7E,0x60,0x60,0x7C,0x60,0x60,0x7E,0x00},
74 {0x7E,0x60,0x60,0x7C,0x60,0x60,0x60,0x00},
75 {0x3C,0x66,0x60,0x6E,0x66,0x66,0x3C,0x00},
76 {0x66,0x66,0x66,0x7E,0x66,0x66,0x66,0x00},
77 {0x3C,0x18,0x18,0x18,0x18,0x18,0x3C,0x00},
78 {0x1E,0x0C,0x0C,0x0C,0x0C,0x6C,0x38,0x00},
79 {0x66,0x6C,0x78,0x70,0x78,0x6C,0x66,0x00},
80 {0x60,0x60,0x60,0x60,0x60,0x60,0x7E,0x00},
81 {0x63,0x77,0x7F,0x6B,0x63,0x63,0x63,0x00},
82 {0x66,0x76,0x7E,0x7E,0x6E,0x66,0x66,0x00},
83 {0x3C,0x66,0x66,0x66,0x66,0x66,0x3C,0x00},
84 {0x7C,0x66,0x66,0x7C,0x60,0x60,0x60,0x00},
85 {0x3C,0x66,0x66,0x66,0x6A,0x6C,0x36,0x00},
86 {0x7C,0x66,0x66,0x7C,0x6C,0x66,0x66,0x00},
87 {0x3C,0x66,0x60,0x3C,0x06,0x66,0x3C,0x00},
88 {0x7E,0x18,0x18,0x18,0x18,0x18,0x18,0x00},
89 {0x66,0x66,0x66,0x66,0x66,0x66,0x3C,0x00},
90 {0x66,0x66,0x66,0x66,0x66,0x3C,0x18,0x00},
91 {0x63,0x63,0x63,0x6B,0x7F,0x77,0x63,0x00},
92 {0x66,0x66,0x3C,0x18,0x3C,0x66,0x66,0x00},
93 {0x66,0x66,0x66,0x3C,0x18,0x18,0x18,0x00},
94 {0x7E,0x06,0x0C,0x18,0x30,0x60,0x7E,0x00},
95 {0x3C,0x30,0x30,0x30,0x30,0x30,0x3C,0x00},
96 {0xC0,0x60,0x30,0x18,0x0C,0x06,0x03,0x00},
97 {0x3C,0x0C,0x0C,0x0C,0x0C,0x0C,0x3C,0x00},
98 {0x18,0x3C,0x66,0x00,0x00,0x00,0x00,0x00},
99 {0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00},
100 {0x18,0x18,0x0C,0x00,0x00,0x00,0x00,0x00},
101 {0x00,0x00,0x3C,0x06,0x3E,0x66,0x3E,0x00},
102 {0x60,0x60,0x7C,0x66,0x66,0x66,0x7C,0x00},
103 {0x00,0x00,0x3C,0x66,0x60,0x66,0x3C,0x00},
104 {0x06,0x06,0x3E,0x66,0x66,0x66,0x3E,0x00},
105 {0x00,0x00,0x3C,0x66,0x7E,0x60,0x3C,0x00},
106 {0x1C,0x36,0x30,0x7C,0x30,0x30,0x30,0x00},
107 {0x00,0x00,0x3E,0x66,0x66,0x3E,0x06,0x3C},
108 {0x60,0x60,0x7C,0x66,0x66,0x66,0x66,0x00},
109 {0x18,0x00,0x38,0x18,0x18,0x18,0x3C,0x00},
110 {0x0C,0x00,0x1C,0x0C,0x0C,0x0C,0x6C,0x38},
111 {0x60,0x60,0x66,0x6C,0x78,0x6C,0x66,0x00},
112 {0x38,0x18,0x18,0x18,0x18,0x18,0x3C,0x00},
113 {0x00,0x00,0xEC,0xFE,0xD6,0xD6,0xD6,0x00},
114 {0x00,0x00,0x7C,0x66,0x66,0x66,0x66,0x00},
115 {0x00,0x00,0x3C,0x66,0x66,0x66,0x3C,0x00},
116 {0x00,0x00,0x7C,0x66,0x66,0x7C,0x60,0x60},
117 {0x00,0x00,0x3E,0x66,0x66,0x3E,0x06,0x06},
118 {0x00,0x00,0x7C,0x66,0x60,0x60,0x60,0x00},
119 {0x00,0x00,0x3E,0x60,0x3C,0x06,0x7C,0x00},
120 {0x30,0x30,0x7C,0x30,0x30,0x36,0x1C,0x00},
121 {0x00,0x00,0x66,0x66,0x66,0x66,0x3E,0x00},
122 {0x00,0x00,0x66,0x66,0x66,0x3C,0x18,0x00},
123 {0x00,0x00,0xD6,0xD6,0xD6,0xFE,0x6C,0x00},
124 {0x00,0x00,0x66,0x3C,0x18,0x3C,0x66,0x00},
125 {0x00,0x00,0x66,0x66,0x66,0x3E,0x06,0x3C},
126 {0x00,0x00,0x7E,0x0C,0x18,0x30,0x7E,0x00},
127 {0x0C,0x18,0x18,0x70,0x18,0x18,0x0C,0x00},
128 {0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x00},
129 {0x30,0x18,0x18,0x0E,0x18,0x18,0x30,0x00},
130 {0x00,0x00,0x31,0x6B,0x46,0x00,0x00,0x00},
131 {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
132};