mirror of
https://github.com/fluencelabs/examples
synced 2025-04-25 02:32:16 +00:00
24 lines
535 B
Plaintext
24 lines
535 B
Plaintext
import "@fluencelabs/aqua-lib/builtin.aqua"
|
|
|
|
service OpTS("op"):
|
|
identity(s: u64)
|
|
array(a: string, b: u64) -> []string
|
|
|
|
service ToU32("op"):
|
|
identity(x:u32) -> u32
|
|
|
|
func ts_getter(node: string, n_neighbors:u32) -> []u64:
|
|
res: *u64
|
|
none_bool: *bool
|
|
nsize: *u32
|
|
nsize <- ToU32.identity(n_neighbors)
|
|
|
|
on node:
|
|
k <- Op.string_to_b58(node)
|
|
nodes <- Kademlia.neighborhood(k, none_bool, nsize)
|
|
for n <- nodes par:
|
|
on n:
|
|
try:
|
|
res <- Peer.timestamp_ms()
|
|
OpTS.identity(res!9)
|
|
<- res |