mirror of https://github.com/embarklabs/embark.git
conflict en.json
This commit is contained in:
parent
e3a93a6d61
commit
70d3e6a46f
|
@ -128,6 +128,10 @@
|
|||
"Error while downloading the file": "Error while downloading the file",
|
||||
"Error while loading the content of ": "Error while loading the content of ",
|
||||
"no contracts found": "no contracts found",
|
||||
"IPFS node detected": "IPFS node detected",
|
||||
"No process file for this storage type exists. Please start the process locally.": "No process file for this storage type exists. Please start the process locally.",
|
||||
"Starting swarm process": "Starting swarm process",
|
||||
"Storage process for swarm ended before the end of this process. Code: 0": "Storage process for swarm ended before the end of this process. Code: 0",
|
||||
"DApp path length is too long: \"": "DApp path length is too long: \"",
|
||||
"This is known to cause issues with some applications, please consider reducing your DApp path's length to 66 characters or less.": "This is known to cause issues with some applications, please consider reducing your DApp path's length to 66 characters or less.",
|
||||
"DApp path length is too long: ": "DApp path length is too long: ",
|
||||
|
|
|
@ -339,7 +339,8 @@ class Embark {
|
|||
if (!serviceCheckResult.status || serviceCheckResult.status === 'off') {
|
||||
const storageProcessesLauncher = new StorageProcessesLauncher({
|
||||
logger: engine.logger,
|
||||
events: engine.events
|
||||
events: engine.events,
|
||||
storageConfig: engine.config.storageConfig
|
||||
});
|
||||
return storageProcessesLauncher.launchProcess(platform.toLowerCase(), (err) => {
|
||||
if (err) {
|
||||
|
|
|
@ -7,6 +7,7 @@ class StorageProcessesLauncher {
|
|||
constructor(options) {
|
||||
this.logger = options.logger;
|
||||
this.events = options.events;
|
||||
this.storageConfig = options.storageConfig;
|
||||
this.processes = {};
|
||||
}
|
||||
|
||||
|
@ -32,9 +33,16 @@ class StorageProcessesLauncher {
|
|||
silent: true,
|
||||
exitCallback: self.processExited.bind(this, storageName)
|
||||
});
|
||||
self.processes[storageName].send({action: constants.blockchain.init, options: {}});
|
||||
self.processes[storageName].send({action: constants.blockchain.init, options: {storageConfig: self.storageConfig}});
|
||||
|
||||
callback();
|
||||
self.processes[storageName].on('result', constants.storage.initiated, (msg) => {
|
||||
if (msg.error) {
|
||||
self.processes[storageName].disconnect();
|
||||
delete self.processes[storageName];
|
||||
return callback(msg.error);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
const shelljs = require('shelljs');
|
||||
const ProcessWrapper = require('../../process/processWrapper');
|
||||
const constants = require('../../constants');
|
||||
|
||||
let swarmProcess;
|
||||
|
||||
class SwarmProcess extends ProcessWrapper {
|
||||
constructor(options) {
|
||||
super();
|
||||
this.storageConfig = options.storageConfig;
|
||||
}
|
||||
|
||||
startSwarmDaemon() {
|
||||
if (!this.storageConfig.account || !this.storageConfig.account.address || !this.storageConfig.password) {
|
||||
return 'Account address and password are needed in the storage config to start the Swarm process';
|
||||
}
|
||||
shelljs.exec(`${this.storageConfig.swarmPath || 'swarm'} --bzzaccount ${this.storageConfig.account.address} --password ${this.storageConfig.password}`, {silent: true}, (err, _stdout, _stderr) => {
|
||||
if (err) {
|
||||
console.error(err);
|
||||
process.exit(1);
|
||||
}
|
||||
process.exit();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
process.on('message', (msg) => {
|
||||
if (msg.action === constants.storage.init) {
|
||||
swarmProcess = new SwarmProcess(msg.options);
|
||||
const error = swarmProcess.startSwarmDaemon();
|
||||
|
||||
swarmProcess.send({result: constants.storage.initiated, error});
|
||||
}
|
||||
});
|
Loading…
Reference in New Issue