2018-09-15 01:31:01 +00:00
|
|
|
var fs = require('fs');
|
2018-10-10 00:08:05 +00:00
|
|
|
var common = require('./common');
|
2018-09-15 01:31:01 +00:00
|
|
|
var clArgs = require('optimist').argv;
|
|
|
|
|
|
|
|
if(undefined !== clArgs.lndir) {
|
2018-10-10 00:08:05 +00:00
|
|
|
common.lnd_dir = clArgs.lndir;
|
2018-09-15 01:31:01 +00:00
|
|
|
} else {
|
2018-10-10 00:08:05 +00:00
|
|
|
if(common.lnd_dir === '') {
|
|
|
|
common.lnd_dir = __dirname;
|
2018-09-15 01:31:01 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-10-10 00:08:05 +00:00
|
|
|
var macaroon = fs.readFileSync(common.lnd_dir + '/admin.macaroon').toString('hex');
|
2018-09-15 01:31:01 +00:00
|
|
|
var options = {
|
|
|
|
url: '',
|
|
|
|
rejectUnauthorized: false,
|
|
|
|
json: true,
|
|
|
|
headers: {
|
|
|
|
'Grpc-Metadata-macaroon': macaroon,
|
|
|
|
},
|
|
|
|
form: ''
|
|
|
|
};
|
|
|
|
|
|
|
|
module.exports = options;
|