Browse Source

basilisk instance startup

all-modes
pbca26 8 years ago
parent
commit
5d040baa3d
  1. 10
      gui/init.js
  2. 29
      gui/loading.js
  3. 31
      main.js
  4. 2
      routes/shepherd.js

10
gui/init.js

@ -15,11 +15,6 @@ $(document).ready(function() {
if (appConf && !appConf.manualIguanaStart) {
StartIguana();
}
/*if (appConf && appConf.forks && appConf.forks.basilisk) {
setTimeout(function() {
StartBasiliskInstance();
}, 4000);
}*/
var portcheck;
@ -30,6 +25,11 @@ $(document).ready(function() {
if (result !== 'error') {
stopcheck();
if (appConf && appConf.forks && appConf.forks.basilisk) {
StartIguana_Cache();
}
$('#loading_status_text').text('Connecting to Basilisk Network...');
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries);
}

29
gui/loading.js

@ -65,28 +65,21 @@ function StartIguana() {
});
}
function StartBasiliskInstance() {
var ajax_data = { 'name': 'basilisk'};
console.log(ajax_data);
$.ajax({
function StartIguana_Cache() {
var ajax_data = {
'mode': 'basilisk',
'coin': 'all'
};
var start_iguana_cache= $.ajax({
type: 'POST',
data: JSON.stringify(ajax_data),
url: 'http://127.0.0.1:17777/shepherd/forks',
dataType: 'xml/html/script/json', // expected format for response
contentType: 'application/json', // send as JSON
success: function(data, textStatus, jqXHR) {
var AjaxOutputData = JSON.parse(data);
console.log('== Shepherd Forks Data OutPut ==');
console.log(AjaxOutputData);
},
error: function(xhr, textStatus, error) {
console.log(xhr.statusText);
if ( xhr.readyState == 0 ) {
}
console.log(textStatus);
console.log(error);
}
})
start_iguana_cache.done(function(data) {
_data = JSON.parse(data);
console.log(_data.result);
sessionStorage.setItem('IguanaCachePort', _data.result);
});
}

31
main.js

@ -21,7 +21,7 @@ var express = require('express'),
pm2 = require('pm2'),
cluster = require('cluster'),
numCPUs = require('os').cpus().length,
kmdcli = require('./private/kmdcli.js'),
coincli = require('./private/coincli.js'),
ipc = require('electron').ipcMain;
Promise = require('bluebird');
@ -240,14 +240,35 @@ function createLoadingWindow() {
}
});
ipc.on('invokeAction', function(event, data){
//console.log(data);
kmdcli.command(data, function(err, command) {
/*
* var ipc = require('electron').ipcRenderer;
* ipc.once('coincliReply', function(event, response){
* console.log(response);
* });
* 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('kmdcliReply', result);
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
/*if (os.platform() === 'win32') {
process.chdir(iguanaDir);

2
routes/shepherd.js

@ -23,7 +23,7 @@ Promise = require('bluebird');
const fixPath = require('fix-path');
var ps = require('ps-node'),
setconf = require('../private/setconf.js'),
kmdcli = require('../private/kmdcli.js'),
coincli = require('../private/coincli.js'),
assetChainPorts = require('./ports.js')
shepherd = express.Router(),
iguanaInstanceRegistry = {};

Loading…
Cancel
Save