Update aqua version (#5)

* Up fluence sdk and aqua version

* Add flatten operator for future use
This commit is contained in:
coder11 2020-12-25 14:04:45 +03:00 committed by GitHub
parent 8da5493f89
commit ac4ff02a14
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 84 additions and 30 deletions

28
package-lock.json generated
View File

@ -1223,9 +1223,9 @@
} }
}, },
"@fluencelabs/aquamarine-stepper": { "@fluencelabs/aquamarine-stepper": {
"version": "0.0.16", "version": "0.0.30",
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.0.16.tgz", "resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.0.30.tgz",
"integrity": "sha512-yrRMH2ysrxkhOGUe599urPopx6bon44qHppyvE6RKdrE1qVgxYKONWU+BNM+ouzIZ3UW5hoT0gQZ7lmI3HS30g==" "integrity": "sha512-XIgRgyVgPJXvXB3NuYHpSdJ0EFcFZ+K4uduGFf8PfnFii/bFs4F1n3MBB+b4D0y59HR4F9ZQUC4fXxcf6UCYWA=="
}, },
"@hapi/address": { "@hapi/address": {
"version": "2.1.4", "version": "2.1.4",
@ -6829,11 +6829,11 @@
"dev": true "dev": true
}, },
"fluence": { "fluence": {
"version": "0.7.101", "version": "0.7.108",
"resolved": "https://registry.npmjs.org/fluence/-/fluence-0.7.101.tgz", "resolved": "https://registry.npmjs.org/fluence/-/fluence-0.7.108.tgz",
"integrity": "sha512-bbaAPKvCf5QkX6zXt0/J+gtJ6JUNUAlWIuiioe9xZQsM4GDJtbp7YF3V+DFjAvqv9kfA2y7dHNuzqDnXMmr0xA==", "integrity": "sha512-Pwk3QkX2AX5vWv791yfIy37xMFAoB+iIZFOAaRCHES2nkBXVJgqBQWH42xXcGJeiBCfecPpI9yl9kPSp3f6nCA==",
"requires": { "requires": {
"@fluencelabs/aquamarine-stepper": "0.0.16", "@fluencelabs/aquamarine-stepper": "0.0.30",
"async": "3.2.0", "async": "3.2.0",
"base64-js": "1.3.1", "base64-js": "1.3.1",
"bs58": "4.0.1", "bs58": "4.0.1",
@ -13430,14 +13430,14 @@
} }
}, },
"sinon": { "sinon": {
"version": "9.2.1", "version": "9.2.2",
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.1.tgz", "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.2.tgz",
"integrity": "sha512-naPfsamB5KEE1aiioaoqJ6MEhdUs/2vtI5w1hPAXX/UwvoPjXcwh1m5HiKx0HGgKR8lQSoFIgY5jM6KK8VrS9w==", "integrity": "sha512-9Owi+RisvCZpB0bdOVFfL314I6I4YoRlz6Isi4+fr8q8YQsDPoCe5UnmNtKHRThX3negz2bXHWIuiPa42vM8EQ==",
"requires": { "requires": {
"@sinonjs/commons": "^1.8.1", "@sinonjs/commons": "^1.8.1",
"@sinonjs/fake-timers": "^6.0.1", "@sinonjs/fake-timers": "^6.0.1",
"@sinonjs/formatio": "^5.0.1", "@sinonjs/formatio": "^5.0.1",
"@sinonjs/samsam": "^5.2.0", "@sinonjs/samsam": "^5.3.0",
"diff": "^4.0.2", "diff": "^4.0.2",
"nise": "^4.0.4", "nise": "^4.0.4",
"supports-color": "^7.1.0" "supports-color": "^7.1.0"
@ -15741,9 +15741,9 @@
} }
}, },
"web-encoding": { "web-encoding": {
"version": "1.0.4", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.4.tgz", "resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.6.tgz",
"integrity": "sha512-DcXs2lbVPzuJmn2kuDEwul2oZg7p4YMa5J2f0YzsOBHaAnBYGPNUB/rJ74DTjTKpw7F0+lSsVM8sFHE2UyBixg==" "integrity": "sha512-26wEnRPEFAc5d5lmH1Q/DuvWEYsRF1D2alX2jlKpdmqv7cj+BbANL7Xlcl9r4s72Eg9kItZa9RWVbBMC9dMv4w=="
}, },
"webpack": { "webpack": {
"version": "5.7.0", "version": "5.7.0",

View File

@ -5,6 +5,7 @@
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "webpack-serve --open", "start": "webpack-serve --open",
"serve": "webpack serve",
"pack": "webpack --mode production", "pack": "webpack --mode production",
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write" "prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write"
}, },
@ -19,7 +20,7 @@
}, },
"homepage": "https://github.com/fluencelabs/fluence-admin#readme", "homepage": "https://github.com/fluencelabs/fluence-admin#readme",
"dependencies": { "dependencies": {
"fluence": "0.7.101", "fluence": "0.7.108",
"tachyons": "^4.12.0" "tachyons": "^4.12.0"
}, },
"devDependencies": { "devDependencies": {

View File

@ -54,6 +54,11 @@ fold iter item (Air d s) =
Air d ("(fold " ++ iter ++ " " ++ item ++ "\n" ++ s ++ ")\n") Air d ("(fold " ++ iter ++ " " ++ item ++ "\n" ++ s ++ ")\n")
flattenOp : String -> String
flattenOp s =
s ++ "!"
next : String -> Air next : String -> Air
next item = next item =
Air Dict.empty ("(next " ++ item ++ ")\n") Air Dict.empty ("(next " ++ item ++ ")\n")

View File

@ -1,6 +1,6 @@
module AirScripts.CallPeers exposing (..) module AirScripts.CallPeers exposing (..)
import Air exposing (Air, callBI, fold, next, par, relayEvent, seq, set) import Air exposing (Air, callBI, flattenOp, fold, next, par, relayEvent, seq, set)
import Json.Encode exposing (list, string) import Json.Encode exposing (list, string)

View File

@ -1,6 +1,6 @@
module AirScripts.DiscoverPeers exposing (..) module AirScripts.DiscoverPeers exposing (..)
import Air exposing (Air, callBI, fold, next, par, relayEvent, seq, set) import Air exposing (Air, callBI, flattenOp, fold, next, par, relayEvent, seq, set)
import Json.Encode as Encode import Json.Encode as Encode

View File

@ -1,6 +1,6 @@
module AirScripts.GetAll exposing (..) module AirScripts.GetAll exposing (..)
import Air exposing (Air, callBI, fold, next, par, relayEvent, seq, set) import Air exposing (Air, callBI, flattenOp, fold, next, par, relayEvent, seq, set)
import Json.Encode exposing (list, string) import Json.Encode exposing (list, string)

View File

@ -31,6 +31,37 @@ export const stage: Node[] = [
}, },
]; ];
export const dev: Node[] = [
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19001/wss/p2p/12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9',
peerId: '12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19002/wss/p2p/12D3KooWHk9BjDQBUqnavciRPhAYFvqKBe4ZiPPvde7vDaqgn5er',
peerId: '12D3KooWHk9BjDQBUqnavciRPhAYFvqKBe4ZiPPvde7vDaqgn5er',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19003/wss/p2p/12D3KooWBUJifCTgaxAUrcM9JysqCcS4CS8tiYH5hExbdWCAoNwb',
peerId: '12D3KooWBUJifCTgaxAUrcM9JysqCcS4CS8tiYH5hExbdWCAoNwb',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19004/wss/p2p/12D3KooWJbJFaZ3k5sNd8DjQgg3aERoKtBAnirEvPV8yp76kEXHB',
peerId: '12D3KooWJbJFaZ3k5sNd8DjQgg3aERoKtBAnirEvPV8yp76kEXHB',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19005/wss/p2p/12D3KooWCKCeqLPSgMnDjyFsJuWqREDtKNHx1JEBiwaMXhCLNTRb',
peerId: '12D3KooWCKCeqLPSgMnDjyFsJuWqREDtKNHx1JEBiwaMXhCLNTRb',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19990/wss/p2p/12D3KooWMhVpgfQxBLkQkJed8VFNvgN4iE6MD7xCybb1ZYWW2Gtz',
peerId: '12D3KooWMhVpgfQxBLkQkJed8VFNvgN4iE6MD7xCybb1ZYWW2Gtz',
},
{
multiaddr: '/dns4/dev.fluence.dev/tcp/19100/wss/p2p/12D3KooWPnLxnY71JDxvB3zbjKu9k1BCYNthGZw6iGrLYsR1RnWM',
peerId: '12D3KooWPnLxnY71JDxvB3zbjKu9k1BCYNthGZw6iGrLYsR1RnWM',
},
];
export const faasNetHttps: Node[] = [ export const faasNetHttps: Node[] = [
{ {
multiaddr: '/dns4/net01.fluence.dev/tcp/19001/wss/p2p/12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9', multiaddr: '/dns4/net01.fluence.dev/tcp/19001/wss/p2p/12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9',

View File

@ -22,11 +22,11 @@ import { registerService } from 'fluence/dist/globalState';
import { ServiceOne } from 'fluence/dist/service'; import { ServiceOne } from 'fluence/dist/service';
import * as serviceWorker from './serviceWorker'; import * as serviceWorker from './serviceWorker';
import { Elm } from './Main.elm'; import { Elm } from './Main.elm';
import { faasNetHttps, Node } from './environments'; import { faasNetHttps, dev, Node } from './environments';
const relayIdx = 8; const relayIdx = 2;
export const relays: Node[] = faasNetHttps; export const relays: Node[] = dev;
function genFlags(peerId: string): any { function genFlags(peerId: string): any {
return { return {
@ -37,20 +37,37 @@ function genFlags(peerId: string): any {
} }
/* eslint-disable */ /* eslint-disable */
function event(name: string,peer: string,peers?: string[],identify?: string[],services?: any[],blueprints?: string[],modules?: string[], function event(
name: string,
peer: string,
peers?: string[],
identify?: string[],
services?: any[],
blueprints?: string[],
modules?: string[],
) { ) {
if (!peers) { peers = null; } if (!peers) {
if (!services) { services = null; } peers = null;
if (!modules) { modules = null; } }
if (!identify) { identify = null; } if (!services) {
if (!blueprints) { blueprints = null; } services = null;
}
if (!modules) {
modules = null;
}
if (!identify) {
identify = null;
}
if (!blueprints) {
blueprints = null;
}
return { name, peer, peers, identify, services, modules, blueprints }; return { name, peer, peers, identify, services, modules, blueprints };
} }
/* eslint-enable */ /* eslint-enable */
(async () => { (async () => {
Fluence.setLogLevel('silent') Fluence.setLogLevel('silent');
const pid = await Fluence.generatePeerId(); const pid = await Fluence.generatePeerId();
const flags = genFlags(pid.toB58String()); const flags = genFlags(pid.toB58String());
@ -62,7 +79,7 @@ function event(name: string,peer: string,peers?: string[],identify?: string[],se
flags, flags,
}); });
const eventService = new ServiceOne('event', (fnName, args: any[]) => { const eventService = new ServiceOne('event', (fnName, args: any[], _tetraplets) => {
// console.log('event service called: ', fnName); // console.log('event service called: ', fnName);
// console.log('from: ', args[0]); // console.log('from: ', args[0]);
console.log(`event from ${args[0]} received:`, args); console.log(`event from ${args[0]} received:`, args);
@ -95,7 +112,7 @@ function event(name: string,peer: string,peers?: string[],identify?: string[],se
} }
const particle = await build(client.selfPeerId, part.script, map, 45000); const particle = await build(client.selfPeerId, part.script, map, 45000);
console.log("Building a particle with AIR script: ", particle) console.log('Building a particle with AIR script: ', particle);
await client.sendParticle(particle); await client.sendParticle(particle);
}); });
})(); })();