mirror of https://github.com/embarklabs/embark.git
boot swarm with spawn
This commit is contained in:
parent
8655b49a39
commit
c86c50fb4e
|
@ -1,4 +1,4 @@
|
||||||
const shelljs = require('shelljs');
|
const child_process = require('child_process');
|
||||||
const ProcessWrapper = require('../../process/processWrapper');
|
const ProcessWrapper = require('../../process/processWrapper');
|
||||||
const constants = require('../../constants');
|
const constants = require('../../constants');
|
||||||
|
|
||||||
|
@ -20,16 +20,13 @@ class SwarmProcess extends ProcessWrapper {
|
||||||
if (self.webServerConfig && self.webServerConfig && self.webServerConfig.host && self.webServerConfig.port) {
|
if (self.webServerConfig && self.webServerConfig && self.webServerConfig.host && self.webServerConfig.port) {
|
||||||
corsDomain = `http://${self.webServerConfig.host}:${self.webServerConfig.port}`;
|
corsDomain = `http://${self.webServerConfig.host}:${self.webServerConfig.port}`;
|
||||||
}
|
}
|
||||||
const child = shelljs.exec(
|
const child = child_process.spawn(this.storageConfig.swarmPath || 'swarm',
|
||||||
`${this.storageConfig.swarmPath || 'swarm'} --bzzaccount ${this.storageConfig.account.address} --password ${this.storageConfig.account.password} --corsdomain ${corsDomain} --ens-api ''`,
|
[
|
||||||
{silent: true}, (err, _stdout, _stderr) =>
|
`--bzzaccount ${this.storageConfig.account.address}`,
|
||||||
{
|
`--password ${this.storageConfig.account.password}`,
|
||||||
if (err) {
|
`--corsdomain ${corsDomain}`,
|
||||||
console.error(err);
|
"--ens-api ''"
|
||||||
process.exit(1);
|
]);
|
||||||
}
|
|
||||||
process.exit();
|
|
||||||
});
|
|
||||||
let lastMessage;
|
let lastMessage;
|
||||||
child.stderr.on('data', (data) => {
|
child.stderr.on('data', (data) => {
|
||||||
if (!self.readyCalled && data.indexOf('Swarm http proxy started') > -1) {
|
if (!self.readyCalled && data.indexOf('Swarm http proxy started') > -1) {
|
||||||
|
|
Loading…
Reference in New Issue