code wiki / _hdl_build / nx_hub_replicate_gate.nx
nx_hub_replicate_gate.nx
buildroot/runtime/_hdl_build/nx_hub_replicate_gate.nx
about
nx_hub_replicate_gate.nx -- proves HUB-TO-HUB replication end to end: hub B (empty) learns hub A's index via
gossip, PULLS the bytes B lacks, VERIFIES each replica's SHA-256 against the advertised content-id (fail-closed),
adopts them, and becomes a new source. Also proves a content/cid MISMATCH is rejected (a hostile source cannot
poison the mesh). Composes nx_gossip + nx_hub_replicate + nx_dist_index + nx_dist_publish. expect_exit: 0
license_tier: ORIGINAL
dependencies 6 imports · 0 importers
imports: nx_hub_replicate.nxnx_g_puts_lib.nxnx_gossip.nxnx_dist_index.nxnx_dist_publish.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 13 | func g_ck(name: *u8, cond: i64, st: *i64) -> i64 { st[1]=st[1]+1; if cond==1 { st[0]=st[0]+1; g_puts(" [OK] " as *u8) } else { g_puts(" [FAIL] " as *u8) } g_puts(name); g_puts("\n" as *u8); return 0 } |
| 14 | func g_fix(path: *u8, content: *u8, n: i64) -> i64 { let fd: i64=sys_openat_wr(path, 0x1a4); if fd<0 { return 0-1 } sys_write(fd, content, n); sys_close(fd); return 0 } |
| 16 | func main() -> i64 |