nx_forge_model_fetch.nx
buildroot/runtime/nx_forge_model_fetch.nx
about
nx_forge_model_fetch.nx -- L3: sovereign BIG-FILE downloader (Range loop) for model weights.
usage: nx_forge_model_fetch <urlfile> <outpath> <expected-bytes>
urlfile = file whose content is the (signed CDN) URL -- URLs are shell-hostile, never argv
outpath = absolute output path (additive staging: NEVER point at the proven live model)
expected = exact byte size (from the origin's X-Linked-Size header)
Streams 16MB RFC-9110 Range chunks over sovereign TLS-1.3 (nx_https_fetch_range), appends to
outpath, sha256's the stream incrementally, RESUMES from existing size (re-hashing the prefix),
retries each chunk 3x. Exits 0 only when size == expected; prints the sha256 hex for comparison
against the origin ETag. license_tier: ORIGINAL expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_lib_std.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.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
| 15 | const FMF_MAGIC_4096: i64 = 4096 |
| 16 | const FMF_MAGIC_4095: i64 = 4095 |
| 17 | const FMF_MAGIC_4194304: i64 = 4194304 |
| 18 | const FMF_MAGIC_1024: i64 = 1024 |
| 19 | const FMF_MAGIC_1500: i64 = 1500 |
| 21 | const FMF_CHUNK: i64 = 16777216 |
functions
| 23 | func fmf_wb(fd: i64, p: *u8, n: i64) -> i64 |
| 38 | func fmf_hexput(b: *u8, n: i64) -> i64 |
| 57 | func main(argc: i64, argv: *i64) -> i64 |