mirror of https://github.com/embarklabs/embark.git
change ipfs to spawn too
This commit is contained in:
parent
6fa472ae11
commit
3c32f98f71
|
@ -6,7 +6,7 @@ const fs = require('../../core/fs.js');
|
||||||
|
|
||||||
const GethCommands = require('./geth_commands.js');
|
const GethCommands = require('./geth_commands.js');
|
||||||
|
|
||||||
/*eslint complexity: ["error", 35]*/
|
/*eslint complexity: ["error", 36]*/
|
||||||
var Blockchain = function(options) {
|
var Blockchain = function(options) {
|
||||||
this.blockchainConfig = options.blockchainConfig;
|
this.blockchainConfig = options.blockchainConfig;
|
||||||
this.env = options.env || 'development';
|
this.env = options.env || 'development';
|
||||||
|
|
|
@ -139,5 +139,8 @@
|
||||||
"For more info go to http://embark.status.im": "For more info go to http://embark.status.im",
|
"For more info go to http://embark.status.im": "For more info go to http://embark.status.im",
|
||||||
"%s is not installed on your machine": "%s is not installed on your machine",
|
"%s is not installed on your machine": "%s is not installed on your machine",
|
||||||
"You can install it by visiting: %s": "You can install it by visiting: %s",
|
"You can install it by visiting: %s": "You can install it by visiting: %s",
|
||||||
"IPFS node is offline": "IPFS node is offline"
|
"IPFS node is offline": "IPFS node is offline",
|
||||||
|
"Starting ipfs process": "Starting ipfs process",
|
||||||
|
"ipfs process started": "ipfs process started",
|
||||||
|
"IPFS node detected": "IPFS node detected"
|
||||||
}
|
}
|
|
@ -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');
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ class IPFSProcess extends ProcessWrapper {
|
||||||
}
|
}
|
||||||
|
|
||||||
checkIPFSVersion() {
|
checkIPFSVersion() {
|
||||||
shelljs.exec('ipfs --version', {silent: true}, (err, stdout, _stderr) => {
|
child_process.exec('ipfs --version', {silent: true}, (err, stdout, _stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
return;
|
return;
|
||||||
|
@ -31,13 +31,7 @@ class IPFSProcess extends ProcessWrapper {
|
||||||
|
|
||||||
startIPFSDaemon() {
|
startIPFSDaemon() {
|
||||||
const self = this;
|
const self = this;
|
||||||
const child = shelljs.exec('ipfs daemon', {silent: true}, (err, _stdout, _stderr) => {
|
const child = child_process.spawn('ipfs', ['daemon']);
|
||||||
if (err) {
|
|
||||||
console.error(err);
|
|
||||||
process.exit(1);
|
|
||||||
}
|
|
||||||
process.exit();
|
|
||||||
});
|
|
||||||
let lastMessage;
|
let lastMessage;
|
||||||
child.stdout.on('data', (data) => {
|
child.stdout.on('data', (data) => {
|
||||||
if (!self.readyCalled && data.indexOf('Daemon is ready') > -1) {
|
if (!self.readyCalled && data.indexOf('Daemon is ready') > -1) {
|
||||||
|
|
Loading…
Reference in New Issue