nx_blocklist_seed_demo.nx source
↩ module page · 18 lines · 1314 B
1// nx_blocklist_seed_demo.nx -- intake one clearly-labeled EXAMPLE pending entry into the PRODUCTION blocklist, so the
2// live /blocklist page has something to view + act on. Status=pending => it does NOT block; the operator approves or
3// retracts it on the page. This is also the "how an entry is added" path (a takedown/intake would call bl_put the same
4// way). license_tier: ORIGINAL
5import "nx_blocklist_store.nx"
6import "nx_gate.nx"
7import "nx_tabrec.nx"
8
9func main() -> i64 {
10 let rec: *u8=sys_mmap(512); var o: i64=0
11 o=tr_cat(rec,o,"3c3c3c3ca5a5a5a5" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"8" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"operator-review" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"operator" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"2026-06-30" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"EXAMPLE-demo" as *u8); o=tr_tab(rec,o); o=tr_cat(rec,o,"pending" as *u8)
12 bl_put("demo" as *u8, rec, o)
13 gw("seeded EXAMPLE pending entry 'demo' into the production blocklist (knowledge/blocklist-)\n" as *u8)
14 let po: *i64=sys_mmap(16) as *i64
15 let lo: *i64=sys_mmap(16) as *i64
16 if bl_get("demo" as *u8, po, lo)==1 { gw("verified present, status=pending (does NOT block until you approve on the page)\n" as *u8) } else { gw("WARN: not found after put\n" as *u8) }
17 return 0
18}