code wiki / _hdl_build / nx_seedlib.nx
nx_seedlib.nx
buildroot/runtime/_hdl_build/nx_seedlib.nx
about
nx_seedlib.nx -- LIB: the COMMUNITY SEED-LIBRARY NODE (furnishes the room the reward unlocked). This is the
real feature that the `host_seed_library` CAPABILITY (earned in nx_rewards) gates: only a capability-holder may
create a node -- proving the reward is REAL (a real feature enforces it), not a cosmetic flag. A node is a
local seed library on the real seed-library ethic: members BORROW seeds, grow them, save seed, and RETURN MORE
than they took -- so the commons grows. Additive loan ledger (rule 13). Ties the swap/rewards/lineage arcs
into a real shared resource. Sovereign seg-store (knowledge/store/seedlib-*, NO TSV), integer-only. license_tier: ORIGINAL
dependencies 4 imports · 1 importers
imports: nx_rewards.nxnx_food_science.nxnx_seg_store.nxnx_syscalls.nx
imported by: nx_seedlib_gate.nx
structs
| none |
consts
| 11 | const SL_MAGIC_2048: i64 = 2048 |
| 13 | const SL_CAP: *u8 = "host_seed_library" |
functions
| 15 | func sl_put(prefix: *u8, key: *u8, val: *u8) -> i64 |
| 25 | func sl_node_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:node:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o } |
| 26 | func sl_stock_key(nid: *u8, sp: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:stock:" as *u8); o = as_append(out, o, nid); out[o] = 58 as u8; o = o + 1; o = as_append(out, o, sp); out[o] = 0 as u8; return o } |
| 27 | func sl_species_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:species:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o } |
| 28 | func sl_loann_key(nid: *u8, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:loann:" as *u8); o = as_append(out, o, nid); out[o] = 0 as u8; return o } |
| 29 | func sl_loan_key(nid: *u8, seq: i64, out: *u8) -> i64 { var o: i64 = 0; o = as_append(out, o, "seedlib:loan:" as *u8); o = as_append(out, o, nid); out[o] = 58 as u8; o = o + 1; o = fd_apnum(out, o, seq); out[o] = 0 as u8; return o } |
| 33 | func sl_create_node(prefix: *u8, reward_prefix: *u8, nid: *u8, host_gid: *u8, name: *u8, area: *u8, day: i64) -> i64 |
| 43 | func sl_node_exists(prefix: *u8, nid: *u8) -> i64 |
| 50 | func sl_node_str(prefix: *u8, nid: *u8, f: i64, out: *u8) -> i64 |
| 58 | func sl_stock(prefix: *u8, nid: *u8, sp: *u8) -> i64 |
| 65 | func sl_set_stock(prefix: *u8, nid: *u8, sp: *u8, qty: i64) -> i64 |
| 71 | func sl_species_track(prefix: *u8, nid: *u8, sp: *u8) -> i64 |
| 97 | func sl_contribute(prefix: *u8, nid: *u8, sp: *u8, qty: i64) -> i64 |
| 103 | func sl_loann(prefix: *u8, nid: *u8) -> i64 |
| 110 | func sl_loan_record(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, direction: *u8, day: i64) -> i64 |
| 125 | func sl_loan_str(prefix: *u8, nid: *u8, seq: i64, f: i64, out: *u8) -> i64 |
| 132 | func sl_loan_int(prefix: *u8, nid: *u8, seq: i64, f: i64) -> i64 |
| 141 | func sl_take(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, day: i64) -> i64 |
| 150 | func sl_return(prefix: *u8, nid: *u8, member: *u8, sp: *u8, qty: i64, day: i64) -> i64 |
| 157 | func sl_member_net(prefix: *u8, nid: *u8, member: *u8, sp: *u8) -> i64 |
| 175 | func sl_render_node(prefix: *u8, nid: *u8, out: *u8) -> i64 |