conflict in en.json

This commit is contained in:
Jonathan Rainville 2018-05-28 11:51:38 -04:00
parent 21a0042d00
commit 12525fb9bf
5 changed files with 45 additions and 13 deletions

View File

@ -125,7 +125,7 @@ Blockchain.prototype.run = function() {
}); });
child.on('exit', (code) => { child.on('exit', (code) => {
if (code) { if (code) {
console.error('Geth exited with error code ' + 1); console.error('Geth exited with error code ' + code);
console.error(lastMessage); console.error(lastMessage);
} }
}); });

View File

@ -135,6 +135,8 @@
"deploying to swarm!": "deploying to swarm!", "deploying to swarm!": "deploying to swarm!",
"adding %s to swarm": "adding %s to swarm", "adding %s to swarm": "adding %s to swarm",
"error uploading to swarm": "error uploading to swarm", "error uploading to swarm": "error uploading to swarm",
"Starting ipfs process": "Starting ipfs process",
"Storage process for ipfs ended before the end of this process. Code: 0": "Storage process for ipfs ended before the end of this process. Code: 0",
"WARNING! DApp path length is too long: ": "WARNING! DApp path length is too long: ", "WARNING! DApp path length is too long: ": "WARNING! DApp path length is too long: ",
"This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.", "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with starting geth, please consider reducing your DApp path's length to 66 characters or less.",
"Installing packages...": "Installing packages...", "Installing packages...": "Installing packages...",

View File

@ -335,8 +335,19 @@ class Embark {
if (!checkFn || typeof checkFn.fn !== 'function') { if (!checkFn || typeof checkFn.fn !== 'function') {
return callback(); return callback();
} }
const erroObj = {message: __('Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}:{{port}}.', {platform: platform, protocol: engine.config.storageConfig.protocol, host: engine.config.storageConfig.host, port: engine.config.storageConfig.port})};
function checkEndpoint(cb) {
checkFn.fn(function (serviceCheckResult) { checkFn.fn(function (serviceCheckResult) {
if (!serviceCheckResult.status || serviceCheckResult.status === 'off') { if (!serviceCheckResult.status || serviceCheckResult.status === 'off') {
return cb(erroObj);
}
cb();
});
}
checkEndpoint(function (err) {
if (err) {
const storageProcessesLauncher = new StorageProcessesLauncher({ const storageProcessesLauncher = new StorageProcessesLauncher({
logger: engine.logger, logger: engine.logger,
events: engine.events, events: engine.events,
@ -345,10 +356,16 @@ class Embark {
return storageProcessesLauncher.launchProcess(platform.toLowerCase(), (err) => { return storageProcessesLauncher.launchProcess(platform.toLowerCase(), (err) => {
if (err) { if (err) {
engine.logger.error(err); engine.logger.error(err);
return callback({message: __('Cannot upload: {{platform}} node is not running on {{protocol}}://{{host}}:{{port}}.', {platform: platform, protocol: engine.config.storageConfig.protocol, host: engine.config.storageConfig.host, port: engine.config.storageConfig.port})}); return callback(erroObj);
}
// Check endpoint again to see if really did start
checkEndpoint((err) => {
if (err) {
return callback(err);
} }
callback(); callback();
}); });
});
} }
callback(); callback();
}); });

View File

@ -2,7 +2,7 @@ const shelljs = require('shelljs');
const ProcessWrapper = require('../../process/processWrapper'); const ProcessWrapper = require('../../process/processWrapper');
const constants = require('../../constants'); const constants = require('../../constants');
let ipfsProcess; let ipfsProcess; // eslint-disable-line no-unused-vars
class IPFSProcess extends ProcessWrapper { class IPFSProcess extends ProcessWrapper {
constructor(_options) { constructor(_options) {
@ -12,19 +12,34 @@ class IPFSProcess extends ProcessWrapper {
} }
startIPFSDaemon() { startIPFSDaemon() {
shelljs.exec('ipfs daemon', {silent: true}, (err, _stdout, _stderr) => { const self = this;
const child = shelljs.exec('ipfs daemon', {silent: true}, (err, _stdout, _stderr) => {
if (err) { if (err) {
console.error(err); console.error(err);
process.exit(1); process.exit(1);
} }
process.exit(); process.exit();
}); });
let lastMessage;
child.stdout.on('data', (data) => {
if (!self.readyCalled && data.indexOf('Daemon is ready') > -1) {
self.readyCalled = true;
self.send({result: constants.storage.initiated});
}
lastMessage = data;
console.log('IPFS: ' + data);
});
child.on('exit', (code) => {
if (code) {
console.error('IPFS exited with error code ' + code);
console.error(lastMessage);
}
});
} }
} }
process.on('message', (msg) => { process.on('message', (msg) => {
if (msg.action === constants.storage.init) { if (msg.action === constants.storage.init) {
ipfsProcess = new IPFSProcess(msg.options); ipfsProcess = new IPFSProcess(msg.options);
return ipfsProcess.send({result: constants.storage.initiated});
} }
}); });

View File

@ -21,11 +21,9 @@ class SwarmProcess extends ProcessWrapper {
{ {
if (err) { if (err) {
console.error(err); console.error(err);
//process.exit(1); process.exit(1);
return;
} }
console.log('Complete?') process.exit();
//process.exit();
}); });
} }
} }