mirror of
https://github.com/fluencelabs/examples
synced 2025-07-31 08:51:56 +00:00
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>
This commit is contained in:
66
aqua-examples/ts-oracle/air-scripts/ts_getter.ts_oracle.air
Normal file
66
aqua-examples/ts-oracle/air-scripts/ts_getter.ts_oracle.air
Normal file
@@ -0,0 +1,66 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "oracle_service_id") [] oracle_service_id)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "min_points") [] min_points)
|
||||
)
|
||||
(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
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(xor
|
||||
(call node (oracle_service_id "point_estimate") [$res min_points] oracle)
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [oracle])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 4])
|
||||
)
|
Reference in New Issue
Block a user