examples/aqua-examples/ts-oracle/air-scripts/timestamp_getter.ts_getter.air
boneyard93501 6381411ed9
Reorg (#10)
* init reorg

* updated readme

* fix CI

* remove outdated ipfs-node example

* add Readme

* update readme, add config file

Co-authored-by: folex <0xdxdy@gmail.com>
2021-07-16 02:04:18 -05:00

49 lines
1.0 KiB
Plaintext

(xor
(seq
(seq
(seq
(seq
(seq
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
(call %init_peer_id% ("getDataSrv" "node") [] node)
)
(call -relay- ("op" "noop") [])
)
(xor
(seq
(seq
(seq
(call node ("op" "string_to_b58") [node] k)
(call node ("kad" "neighborhood") [k false] nodes)
)
(fold nodes n
(par
(seq
(xor
(call n ("peer" "timestamp_ms") [] $res)
(null)
)
(call node ("op" "noop") [])
)
(next n)
)
)
)
(call node ("op" "identity") [$res.$.[9]!])
)
(seq
(call -relay- ("op" "noop") [])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
)
)
)
(call -relay- ("op" "noop") [])
)
(xor
(call %init_peer_id% ("callbackSrv" "response") [$res])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
)
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
)