Skip to content

Commit

Permalink
incomplete 2
Browse files Browse the repository at this point in the history
incomplete 2
  • Loading branch information
ShahanaFarooqui committed Apr 6, 2019
1 parent d329a6f commit c9717fb
Show file tree
Hide file tree
Showing 23 changed files with 302 additions and 402 deletions.
95 changes: 44 additions & 51 deletions RTL-Multi-Node-Conf.json
@@ -1,56 +1,49 @@
[{
"index": "1",
"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://192.168.1.8:8080/v1"
},
"SSO":{
{
"multiPass": "multi",
"SSO": {
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
}
},
{
"index": "2",
"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://192.168.1.20:8080/v1"
"nodes": [{
"index": 1,
"lnNode": "LND Testnet # 1",
"lnImplementation": "LND",
"Authentication": {
"macaroonPath": "/Users/suheb/Downloads",
"lndConfigPath": "C:\\Users\\suheb\\AppData\\Local\\Lnd\\lnd.conf"
},
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "dark-blue",
"satsToBTC": "false",
"bitcoindConfigPath": "C:\\Bitcoind\\config\\path",
"enableLogging": "true",
"port": "3000",
"lndServerUrl": "https://192.168.1.20:8080/v1"
}
},
"SSO":{
"rtlSSO": 0,
"rtlCookiePath": "",
"logoutRedirectLink": ""
}
}]
{
"index": 2,
"lnNode": "LND Mainnet # 1",
"lnImplementation": "LND",
"Authentication": {
"macaroonPath": "C:\\Users\\suheb\\AppData\\Local\\Lnd\\data\\chain\\bitcoin\\testnet"
},
"Settings": {
"flgSidenavOpened": "true",
"flgSidenavPinned": "true",
"menu": "Vertical",
"menuType": "Regular",
"theme": "dark-blue",
"satsToBTC": "false",
"bitcoindConfigPath": "",
"enableLogging": "true",
"port": "3000",
"lndServerUrl": "https://localhost:8080/v1"
}
}]
}
53 changes: 40 additions & 13 deletions common.js
Expand Up @@ -2,9 +2,9 @@ var fs = require('fs');
var crypto = require('crypto');
var common = {};

common.multi_node_setup = false;
common.port = 3000;
common.rtl_conf_file_path = '';
common.rtl_multi_node_conf_file_path = '';
common.lnd_server_url = '';
common.lnd_config_path = '';
common.node_auth_type = 'DEFAULT';
Expand All @@ -19,21 +19,48 @@ common.logout_redirect_link = '/login';
common.cookie = '';
common.secret_key = crypto.randomBytes(64).toString('hex');
common.options = {};
common.nodes = [];

common.setOptions = () => {
var macaroon = fs.readFileSync(common.macaroon_path + '/admin.macaroon').toString('hex');
common.options = {
url: '',
rejectUnauthorized: false,
json: true,
headers: {
'Grpc-Metadata-macaroon': macaroon,
},
form: ''
};
return common.options;
common.getOptions = (selNodeIndex) => {
if(selNodeIndex === '') {
return common.options;
} else {
return common.findNode(selNodeIndex).options;
}
};

common.setOptions = (selNodeIndex) => {
if(selNodeIndex === '') {
const macaroon = fs.readFileSync(common.macaroon_path + '/admin.macaroon').toString('hex');
common.options = {
url: '',
rejectUnauthorized: false,
json: true,
headers: {
'Grpc-Metadata-macaroon': macaroon,
},
form: ''
};
return common.options;
} else {
const selNode = common.findNode(selNodeIndex);
const macaroon = fs.readFileSync(selNode.macaroon_path + '/admin.macaroon').toString('hex');
selNode.options = {
url: '',
rejectUnauthorized: false,
json: true,
headers: {
'Grpc-Metadata-macaroon': macaroon,
},
form: ''
};
return selNode.options;
}
}

common.findNode = (selNodeIndex) => {
return common.nodes.find(node => node.index == selNodeIndex);
}

common.convertToBTC = (num) => {
return (num / 100000000).toFixed(6);
Expand Down

0 comments on commit c9717fb

Please sign in to comment.