new lines, renames, comments

This commit is contained in:
DieMyst
2021-04-15 12:45:18 +03:00
parent f14506a7a0
commit b234f4e689
10 changed files with 18 additions and 14 deletions

View File

@ -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

View File

@ -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);
}

View File

@ -7,3 +7,4 @@
console.log("iterateAndPrintParallel. external addresses: " + c.external_addresses)
})
}