upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/negentropy_adapter.h
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-19 04:10:12 +0530
committerYour Name <you@example.com>2026-05-19 04:10:12 +0530
commit2d78aadfd603fab9a9342b1281ad1d46ad82cf1d (patch)
tree3e8875b7e0301ac6634548e186542e2d67a68f34 /main/negentropy_adapter.h
parentabee221b0f0e5a4513ab126afbdfddc2728df6be (diff)
feat: relay hardening — restore build, add tests, negentropy adapter
Restores build broken by eeb9d2d (cvm-relay-stability removed deps): - CMakeLists.txt: restore display.c, font.c, local_relay.c, relay_selector.c, sync_manager.c, axs15231b, qrcode, wisp_relay - tollgate_main.c: restore display.h, local_relay.h, relay_selector.h, sync_manager.h includes and display calls - cvm_server.c: kept master's keepalive/timeout/ping-pong fixes New test infrastructure: - test-local-relay, test-relay-nip11, test-cvm-roundtrip, test-cvm-mcp, test-cross-board make targets - test-cvm-roundtrip.mjs: MCP get_config + get_balance via public relay - test-cross-board.mjs: cross-board payment test - test-cvm-mcp-relay.mjs: kept from master New unit tests (35 tests): - test_display.c: 22 tests for escape_wifi_field - test_negentropy_adapter.c: 13 tests for negentropy adapter New modules: - negentropy_adapter.c/h: NIP-77 adapter skeleton Docs: - AGENTS.md: display module docs, new test commands - RELAY_HARDENING_PLAN.md: hardening checklist - RELAY_HARDENING_MERGE.md: merge plan and checklist Cleanup: - Removed CHECKLIST-CVM-RELAY.md, PLAN-SQUASH-MERGE.md (stale planning docs) - Removed components/esp-miner submodule Host unit tests: 63/63 pass
Diffstat (limited to 'main/negentropy_adapter.h')
-rw-r--r--main/negentropy_adapter.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/main/negentropy_adapter.h b/main/negentropy_adapter.h
new file mode 100644
index 0000000..1e8c0a8
--- /dev/null
+++ b/main/negentropy_adapter.h
@@ -0,0 +1,27 @@
1#ifndef NEGENTROPY_ADAPTER_H
2#define NEGENTROPY_ADAPTER_H
3
4#include "esp_err.h"
5#include <stdint.h>
6#include <stddef.h>
7
8typedef struct {
9 uint64_t created_at;
10 uint8_t id[32];
11} negentropy_item_t;
12
13typedef struct negentropy_adapter negentropy_adapter_t;
14
15negentropy_adapter_t *negentropy_adapter_from_storage(void *storage_engine);
16
17esp_err_t negentropy_adapter_get_items(negentropy_adapter_t *adapter,
18 negentropy_item_t **items,
19 size_t *count);
20
21esp_err_t negentropy_adapter_insert_item(negentropy_adapter_t *adapter,
22 uint64_t created_at,
23 const uint8_t *id);
24
25void negentropy_adapter_destroy(negentropy_adapter_t *adapter);
26
27#endif