Browse Source

allow custom rpc ports

v0.25
pbca26 7 years ago
parent
commit
4f7ac93ecd
  1. 4
      main.js
  2. 26
      routes/shepherd/daemonControl.js
  3. 2
      version
  4. 2
      version_build

4
main.js

@ -93,9 +93,8 @@ shepherd.setConfKMD('CHIPS');
guiapp.use((req, res, next) => {
res.header('Access-Control-Allow-Origin', appConfig.dev ? '*' : 'http://127.0.0.1:3000');
res.header('Access-Control-Allow-Headers', 'X-Requested-With');
res.header('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
res.header('Access-Control-Allow-Credentials', 'true');
res.header('Access-Control-Allow-Headers', 'Content-Type');
res.header('Access-Control-Allow-Methods', 'PUT, GET, POST, DELETE, OPTIONS');
next();
});
@ -407,6 +406,7 @@ function createWindow(status, hideLoadingWindow) {
mainWindow.getMMCacheData = shepherd.getMMCacheData;
mainWindow.activeSection = 'wallets';
mainWindow.argv = process.argv;
mainWindow.getAssetChainPorts = shepherd.getAssetChainPorts;
if (appConfig.dev) {
mainWindow.loadURL('http://127.0.0.1:3000');

26
routes/shepherd/daemonControl.js

@ -88,6 +88,28 @@ module.exports = (shepherd) => {
if (flock === 'komodod') {
let kmdDebugLogLocation = (data.ac_name !== 'komodod' ? `${shepherd.komodoDir}/${data.ac_name}` : shepherd.komodoDir) + '/debug.log';
// get custom coind port
const _coindConf = data.ac_name !== 'komodod' ? `${shepherd.komodoDir}/${data.ac_name}/${data.ac_name}.conf` : `${shepherd.komodoDir}/komodo.conf`;
try {
const _coindConfContents = fs.readFileSync(_coindConf, 'utf8');
if (_coindConfContents) {
const _coindCustomPort = _coindConfContents.match(/rpcport=\s*(.*)/);
if (_coindCustomPort[1]) {
shepherd.assetChainPorts[data.ac_name] = _coindCustomPort[1];
shepherd.log(`${data.ac_name} custom port ${_coindCustomPort[1]}`);
} else {
shepherd.log(`${data.ac_name} port ${shepherd.assetChainPorts[data.ac_name]}`);
}
} else {
shepherd.log(`${data.ac_name} port ${shepherd.assetChainPorts[data.ac_name]}`);
}
} catch (e) {
shepherd.log(`${data.ac_name} port ${shepherd.assetChainPorts[data.ac_name]}`);
}
shepherd.log('komodod flock selected...');
shepherd.log(`selected data: ${JSON.stringify(data, null, '\t')}`);
shepherd.writeLog('komodod flock selected...');
@ -904,5 +926,9 @@ module.exports = (shepherd) => {
});
}
shepherd.getAssetChainPorts = () => {
return shepherd.assetChainPorts;
}
return shepherd;
};

2
version

@ -1,3 +1,3 @@
version=0.2.0.25c
version=0.2.0.25d
type=e-beta
minversion=0.2.0.2

2
version_build

@ -1 +1 @@
0.2.0.25c-beta
0.2.0.25d-beta
Loading…
Cancel
Save