Mutli Node Read API

Mutli Node Read API
pull/98/head
saubyk 5 years ago
parent 76e3d16699
commit 346fa0e6c0

@ -0,0 +1,56 @@
[
{
"LNNode": "LND Testnet # 1",
"LNImplementation": "LND",
"Authentication": {
"macaroonPath": "/Users/suheb/Downloads",
"nodeAuthType": "CUSTOM",
"lndConfigPath": "",
"rtlPass": "xxx"
},
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "dark-blue",
"satsToBTC": "false",
"bitcoindConfigPath": "",
"enableLogging": "true",
"port": "3000",
"lndServerUrl": "https://localhost:8080/v1"
},
"SSO":{
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
}
},
{
"LNNode": "LND Mainnet # 1",
"LNImplementation": "LND",
"Authentication": {
"macaroonPath": "/Users/suheb/Downloads",
"nodeAuthType": "CUSTOM",
"lndConfigPath": "",
"rtlPass": "xxx"
},
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "dark-blue",
"satsToBTC": "false",
"bitcoindConfigPath": "",
"enableLogging": "true",
"port": "3000",
"lndServerUrl": "https://localhost:8080/v1"
},
"SSO":{
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
}
}
]

@ -83,3 +83,23 @@ exports.getConfig = (req, res, next) => {
}
});
};
exports.getMultiNodeConfig = (req, res, next) => {
var RTLMultiNodeConfFile = common.rtl_conf_file_path + '/RTL-Multi-Node-Conf.json';
logger.info('\r\nRTLConf.js: 91: ' + JSON.stringify(Date.now()) + ': INFO: Getting Multi Node Config');
fs.readFile(RTLMultiNodeConfFile, 'utf8', function(err, data) {
if (err) {
logger.error('\r\nRTLConf.js: 94: ' + JSON.stringify(Date.now()) + ': ERROR: Getting Multi Node Config Failed!');
res.status(500).json({
message: "Reading Multi Node Config Failed!",
error: err
});
} else {
const multiNodeConfig = require('../RTL-Multi-Node-Conf.json');
var nodeinfo = [];
for(var key in multiNodeConfig)
nodeinfo.push({"LNNode":multiNodeConfig[key].LNNode, "LNImpl":multiNodeConfig[key].LNImplementation});
res.status(200).json({nodes:nodeinfo});
}
});
};

@ -6,5 +6,6 @@ const authCheck = require("./authCheck");
router.get("/rtlconf", RTLConfController.getRTLConfig);
router.post("/", authCheck, RTLConfController.updateUISettings);
router.get("/config/:nodeType", authCheck, RTLConfController.getConfig);
router.get("/multinode", RTLConfController.getMultiNodeConfig);
module.exports = router;

Loading…
Cancel
Save