mirror of
https://github.com/Ride-The-Lightning/RTL.git
synced 2025-02-22 06:21:49 +01:00
Mutli Node Read API
Mutli Node Read API
This commit is contained in:
parent
76e3d16699
commit
346fa0e6c0
3 changed files with 77 additions and 0 deletions
56
RTL-Multi-Node-Conf.json
Normal file
56
RTL-Multi-Node-Conf.json
Normal file
|
@ -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…
Add table
Reference in a new issue