mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-25 06:41:51 +00:00
new lines, renames, comments
This commit is contained in:
@ -6,9 +6,12 @@ data NodeId:
|
||||
peerId: PeerId
|
||||
name: string
|
||||
|
||||
service SomeSrv("somesrv"):
|
||||
-- define service `NodeIdGetter` that will be callable on local client via `somesrv` service id
|
||||
service NodeIdGetter("somesrv"):
|
||||
get: -> NodeId
|
||||
|
||||
func dataAliasFunc() -> PeerId:
|
||||
res <- SomeSrv.get()
|
||||
-- showcases a function that gets data structure from a local service,
|
||||
-- and then retrieves aliased data type from that structure
|
||||
func getAliasedData() -> PeerId:
|
||||
res <- NodeIdGetter.get()
|
||||
<- res.peerId
|
||||
|
@ -5,4 +5,4 @@ export async function callArrowCall(client: FluenceClient) {
|
||||
await passFunctionAsArg(client, client.relayPeerId!, (a: string) => {
|
||||
return "Hello, " + a + "!"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -3,4 +3,4 @@ import {doStuff} from "./compiled/complex";
|
||||
|
||||
export async function complexCall(client: FluenceClient) {
|
||||
await doStuff(client, client.relayPeerId!)
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {FluenceClient, registerServiceFunction} from "@fluencelabs/fluence";
|
||||
import {dataAliasFunc} from "./compiled/dataAlias";
|
||||
import {getAliasedData} from "./compiled/dataAlias";
|
||||
|
||||
export async function dataAliasCall(client: FluenceClient) {
|
||||
registerServiceFunction(client, "somesrv", "get", (args: any[], _) => {
|
||||
@ -9,6 +9,6 @@ export async function dataAliasCall(client: FluenceClient) {
|
||||
}
|
||||
})
|
||||
|
||||
const peerId = await dataAliasFunc(client)
|
||||
const peerId = await getAliasedData(client)
|
||||
console.log("PeerId: ", peerId);
|
||||
}
|
||||
}
|
||||
|
@ -6,4 +6,5 @@
|
||||
await iterateAndPrintParallel(client, [client.relayPeerId!], (c) => {
|
||||
console.log("iterateAndPrintParallel. external addresses: " + c.external_addresses)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,4 @@ export async function funcCall(client: FluenceClient) {
|
||||
|
||||
const res = await testFunc(client);
|
||||
console.log("Message: ", res);
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ export async function helloWorldCall(client: FluenceClient) {
|
||||
|
||||
const hello = await helloWorld(client, "NAME");
|
||||
console.log("Message: ", hello);
|
||||
}
|
||||
}
|
||||
|
@ -7,4 +7,4 @@ export async function ifCall(client: FluenceClient) {
|
||||
|
||||
await ifElseNumCall(client, 1)
|
||||
await ifElseNumCall(client, 5)
|
||||
}
|
||||
}
|
||||
|
@ -4,4 +4,4 @@ import {getPeerExternalAddresses} from "./compiled/some";
|
||||
export async function onCall(client: FluenceClient) {
|
||||
const addresses = await getPeerExternalAddresses(client, client.relayPeerId!)
|
||||
console.log("Addresses: ", addresses);
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ export async function parCall(client: FluenceClient) {
|
||||
await parFunc(client, client.relayPeerId!, (c) => {
|
||||
console.log("parFunc. external addresses par: " + c.external_addresses)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user