code wiki / _hdl_build / nx_relate_daemon.nx

nx_relate_daemon.nx

buildroot/runtime/_hdl_build/nx_relate_daemon.nx

5363 B89 linesdepth 16pulls 50 transitivereach 0 importersview sourcekind servicetopic relate
docsdependenciesstructsconstsfunctions

about

nx_relate_daemon.nx -- the DEPLOYABLE Relationship OS daemon (the ops shell around the gated pure core nx_relate_serve). Binds 127.0.0.1:8027 and serves the interactive app from the DURABLE store prefix knowledge/status/relate_ (main() self-heals the knowledge/status/ parent via sys_mkdir on startup -- the NAS's root-owned knowledge/ lacks it; manifest auto-created on first commit). R2 AUTH-GATED: every request resolves X-Nishi-Session (or the hidden `sess` form field) via olg_whoami against the SITE login plane (opaque_keys.bin, realm nishi_site_admin) -- valid session = the app (forms carry the synchronizer token), none = bootstrap/401. Route /relate -> this port on the sovereign edge = the operator-gated deploy step (same pattern as the email webmail daemon :8025). Runs forever (accept loop) -- build with --build-only; run deliberately. license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_relate_serve.nx nx_opaque_login.nx nx_relate_daemon.nx

imports: nx_relate_serve.nxnx_opaque_login.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main olg_ctx_setup olg_ctx_setup_ttl nx_uas_server_keys_load_or sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable nxa_dump_sizes sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close _uas_hex_dec _uas_nib nx_csprng_fill sys_mmap ↻ nx_csprng_urandom_path sys_openat_rd ↻ sys_read ↻ sys_close ↻ nx_opq_derive_keypair sys_mmap ↻ u256_alloc nx_scratch nx_opq_hash_to_scalar sys_mmap ↻ nx_h2c_expand_message_xmd_ u256_alloc ↻

structs

none

consts

12const RD_MAGIC_65536: i64 = 65536
13const RD_MAGIC_262144: i64 = 262144
15const RD_PORT: i64 = 0x1f5b // 8027
16const RD_PREFIX: *u8 = "knowledge/status/relate_"
20const RD_KEYS: *u8 = "opaque_keys.bin"
21const RD_ASTORE: *u8 = "opaque_store.log"
22const RD_IDX: *u8 = "nishi_uid_handle.tsv" // the login daemon's uid(hex)->handle index (the ACL keys off handle)

functions

24func d_addr(out: *u8, port: i64) -> i64
called by 1: main
33func main() -> i64