code wiki / _hdl_build / nx_dist_publish_run.nx
nx_dist_publish_run.nx
buildroot/runtime/_hdl_build/nx_dist_publish_run.nx
about
nx_dist_publish_run.nx -- MAKE IT REAL: a runnable that publishes a REAL file on the NAS into the hub's
distribution index (operator: "when we get data on the hub we can pass it to other systems"). Runs ON THE NAS
(hashing a 1.25GB shard over 9p would crash WSL). Composes the enabler (nx_dist_publish): SHA-256 the real bytes
-> content-id -> BT-v2 magnet + HTTPS url + /api/dist + append a row to /volume1/ai/dist/dist_index.conf (the
persistent Napster registry), idempotent (skip if the cid is already present -- the has-cid check is inlined to
keep this a single-lib import). Launched by the allowlisted nx_hostctl `distpub` action. expect_exit: 0
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_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
| 10 | const K_MAGIC_1048576: i64 = 1048576 |
| 11 | const K_MAGIC_1024: i64 = 1024 |
| 12 | const K_MAGIC_4096: i64 = 4096 |
functions
| 14 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 15 | func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 16 | func dpr_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } called by 1: dpr_contains |
| 17 | func dpr_contains(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 23 | func dpr_has_cid(buf: *u8, blen: i64, cid: *u8) -> i64 |
| 29 | func main() -> i64 |