2021-04-12 02:07:18 +03:00
|
|
|
#!/usr/bin/env node
|
|
|
|
|
2021-04-13 18:22:51 +03:00
|
|
|
import {createClient, registerServiceFunction, SecurityTetraplet} from "@fluencelabs/fluence";
|
2021-04-12 02:07:18 +03:00
|
|
|
import { testNet } from "@fluencelabs/fluence-network-environment";
|
2021-04-14 02:38:35 +03:00
|
|
|
import {callArrowCall} from "./callArrowCall";
|
|
|
|
import {dataAliasCall} from "./dataAliasCall";
|
|
|
|
import {onCall} from "./onCall";
|
|
|
|
import {funcCall} from "./funcCall";
|
|
|
|
import {helloWorldCall} from "./helloWorldCall";
|
2021-04-14 03:35:10 +03:00
|
|
|
import {foldCall} from "./foldCall";
|
|
|
|
import {ifCall} from "./if";
|
2021-04-14 17:23:42 +03:00
|
|
|
import {parCall} from "./parCall";
|
|
|
|
import {complexCall} from "./complex";
|
2021-04-12 02:07:18 +03:00
|
|
|
|
|
|
|
const main = async () => {
|
|
|
|
const client = await createClient(testNet[0]);
|
2021-04-13 18:22:51 +03:00
|
|
|
|
|
|
|
registerServiceFunction(client, "println", "print", (args: any[], _) => {
|
|
|
|
console.log("println: " + args[0])
|
|
|
|
return {}
|
|
|
|
})
|
|
|
|
|
2021-04-14 17:23:42 +03:00
|
|
|
await callArrowCall(client)
|
|
|
|
await foldCall(client)
|
|
|
|
await ifCall(client)
|
|
|
|
await parCall(client)
|
2021-04-14 03:35:10 +03:00
|
|
|
|
2021-04-14 02:38:35 +03:00
|
|
|
await helloWorldCall(client)
|
|
|
|
await funcCall(client)
|
|
|
|
await onCall(client)
|
|
|
|
await dataAliasCall(client)
|
2021-04-14 17:23:42 +03:00
|
|
|
await complexCall(client)
|
2021-04-13 18:22:51 +03:00
|
|
|
|
2021-04-14 02:38:35 +03:00
|
|
|
client.disconnect();
|
2021-04-13 18:22:51 +03:00
|
|
|
process.exit(0)
|
2021-04-12 02:07:18 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
main();
|