examples/intro/3-hello-world-web3/aqua/getting-started.aqua

24 lines
690 B
Plaintext
Raw Normal View History

2021-07-20 14:00:26 +03:00
import "@fluencelabs/aqua-lib/builtin.aqua"
const helloServiceNode ?= "12D3KooWHLxVhUQyAuZe6AHMB29P7wkvTNMn7eDMcsqimJYLKREf"
const helloServiceId ?= "ba24be5b-9789-48ac-b38a-82c9d3eb0d34"
data HelloComputation:
msg: string
reply: string
2021-07-20 15:49:56 +03:00
service HelloWorldCompute:
2021-07-20 14:00:26 +03:00
hello_world(from: string) -> HelloComputation
service HelloWorld("HelloWorld"):
2021-07-20 15:49:56 +03:00
recieveHello(message: string) -> string
2021-07-20 14:00:26 +03:00
func sayHello(peerId: PeerId, relayPeerId: PeerId) -> string:
on helloServiceNode:
2021-07-20 15:49:56 +03:00
HelloWorldCompute helloServiceId
comp <- HelloWorldCompute.hello_world(%init_peer_id%)
2021-07-20 14:00:26 +03:00
co on peerId via relayPeerId:
HelloWorld.recieveHello(comp.msg)
<- comp.reply