code wiki / (root) / nx_seed_announce_all.nx

nx_seed_announce_all.nx

buildroot/runtime/nx_seed_announce_all.nx

10409 B171 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic seed
docsdependenciesstructsconstsfunctions

about

nx_seed_announce_all.nx -- DURABLE DHT discoverability for the seeder: periodically announce_peer EVERY torrent registered in seed_index.conf so strangers can FIND our seeder via the DHT (BEP-5). Must run ON the NAS -- BEP-5 infers the peer's IP from the announce packet's SOURCE, so announcing from the NAS makes the DHT record the NAS's address for each info_hash. Composes nx_dht_announce (dan_announce). Announces expire (~15-30 min in mainline), so this loops: announce-all -> sleep 900s -> repeat. Supervised daemon. nx_seed_announce_all [registry] -- loop: announce every registered info_hash, sleep 15m, repeat license_tier: ORIGINAL layer: peer-discovery (announce) module: nishi-core.torrent.seed_announce_all depends: nishi-core.torrent.dht_announce

dependencies 1 imports · 0 importers

nx_dht_announce.nx nx_seed_announce_all.nx

imports: nx_dht_announce.nx

imported by: nobody (leaf or entry point)

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

main da_p sys_read sa_eol sa_tab da_hex2bin da_hexval da_n dan_announce nx_dns_a_resolve sys_socket sys_set_socket_timeout sys_mmap sys_setsockopt sys_munmap sys_mmap ↻ da_sockaddr da_build_query da_qname sys_sendto sys_close sys_recvfrom da_parse da_u16 da_skip_name sys_socket ↻ sys_set_socket_timeout ↻ da_sock4 dht_build_get_peers dht_put dht_putraw sys_sendto ↻ sys_recvfrom ↻ dht_parse_nodes nx_bc_dict_get sys_mmap ↻ nx_bc_str _bc_is_digit _bc_bytes_eq nx_bc_skip

structs

none

consts

11const SA_MAGIC_1048576: i64 = 1048576
12const SA_MAGIC_60000: i64 = 60000
14const SA_REG: *u8 = "/volume1/ai/torrent/seed_index.conf" as *u8
15const SA_PORT: i64 = 6881
16const SA_INTERVAL_SEC: i64 = 900 // 15 min between announce sweeps (announces expire ~15-30m)

functions

23func sa_wait_scratch() -> *i64 { if SA_ST == 0 { SA_ST = sys_mmap(64) as i64 } return SA_ST as *i64 }
25func sa_eol(b: *u8, from: i64, blen: i64) -> i64 { var e: i64=from; while e<blen { if b[e]==(10 as u8) { return e } e=e+1 } return blen }
called by 1: main
26func sa_tab(b: *u8, from: i64, limit: i64) -> i64 { var e: i64=from; while e<limit { if b[e]==(9 as u8) { return e } e=e+1 } return limit }
called by 1: main
31func sa_trackerrefresh() -> i64
49func sa_ipfilter() -> i64
67func sa_portmap() -> i64
86func sa_routerfw() -> i64
104func sa_lsd() -> i64
121func main(argc: i64, argv: *i64) -> i64