aqua-playground/aqua/examples/topology.aqua

53 lines
1.3 KiB
Plaintext
Raw Normal View History

2021-10-25 18:40:02 +03:00
import "@fluencelabs/aqua-lib/builtin.aqua"
2021-04-28 20:16:27 +03:00
service Testo("testo"):
getString: string -> string
service LocalPrint("lp"):
print: string -> ()
2022-02-09 11:22:22 +03:00
service Opop("op"):
identity(s: string) -> string
2021-04-28 20:16:27 +03:00
func topologyTest(me: string, myRelay: string, friend: string, friendRelay: string) -> string:
on friend via friendRelay:
str2 <- Testo.getString("friends string via")
2021-04-29 11:56:02 +03:00
par LocalPrint.print("my string in par")
LocalPrint.print(str2)
2021-10-25 18:40:02 +03:00
<- "finish"
func topologyBug205(node_id: string, n2: ?string) -> []string:
nodes: *PeerId
on node_id:
a <- Op.identity(n2)
nodes <<- a!
on node_id:
for n <- nodes par:
on n:
Peer.identify()
2021-12-29 12:27:06 +03:00
<- nodes
service IOp("op"):
identity: string -> string
func topologyBug394(peer: string, peer2: string, peer3: string) -> string:
-- execute computation on a Peer in the network
on peer:
comp <- IOp.identity(%init_peer_id%)
-- send the result to target browser in the background
co on peer2 via peer3:
res <- IOp.identity(%init_peer_id%)
-- send the result to the initiator
2022-02-09 11:22:22 +03:00
<- comp
func topologyBug427(peers: []string) -> []string:
results: *string
for peer <- peers par:
on peer:
results <- Opop.identity("some string")
join results[1]
<- results