Skip to content
Snippets Groups Projects
Commit 433bb294 authored by Cédric Moreau's avatar Cédric Moreau
Browse files

[fix] Make Duniter work with WebUI

parent 0bde64a7
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ module.exports = {
listInterfaces: bmapiMethods.listInterfaces,
upnpConf: (noupnp) => bmapiMethods.upnpConf(noupnp, logger),
upnpConf: (noupnp, logger) => bmapiMethods.upnpConf(noupnp, logger),
getRandomPort: bmapiMethods.getRandomPort,
......
......@@ -251,11 +251,6 @@ function Stack(dependencies) {
}
}
}
return yield command.onDatabaseExecute(server, conf, program, params,
// Start services and streaming between them
() => co(function*() {
// All inputs write to global INPUT stream
for (const module of streams.input) module.pipe(INPUT);
// All processes read from global INPUT stream
......@@ -264,8 +259,16 @@ function Stack(dependencies) {
for (const module of streams.process) module.pipe(PROCESS);
// All ouputs read from global PROCESS stream
for (const module of streams.output) PROCESS.pipe(module);
return yield command.onDatabaseExecute(server, conf, program, params,
// Start services and streaming between them
() => co(function*() {
// Any streaming module must implement a `startService` method
const modules = streams.input.concat(streams.process).concat(streams.output).concat(streams.neutral);
for (const m of streams.input) {
yield m.startService();
}
const modules = [].concat(streams.process).concat(streams.output).concat(streams.neutral);
yield modules.map(module => module.startService());
}),
......@@ -274,13 +277,13 @@ function Stack(dependencies) {
const modules = streams.input.concat(streams.process).concat(streams.output);
// Any streaming module must implement a `stopService` method
yield modules.map(module => module.stopService());
// Stop reading inputs
for (const module of streams.input) module.unpipe();
// // Stop reading inputs
// for (const module of streams.input) module.unpipe();
// Stop reading from global INPUT
INPUT.unpipe();
for (const module of streams.process) module.unpipe();
// Stop reading from global PROCESS
PROCESS.unpipe();
// INPUT.unpipe();
// for (const module of streams.process) module.unpipe();
// // Stop reading from global PROCESS
// PROCESS.unpipe();
}));
} catch (e) {
server.disconnect();
......
......@@ -42,11 +42,11 @@
"colors": "1.1.2",
"commander": "2.9.0",
"daemonize2": "0.4.2",
"duniter-bma": "0.2.0",
"duniter-crawler": "0.2.1",
"duniter-keypair": "0.1.2",
"duniter-prover": "0.2.0",
"duniter-bma": "^0.2.1",
"duniter-common": "0.1.0",
"duniter-crawler": "^0.2.2",
"duniter-keypair": "^0.2.0",
"duniter-prover": "^0.2.1",
"event-stream": "3.3.4",
"inquirer": "0.8.5",
"jison": "0.4.17",
......@@ -71,6 +71,7 @@
},
"devDependencies": {
"coveralls": "2.11.4",
"duniter-ui": "^0.3.0",
"eslint": "3.13.1",
"eslint-plugin-mocha": "4.8.0",
"istanbul": "0.4.0",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment