mirror of
https://github.com/fluencelabs/dashboard
synced 2025-04-25 07:42:16 +00:00
Update aqua version (#5)
* Up fluence sdk and aqua version * Add flatten operator for future use
This commit is contained in:
parent
8da5493f89
commit
ac4ff02a14
28
package-lock.json
generated
28
package-lock.json
generated
@ -1223,9 +1223,9 @@
|
||||
}
|
||||
},
|
||||
"@fluencelabs/aquamarine-stepper": {
|
||||
"version": "0.0.16",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.0.16.tgz",
|
||||
"integrity": "sha512-yrRMH2ysrxkhOGUe599urPopx6bon44qHppyvE6RKdrE1qVgxYKONWU+BNM+ouzIZ3UW5hoT0gQZ7lmI3HS30g=="
|
||||
"version": "0.0.30",
|
||||
"resolved": "https://registry.npmjs.org/@fluencelabs/aquamarine-stepper/-/aquamarine-stepper-0.0.30.tgz",
|
||||
"integrity": "sha512-XIgRgyVgPJXvXB3NuYHpSdJ0EFcFZ+K4uduGFf8PfnFii/bFs4F1n3MBB+b4D0y59HR4F9ZQUC4fXxcf6UCYWA=="
|
||||
},
|
||||
"@hapi/address": {
|
||||
"version": "2.1.4",
|
||||
@ -6829,11 +6829,11 @@
|
||||
"dev": true
|
||||
},
|
||||
"fluence": {
|
||||
"version": "0.7.101",
|
||||
"resolved": "https://registry.npmjs.org/fluence/-/fluence-0.7.101.tgz",
|
||||
"integrity": "sha512-bbaAPKvCf5QkX6zXt0/J+gtJ6JUNUAlWIuiioe9xZQsM4GDJtbp7YF3V+DFjAvqv9kfA2y7dHNuzqDnXMmr0xA==",
|
||||
"version": "0.7.108",
|
||||
"resolved": "https://registry.npmjs.org/fluence/-/fluence-0.7.108.tgz",
|
||||
"integrity": "sha512-Pwk3QkX2AX5vWv791yfIy37xMFAoB+iIZFOAaRCHES2nkBXVJgqBQWH42xXcGJeiBCfecPpI9yl9kPSp3f6nCA==",
|
||||
"requires": {
|
||||
"@fluencelabs/aquamarine-stepper": "0.0.16",
|
||||
"@fluencelabs/aquamarine-stepper": "0.0.30",
|
||||
"async": "3.2.0",
|
||||
"base64-js": "1.3.1",
|
||||
"bs58": "4.0.1",
|
||||
@ -13430,14 +13430,14 @@
|
||||
}
|
||||
},
|
||||
"sinon": {
|
||||
"version": "9.2.1",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.1.tgz",
|
||||
"integrity": "sha512-naPfsamB5KEE1aiioaoqJ6MEhdUs/2vtI5w1hPAXX/UwvoPjXcwh1m5HiKx0HGgKR8lQSoFIgY5jM6KK8VrS9w==",
|
||||
"version": "9.2.2",
|
||||
"resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.2.tgz",
|
||||
"integrity": "sha512-9Owi+RisvCZpB0bdOVFfL314I6I4YoRlz6Isi4+fr8q8YQsDPoCe5UnmNtKHRThX3negz2bXHWIuiPa42vM8EQ==",
|
||||
"requires": {
|
||||
"@sinonjs/commons": "^1.8.1",
|
||||
"@sinonjs/fake-timers": "^6.0.1",
|
||||
"@sinonjs/formatio": "^5.0.1",
|
||||
"@sinonjs/samsam": "^5.2.0",
|
||||
"@sinonjs/samsam": "^5.3.0",
|
||||
"diff": "^4.0.2",
|
||||
"nise": "^4.0.4",
|
||||
"supports-color": "^7.1.0"
|
||||
@ -15741,9 +15741,9 @@
|
||||
}
|
||||
},
|
||||
"web-encoding": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.4.tgz",
|
||||
"integrity": "sha512-DcXs2lbVPzuJmn2kuDEwul2oZg7p4YMa5J2f0YzsOBHaAnBYGPNUB/rJ74DTjTKpw7F0+lSsVM8sFHE2UyBixg=="
|
||||
"version": "1.0.6",
|
||||
"resolved": "https://registry.npmjs.org/web-encoding/-/web-encoding-1.0.6.tgz",
|
||||
"integrity": "sha512-26wEnRPEFAc5d5lmH1Q/DuvWEYsRF1D2alX2jlKpdmqv7cj+BbANL7Xlcl9r4s72Eg9kItZa9RWVbBMC9dMv4w=="
|
||||
},
|
||||
"webpack": {
|
||||
"version": "5.7.0",
|
||||
|
@ -5,6 +5,7 @@
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "webpack-serve --open",
|
||||
"serve": "webpack serve",
|
||||
"pack": "webpack --mode production",
|
||||
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write"
|
||||
},
|
||||
@ -19,7 +20,7 @@
|
||||
},
|
||||
"homepage": "https://github.com/fluencelabs/fluence-admin#readme",
|
||||
"dependencies": {
|
||||
"fluence": "0.7.101",
|
||||
"fluence": "0.7.108",
|
||||
"tachyons": "^4.12.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@ -54,6 +54,11 @@ fold iter item (Air d s) =
|
||||
Air d ("(fold " ++ iter ++ " " ++ item ++ "\n" ++ s ++ ")\n")
|
||||
|
||||
|
||||
flattenOp : String -> String
|
||||
flattenOp s =
|
||||
s ++ "!"
|
||||
|
||||
|
||||
next : String -> Air
|
||||
next item =
|
||||
Air Dict.empty ("(next " ++ item ++ ")\n")
|
||||
|
@ -1,6 +1,6 @@
|
||||
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)
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
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)
|
||||
|
||||
|
||||
|
@ -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[] = [
|
||||
{
|
||||
multiaddr: '/dns4/net01.fluence.dev/tcp/19001/wss/p2p/12D3KooWEXNUbCXooUwHrHBbrmjsrpHXoEphPwbjQXEGyzbqKnE9',
|
||||
|
41
src/index.ts
41
src/index.ts
@ -22,11 +22,11 @@ import { registerService } from 'fluence/dist/globalState';
|
||||
import { ServiceOne } from 'fluence/dist/service';
|
||||
import * as serviceWorker from './serviceWorker';
|
||||
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 {
|
||||
return {
|
||||
@ -37,20 +37,37 @@ function genFlags(peerId: string): any {
|
||||
}
|
||||
|
||||
/* 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 (!services) { services = null; }
|
||||
if (!modules) { modules = null; }
|
||||
if (!identify) { identify = null; }
|
||||
if (!blueprints) { blueprints = null; }
|
||||
if (!peers) {
|
||||
peers = null;
|
||||
}
|
||||
if (!services) {
|
||||
services = null;
|
||||
}
|
||||
if (!modules) {
|
||||
modules = null;
|
||||
}
|
||||
if (!identify) {
|
||||
identify = null;
|
||||
}
|
||||
if (!blueprints) {
|
||||
blueprints = null;
|
||||
}
|
||||
|
||||
return { name, peer, peers, identify, services, modules, blueprints };
|
||||
}
|
||||
/* eslint-enable */
|
||||
|
||||
(async () => {
|
||||
Fluence.setLogLevel('silent')
|
||||
Fluence.setLogLevel('silent');
|
||||
const pid = await Fluence.generatePeerId();
|
||||
const flags = genFlags(pid.toB58String());
|
||||
|
||||
@ -62,7 +79,7 @@ function event(name: string,peer: string,peers?: string[],identify?: string[],se
|
||||
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('from: ', args[0]);
|
||||
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);
|
||||
console.log("Building a particle with AIR script: ", particle)
|
||||
console.log('Building a particle with AIR script: ', particle);
|
||||
await client.sendParticle(particle);
|
||||
});
|
||||
})();
|
||||
|
Loading…
x
Reference in New Issue
Block a user