mirror of
https://github.com/fluencelabs/examples
synced 2024-12-04 19:20:17 +00:00
add aqua scripts
This commit is contained in:
parent
4cf8ddad3f
commit
e85dae2a6b
@ -0,0 +1,46 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "value") [] value)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "step") [] step)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "incr") [] incr)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node (service_id "crement_u64") [value step incr] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
@ -0,0 +1,46 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "value") [] value)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "step") [] step)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "incr") [] incr)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node (service_id "crement_u64") [value step incr] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
43
echo-greeter/utilities/aqua-compiled/utilities.splitter.air
Normal file
43
echo-greeter/utilities/aqua-compiled/utilities.splitter.air
Normal file
@ -0,0 +1,43 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "array") [] array)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "chunk_size") [] chunk_size)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node (service_id "array_splitter_u64") [array chunk_size] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
@ -0,0 +1,43 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "array") [] array)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "chunk_size") [] chunk_size)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node (service_id "array_splitter_u32") [array chunk_size] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
@ -0,0 +1,43 @@
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "array") [] array)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "chunk_size") [] chunk_size)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "service_id") [] service_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call node (service_id "array_splitter_u64") [array chunk_size] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
42
echo-greeter/utilities/aqua-scripts/utilities.aqua
Normal file
42
echo-greeter/utilities/aqua-scripts/utilities.aqua
Normal file
@ -0,0 +1,42 @@
|
||||
data U64Result:
|
||||
value: u64
|
||||
err_msg: string
|
||||
|
||||
data U32Result:
|
||||
value: u32
|
||||
err_msg: string
|
||||
|
||||
service Utility:
|
||||
array_splitter_u32(array: []u32, chunk_size: u32) -> [][]u32
|
||||
array_splitter_u64(array: []u64, chunk_size: u64) -> [][]u64
|
||||
crement_u32(value: u32, step: u32, increment: bool) -> U32Result
|
||||
crement_u64(value: u64, step: u64, increment: bool) -> U64Result
|
||||
greeting(name: string) -> string
|
||||
|
||||
|
||||
|
||||
func splitter_u64(array:[]u64, chunk_size: u64, node:string, service_id: string) -> [][]u64:
|
||||
on node:
|
||||
Utility service_id
|
||||
res <- Utility.array_splitter_u64(array, chunk_size)
|
||||
<- res
|
||||
|
||||
func splitter_u32(array:[]u32, chunk_size: u32, node:string, service_id: string) -> [][]u32:
|
||||
on node:
|
||||
Utility service_id
|
||||
res <- Utility.array_splitter_u32(array, chunk_size)
|
||||
<- res
|
||||
|
||||
|
||||
func increment_u64(value: u64, step: u64, incr:bool, node:string, service_id: string) -> U64Result:
|
||||
on node:
|
||||
Utility service_id
|
||||
res <- Utility.crement_u64(value, step, incr)
|
||||
<- res
|
||||
|
||||
func increment_u32(value: u32, step: u32, incr:bool, node:string, service_id: string) -> U64Result:
|
||||
on node:
|
||||
Utility service_id
|
||||
res <- Utility.crement_u64(value, step, incr)
|
||||
<- res
|
||||
|
Loading…
Reference in New Issue
Block a user