mirror of
https://github.com/fluencelabs/aqua-playground
synced 2025-06-15 19:21:32 +00:00
update aqua
This commit is contained in:
6
package-lock.json
generated
6
package-lock.json
generated
@ -5,9 +5,9 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@fluencelabs/aqua-cli": {
|
||||
"version": "0.1.6-148",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-cli/-/aqua-cli-0.1.6-148.tgz",
|
||||
"integrity": "sha512-ghTdVOU6hlgYrfDzu/pIEw/zk4650H5gZNzDZ2k4u8SUw2Yb2cYDn4OOvr7Et9kaEoBtXkuFl9PVWGo5lj9Jkg==",
|
||||
"version": "0.1.7-152",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aqua-cli/-/aqua-cli-0.1.7-152.tgz",
|
||||
"integrity": "sha512-oVT9IWllJb8dhzKEMoIWd9FDFEKkBo8zKlzUbQxU7OCbjxkuozF+aiMqJEQlFNSbBL9z1b5KVkF1gcgmSkKWSg==",
|
||||
"dev": true
|
||||
},
|
||||
"@fluencelabs/aqua-lib": {
|
||||
|
@ -24,7 +24,7 @@
|
||||
"compile-aqua:air": "aqua-cli -i ./aqua/ -o ./compiled-air -a"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@fluencelabs/aqua-cli": "^0.1.6-148",
|
||||
"@fluencelabs/aqua-cli": "^0.1.7-152",
|
||||
"@fluencelabs/aqua-lib": "^0.1.5",
|
||||
"ts-node": "^9.1.1",
|
||||
"typescript": "^4.2.4"
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -12,6 +12,51 @@ import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(call %init_peer_id% ("println-service-id" "print") [str])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'str', () => {return str;});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for print');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function passFunctionAsArg(client: FluenceClient, node: string, str: string, c: (arg0: string) => string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
@ -32,7 +77,7 @@ export async function passFunctionAsArg(client: FluenceClient, node: string, str
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(seq
|
||||
@ -40,32 +85,26 @@ export async function passFunctionAsArg(client: FluenceClient, node: string, str
|
||||
(seq
|
||||
(seq
|
||||
(call node ("peer" "identify") [])
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "c") [str] init_call_res)
|
||||
(seq
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call node ("peer" "identify") [])
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(null)
|
||||
(call %init_peer_id% ("println-service-id" "print") [init_call_res])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -12,6 +12,158 @@ import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function helloWorld(client: FluenceClient, name: string, config?: {ttl?: number}): Promise<string> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "name") [] name)
|
||||
)
|
||||
(call %init_peer_id% ("service-id" "addNameToHello") [name] res)
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'name', () => {return name;});
|
||||
h.onEvent('callbackSrv', 'response', (args) => {
|
||||
const [res] = args;
|
||||
resolve(res);
|
||||
});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for helloWorld');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(call %init_peer_id% ("println-service-id" "print") [str])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'str', () => {return str;});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for print');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function testFunc(client: FluenceClient, config?: {ttl?: number}): Promise<string> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("test-service-id" "str") [] res)
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
|
||||
h.onEvent('callbackSrv', 'response', (args) => {
|
||||
const [res] = args;
|
||||
resolve(res);
|
||||
});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for testFunc');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return promise;
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function doStuff(client: FluenceClient, a: string, b: string, c: boolean, d: boolean, e: string[], g: string[], str: string, config?: {ttl?: number}): Promise<string[]> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<string[]>((resolve, reject) => {
|
||||
@ -34,46 +186,46 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "a") [] a)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "b") [] b)
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "a") [] a)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "c") [] c)
|
||||
(call %init_peer_id% ("getDataSrv" "b") [] b)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "d") [] d)
|
||||
(call %init_peer_id% ("getDataSrv" "c") [] c)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "e") [] e)
|
||||
(call %init_peer_id% ("getDataSrv" "d") [] d)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "g") [] g)
|
||||
(call %init_peer_id% ("getDataSrv" "e") [] e)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
(call %init_peer_id% ("getDataSrv" "g") [] g)
|
||||
)
|
||||
(call %init_peer_id% ("some-id" "t") [str] $stream)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(par
|
||||
(call %init_peer_id% ("println-service-id" "print") [a])
|
||||
(par
|
||||
(seq
|
||||
(call %init_peer_id% ("some-id" "t") [str] $stream)
|
||||
(call b ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("println-service-id" "print") [a])
|
||||
)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(call a ("peer" "identify") [])
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(match c true
|
||||
(xor
|
||||
@ -97,11 +249,8 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
)
|
||||
@ -112,15 +261,12 @@ export async function doStuff(client: FluenceClient, a: string, b: string, c: bo
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("some-id" "multiline") [a b c] $stream)
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,20 +29,17 @@ export async function betterMessage(client: FluenceClient, relay: string, config
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call relay ("peer" "is_connected") [relay] isOnline)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(match isOnline true
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,20 +29,17 @@ export async function test(client: FluenceClient, node: string, config?: {ttl?:
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call node ("peer" "identify") [] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("returnService" "run") [res])
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -12,6 +12,51 @@ import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(call %init_peer_id% ("println-service-id" "print") [str])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'str', () => {return str;});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for print');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function iterateAndPrint(client: FluenceClient, strings: string[], config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
@ -28,7 +73,7 @@ export async function iterateAndPrint(client: FluenceClient, strings: string[],
|
||||
)
|
||||
(fold strings s
|
||||
(seq
|
||||
(null)
|
||||
(call %init_peer_id% ("println-service-id" "print") [s])
|
||||
(next s)
|
||||
)
|
||||
)
|
||||
@ -79,28 +124,19 @@ export async function iterateAndPrintParallel(client: FluenceClient, nodes: stri
|
||||
(fold nodes s
|
||||
(par
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call s ("peer" "identify") [] ads)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "c") [ads])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
(next s)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,7 +29,7 @@ export async function getTwoResults(client: FluenceClient, relay: string, config
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(seq
|
||||
@ -42,9 +42,12 @@ export async function getTwoResults(client: FluenceClient, relay: string, config
|
||||
)
|
||||
(fold nodes n
|
||||
(par
|
||||
(xor
|
||||
(call n ("peer" "timestamp_sec") [] $res)
|
||||
(null)
|
||||
(seq
|
||||
(xor
|
||||
(call n ("peer" "timestamp_sec") [] $res)
|
||||
(null)
|
||||
)
|
||||
(call relay ("op" "noop") [])
|
||||
)
|
||||
(next n)
|
||||
)
|
||||
@ -57,15 +60,12 @@ export async function getTwoResults(client: FluenceClient, relay: string, config
|
||||
(call relay ("op" "identity") [$res.$.[2]!])
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$res])
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -12,6 +12,51 @@ import { RequestFlow } from '@fluencelabs/fluence/dist/internal/RequestFlow';
|
||||
|
||||
|
||||
|
||||
export async function print(client: FluenceClient, str: string, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
request = new RequestFlowBuilder()
|
||||
.disableInjections()
|
||||
.withTTL(config?.ttl || 5000)
|
||||
.withRawScript(
|
||||
`
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "str") [] str)
|
||||
)
|
||||
(call %init_peer_id% ("println-service-id" "print") [str])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
|
||||
`,
|
||||
)
|
||||
.configHandler((h) => {
|
||||
h.on('getDataSrv', '-relay-', () => {
|
||||
return client.relayPeerId!;
|
||||
});
|
||||
h.on('getDataSrv', 'str', () => {return str;});
|
||||
|
||||
h.onEvent('errorHandlingSrv', 'error', (args) => {
|
||||
// assuming error is the single argument
|
||||
const [err] = args;
|
||||
reject(err);
|
||||
});
|
||||
})
|
||||
.handleScriptError(reject)
|
||||
.handleTimeout(() => {
|
||||
reject('Request timed out for print');
|
||||
})
|
||||
.build();
|
||||
});
|
||||
await client.initiateFlow(request!);
|
||||
return Promise.race([promise, Promise.resolve()]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
export async function ifElseCall(client: FluenceClient, condition: boolean, config?: {ttl?: number}): Promise<void> {
|
||||
let request: RequestFlow;
|
||||
const promise = new Promise<void>((resolve, reject) => {
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,20 +29,17 @@ export async function getPeerExternalAddresses(client: FluenceClient, otherNodeP
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "otherNodePeerId") [] otherNodePeerId)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call otherNodePeerId ("peer" "identify") [] res)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res.$.external_addresses!])
|
||||
@ -104,27 +101,27 @@ export async function getDistantAddresses(client: FluenceClient, target: string,
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "viaNode") [] viaNode)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call viaNode ("op" "identity") [])
|
||||
(call viaNode ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call target ("peer" "identify") [] res)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call viaNode ("op" "identity") [])
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call viaNode ("op" "noop") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call viaNode ("op" "identity") [])
|
||||
(call viaNode ("op" "noop") [])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [res.$.external_addresses!])
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -23,40 +23,31 @@ export async function parFunc(client: FluenceClient, node: string, c: (arg0: {ex
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||
)
|
||||
(par
|
||||
(par
|
||||
(call %init_peer_id% ("parservice-id" "call") [] y)
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(xor
|
||||
(seq
|
||||
(seq
|
||||
(call node ("peer" "identify") [] t)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "c") [t])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call %init_peer_id% ("parservice-id" "call") [] x)
|
||||
)
|
||||
(call %init_peer_id% ("parservice-id" "call") [] x)
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -25,46 +25,46 @@ export async function topologyTest(client: FluenceClient, me: string, myRelay: s
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "me") [] me)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "myRelay") [] myRelay)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "friend") [] friend)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "friendRelay") [] friendRelay)
|
||||
)
|
||||
(par
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call friendRelay ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call friend ("testo" "getString") ["friends string via"] str2)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "me") [] me)
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "myRelay") [] myRelay)
|
||||
(call friendRelay ("op" "noop") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "friend") [] friend)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "friendRelay") [] friendRelay)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call friendRelay ("op" "identity") [])
|
||||
)
|
||||
(xor
|
||||
(call friend ("testo" "getString") ["friends string via"] str2)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call friendRelay ("op" "identity") [])
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call friendRelay ("op" "noop") [])
|
||||
)
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call friendRelay ("op" "identity") [])
|
||||
(call %init_peer_id% ("op" "noop") [])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("lp" "print") ["my string in par"])
|
||||
)
|
||||
(call %init_peer_id% ("lp" "print") ["my string in par"])
|
||||
)
|
||||
(call %init_peer_id% ("lp" "print") [str2])
|
||||
)
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,32 +29,26 @@ export async function tryCatchTest(client: FluenceClient, node_id: string, confi
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node_id") [] node_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(xor
|
||||
(call node_id ("unex" "getStr") [] $f)
|
||||
(seq
|
||||
(seq
|
||||
(seq
|
||||
(call node_id ("op" "identity") [%last_error%.$.msg!] $f)
|
||||
(call node_id ("peer" "identify") [] i)
|
||||
)
|
||||
(call node_id ("op" "identity") [i.$.external_addresses.[0]!] $f)
|
||||
(call node_id ("op" "identity") [%last_error%.$.msg!] $f)
|
||||
(call node_id ("peer" "identify") [] i)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call node_id ("op" "identity") [i.$.external_addresses.[0]!] $f)
|
||||
)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$f])
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -29,26 +29,20 @@ export async function tryOtherwiseTest(client: FluenceClient, node_id: string, c
|
||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||
(call %init_peer_id% ("getDataSrv" "node_id") [] node_id)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(xor
|
||||
(call node_id ("unex" "getStr") [] $f)
|
||||
(seq
|
||||
(call node_id ("op" "identity") ["error"] $f)
|
||||
(call -relay- ("op" "identity") [])
|
||||
)
|
||||
(call node_id ("op" "identity") ["error"] $f)
|
||||
)
|
||||
(seq
|
||||
(seq
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [$f.$.[0]!])
|
||||
|
@ -3,7 +3,7 @@
|
||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||
* Aqua version: 0.1.6-148
|
||||
* Aqua version: 0.1.7-152
|
||||
*
|
||||
*/
|
||||
import { FluenceClient, PeerIdB58 } from '@fluencelabs/fluence';
|
||||
@ -34,11 +34,11 @@ export async function viaArr(client: FluenceClient, node_id: string, viaAr: stri
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "viaAr") [] viaAr)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(fold viaAr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
@ -50,26 +50,26 @@ export async function viaArr(client: FluenceClient, node_id: string, viaAr: stri
|
||||
(seq
|
||||
(fold viaAr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(fold viaAr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [p])
|
||||
@ -140,11 +140,11 @@ export async function viaStream(client: FluenceClient, node_id: string, viaStr:
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(fold $viaStr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
@ -156,26 +156,26 @@ export async function viaStream(client: FluenceClient, node_id: string, viaStr:
|
||||
(seq
|
||||
(fold $viaStr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(fold $viaStr -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [p])
|
||||
@ -241,11 +241,11 @@ export async function viaOpt(client: FluenceClient, relay: string, node_id: stri
|
||||
)
|
||||
(call %init_peer_id% ("getDataSrv" "viaOpt") [] viaOpt)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(fold viaOpt -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
@ -257,26 +257,26 @@ export async function viaOpt(client: FluenceClient, relay: string, node_id: stri
|
||||
(seq
|
||||
(fold viaOpt -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
)
|
||||
)
|
||||
(fold viaOpt -via-peer-
|
||||
(seq
|
||||
(call -via-peer- ("op" "identity") [])
|
||||
(call -via-peer- ("op" "noop") [])
|
||||
(next -via-peer-)
|
||||
)
|
||||
)
|
||||
)
|
||||
(call -relay- ("op" "identity") [])
|
||||
(call -relay- ("op" "noop") [])
|
||||
)
|
||||
(xor
|
||||
(call %init_peer_id% ("callbackSrv" "response") [p])
|
||||
|
Reference in New Issue
Block a user