|
|
@ -98,14 +98,15 @@ shepherd.defaultAppConfig = Object.assign({}, shepherd.appConfig); |
|
|
|
|
|
|
|
shepherd.coindInstanceRegistry = coindInstanceRegistry; |
|
|
|
|
|
|
|
shepherd.startKMDNative = function(selection) { |
|
|
|
shepherd.startKMDNative = function(selection, isManual) { |
|
|
|
if (selection === 'KMD') { |
|
|
|
const herdData = { |
|
|
|
'ac_name': 'komodod', |
|
|
|
'ac_options': [ |
|
|
|
'-daemon=0', |
|
|
|
'-addnode=78.47.196.146', |
|
|
|
] |
|
|
|
], |
|
|
|
'manualStart': isManual, |
|
|
|
}; |
|
|
|
|
|
|
|
const options = { |
|
|
@ -2312,6 +2313,7 @@ shepherd.post('/herd', function(req, res) { |
|
|
|
console.log('======= req.body ======='); |
|
|
|
console.log(req.body); |
|
|
|
|
|
|
|
if (!req.body.options.manualStart) { |
|
|
|
function testCoindPort() { |
|
|
|
if (!lockDownAddCoin) { |
|
|
|
const _port = assetChainPorts[req.body.options.ac_name]; |
|
|
@ -2362,6 +2364,16 @@ shepherd.post('/herd', function(req, res) { |
|
|
|
result: 'result', |
|
|
|
}; |
|
|
|
|
|
|
|
res.end(JSON.stringify(obj)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
herder(req.body.herd, req.body.options); |
|
|
|
|
|
|
|
const obj = { |
|
|
|
msg: 'success', |
|
|
|
result: 'result', |
|
|
|
}; |
|
|
|
|
|
|
|
res.end(JSON.stringify(obj)); |
|
|
|
} |
|
|
|
}); |
|
|
@ -2790,10 +2802,11 @@ function herder(flock, data) { |
|
|
|
console.log(`daemon param ${data.ac_custom_param}`); |
|
|
|
|
|
|
|
coindInstanceRegistry[data.ac_name] = true; |
|
|
|
if (!data.manualStart) { |
|
|
|
let _arg = `${coindACParam}${data.ac_options.join(' ')}${_customParam}`; |
|
|
|
_arg = _arg.trim().split(' '); |
|
|
|
execFile(`${komododBin}`, _arg, { |
|
|
|
maxBuffer: 1024 * 10000 // 10 mb
|
|
|
|
maxBuffer: 1024 * 500000 // 500 mb
|
|
|
|
}, function(error, stdout, stderr) { |
|
|
|
shepherd.writeLog(`stdout: ${stdout}`); |
|
|
|
shepherd.writeLog(`stderr: ${stderr}`); |
|
|
@ -2806,12 +2819,16 @@ function herder(flock, data) { |
|
|
|
cache.io.emit('service', { |
|
|
|
komodod: { |
|
|
|
error: 'run -reindex', |
|
|
|
} |
|
|
|
}, |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (data.manualStart) { |
|
|
|
coindInstanceRegistry[data.ac_name] = true; |
|
|
|
} |
|
|
|
console.log(`port ${_port} (${data.ac_name}) is already in use`); |
|
|
|
shepherd.writeLog(`port ${_port} (${data.ac_name}) is already in use`); |
|
|
|
} |
|
|
|