|
|
@ -98,6 +98,92 @@ shepherd.defaultAppConfig = Object.assign({}, shepherd.appConfig); |
|
|
|
|
|
|
|
shepherd.coindInstanceRegistry = coindInstanceRegistry; |
|
|
|
|
|
|
|
shepherd.startKMDNative = function(selection) { |
|
|
|
if (selection === 'KMD') { |
|
|
|
const herdData = { |
|
|
|
'ac_name': 'komodod', |
|
|
|
'ac_options': [ |
|
|
|
'-daemon=0', |
|
|
|
'-addnode=78.47.196.146', |
|
|
|
] |
|
|
|
}; |
|
|
|
|
|
|
|
const options = { |
|
|
|
url: `http://127.0.0.1:${shepherd.appConfig.agamaPort}/shepherd/herd`, |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
body: JSON.stringify({ |
|
|
|
'herd': 'komodod', |
|
|
|
'options': herdData, |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
request(options, function(error, response, body) { |
|
|
|
if (response && |
|
|
|
response.statusCode && |
|
|
|
response.statusCode === 200) { |
|
|
|
//resolve(body);
|
|
|
|
} else { |
|
|
|
//resolve(body);
|
|
|
|
} |
|
|
|
}); |
|
|
|
} else { |
|
|
|
const herdData = [{ |
|
|
|
'ac_name': 'komodod', |
|
|
|
'ac_options': [ |
|
|
|
'-daemon=0', |
|
|
|
'-addnode=78.47.196.146', |
|
|
|
] |
|
|
|
}, { |
|
|
|
'ac_name': 'REVS', |
|
|
|
'ac_options': [ |
|
|
|
'-daemon=0', |
|
|
|
'-server', |
|
|
|
`-ac_name=REVS`, |
|
|
|
'-addnode=78.47.196.146', |
|
|
|
'-ac_supply=1300000' |
|
|
|
] |
|
|
|
}, { |
|
|
|
'ac_name': 'JUMBLR', |
|
|
|
'ac_options': [ |
|
|
|
'-daemon=0', |
|
|
|
'-server', |
|
|
|
`-ac_name=JUMBLR`, |
|
|
|
'-addnode=78.47.196.146', |
|
|
|
'-ac_supply=999999' |
|
|
|
] |
|
|
|
}]; |
|
|
|
|
|
|
|
for (let i = 0; i < herdData.length; i++) { |
|
|
|
setTimeout(() => { |
|
|
|
const options = { |
|
|
|
url: `http://127.0.0.1:${shepherd.appConfig.agamaPort}/shepherd/herd`, |
|
|
|
method: 'POST', |
|
|
|
headers: { |
|
|
|
'Content-Type': 'application/json', |
|
|
|
}, |
|
|
|
body: JSON.stringify({ |
|
|
|
'herd': 'komodod', |
|
|
|
'options': herdData[i], |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
request(options, function(error, response, body) { |
|
|
|
if (response && |
|
|
|
response.statusCode && |
|
|
|
response.statusCode === 200) { |
|
|
|
//resolve(body);
|
|
|
|
} else { |
|
|
|
//resolve(body);
|
|
|
|
} |
|
|
|
}); |
|
|
|
}, 100); |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
/* |
|
|
|
* Combined native dashboard update same as in gui |
|
|
|
* type: GET |
|
|
@ -1520,8 +1606,6 @@ shepherd.getConf = function(chain) { |
|
|
|
* params: payload |
|
|
|
*/ |
|
|
|
shepherd.post('/cli', function(req, res, next) { |
|
|
|
console.log('cli payload ->'); |
|
|
|
console.log(req.body.payload); |
|
|
|
if (!req.body.payload) { |
|
|
|
const errorObj = { |
|
|
|
msg: 'error', |
|
|
@ -2202,7 +2286,6 @@ shepherd.post('/debuglog', function(req, res) { |
|
|
|
_location = `${komodoDir}/${_ac}`; |
|
|
|
} |
|
|
|
|
|
|
|
console.log('komodo dir ' + komodoDir); |
|
|
|
shepherd.readDebugLog(`${_location}/debug.log`, _lastNLines) |
|
|
|
.then(function(result) { |
|
|
|
const _obj = { |
|
|
@ -2644,7 +2727,7 @@ function herder(flock, data) { |
|
|
|
let kmdDebugLogLocation = (data.ac_name !== 'komodod' ? komodoDir + '/' + data.ac_name : komodoDir) + '/debug.log'; |
|
|
|
|
|
|
|
console.log('komodod flock selected...'); |
|
|
|
console.log(`selected data: ${data}`); |
|
|
|
console.log('selected data: ' + JSON.stringify(data, null, '\t')); |
|
|
|
shepherd.writeLog('komodod flock selected...'); |
|
|
|
shepherd.writeLog(`selected data: ${data}`); |
|
|
|
|
|
|
|