|
@ -21,7 +21,7 @@ var express = require('express'), |
|
|
pm2 = require('pm2'), |
|
|
pm2 = require('pm2'), |
|
|
cluster = require('cluster'), |
|
|
cluster = require('cluster'), |
|
|
numCPUs = require('os').cpus().length, |
|
|
numCPUs = require('os').cpus().length, |
|
|
kmdcli = require('./private/kmdcli.js'), |
|
|
coincli = require('./private/coincli.js'), |
|
|
ipc = require('electron').ipcMain; |
|
|
ipc = require('electron').ipcMain; |
|
|
|
|
|
|
|
|
Promise = require('bluebird'); |
|
|
Promise = require('bluebird'); |
|
@ -240,14 +240,35 @@ function createLoadingWindow() { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
ipc.on('invokeAction', function(event, data){ |
|
|
/* |
|
|
//console.log(data);
|
|
|
* var ipc = require('electron').ipcRenderer; |
|
|
kmdcli.command(data, function(err, command) { |
|
|
* ipc.once('coincliReply', function(event, response){ |
|
|
//console.log(command);
|
|
|
* console.log(response); |
|
|
var result = command; |
|
|
* }); |
|
|
event.sender.send('kmdcliReply', result); |
|
|
* ipc.send('InvokeCoinCliAction', '{"cli":"kmd","command":"getinfo"}'); |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
ipc.on('InvokeCoinCliAction', function(event, data){ |
|
|
|
|
|
console.log(JSON.stringify(data)); |
|
|
|
|
|
console.log(data.cli) |
|
|
|
|
|
console.log(data.command) |
|
|
|
|
|
|
|
|
|
|
|
if (data.cli == 'kmd') { |
|
|
|
|
|
coincli.kmdcommand(data.command, function(err, command) { |
|
|
|
|
|
//console.log(command);
|
|
|
|
|
|
var result = command; |
|
|
|
|
|
event.sender.send('coincliReply', result); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
if (data.cli == 'zec') { |
|
|
|
|
|
coincli.zeccommand(data.command, function(err, command) { |
|
|
|
|
|
//console.log(command);
|
|
|
|
|
|
var result = command; |
|
|
|
|
|
event.sender.send('coincliReply', result); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
}); |
|
|
}); |
|
|
}); |
|
|
|
|
|
//ca333 todo - add os detector to use correct binary - so we can use the same bundle on ALL OS platforms
|
|
|
//ca333 todo - add os detector to use correct binary - so we can use the same bundle on ALL OS platforms
|
|
|
/*if (os.platform() === 'win32') { |
|
|
/*if (os.platform() === 'win32') { |
|
|
process.chdir(iguanaDir); |
|
|
process.chdir(iguanaDir); |
|
|