Browse Source

lnd_ip default to localhost

docker-workflow-build
Evan Feenstra 4 years ago
parent
commit
6057d96b1f
  1. 7
      dist/src/utils/lightning.js
  2. 2
      dist/src/utils/lightning.js.map
  3. 3
      dist/src/utils/signer.js
  4. 2
      dist/src/utils/signer.js.map
  5. 7
      src/utils/lightning.ts
  6. 3
      src/utils/signer.ts

7
dist/src/utils/lightning.js

@ -20,6 +20,7 @@ const macaroon_1 = require("./macaroon");
const config_1 = require("./config");
// var protoLoader = require('@grpc/proto-loader')
const config = config_1.loadConfig();
const LND_IP = config.lnd_ip || 'localhost';
const LND_KEYSEND_KEY = 5482373484;
exports.LND_KEYSEND_KEY = LND_KEYSEND_KEY;
const SPHINX_CUSTOM_RECORD_KEY = 133773310;
@ -46,7 +47,7 @@ exports.loadCredentials = loadCredentials;
// const packageDefinition = await protoLoader.load("rpc.proto", {})
// const lnrpcDescriptor = grpc.loadPackageDefinition(packageDefinition);
// var { lnrpc } = lnrpcDescriptor;
// lightningClient = new lnrpc.Lightning(config.lnd_ip + ':' + config.lnd_port, credentials);
// lightningClient = new lnrpc.Lightning(LND_IP + ':' + config.lnd_port, credentials);
// return lightningClient
// }
// }
@ -59,7 +60,7 @@ const loadLightning = () => {
var credentials = loadCredentials();
var lnrpcDescriptor = grpc.load("proto/rpc.proto");
var lnrpc = lnrpcDescriptor.lnrpc;
lightningClient = new lnrpc.Lightning(config.lnd_ip + ':' + config.lnd_port, credentials);
lightningClient = new lnrpc.Lightning(LND_IP + ':' + config.lnd_port, credentials);
return lightningClient;
}
catch (e) {
@ -77,7 +78,7 @@ const loadWalletUnlocker = () => {
try {
var lnrpcDescriptor = grpc.load("proto/walletunlocker.proto");
var lnrpc = lnrpcDescriptor.lnrpc;
walletUnlocker = new lnrpc.WalletUnlocker(config.lnd_ip + ':' + config.lnd_port, credentials);
walletUnlocker = new lnrpc.WalletUnlocker(LND_IP + ':' + config.lnd_port, credentials);
return walletUnlocker;
}
catch (e) {

2
dist/src/utils/lightning.js.map

File diff suppressed because one or more lines are too long

3
dist/src/utils/signer.js

@ -15,6 +15,7 @@ const ByteBuffer = require("bytebuffer");
const config_1 = require("./config");
// var protoLoader = require('@grpc/proto-loader')
const config = config_1.loadConfig();
const LND_IP = config.lnd_ip || 'localhost';
var signerClient = null;
exports.loadSigner = () => {
if (signerClient) {
@ -25,7 +26,7 @@ exports.loadSigner = () => {
var credentials = lightning_1.loadCredentials();
var lnrpcDescriptor = grpc.load("proto/signer.proto");
var signer = lnrpcDescriptor.signrpc;
signerClient = new signer.Signer(config.lnd_ip + ':' + config.lnd_port, credentials);
signerClient = new signer.Signer(LND_IP + ':' + config.lnd_port, credentials);
return signerClient;
}
catch (e) {

2
dist/src/utils/signer.js.map

@ -1 +1 @@
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/utils/signer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,6BAA4B;AAC5B,2CAA6C;AAC7C,yCAAwC;AACxC,qCAAmC;AAEnC,kDAAkD;AAClD,MAAM,MAAM,GAAG,mBAAU,EAAE,CAAA;AAE3B,IAAI,YAAY,GAAQ,IAAI,CAAC;AAEhB,QAAA,UAAU,GAAG,GAAG,EAAE;IAC7B,IAAI,YAAY,EAAE;QAChB,OAAO,YAAY,CAAA;KACpB;SAAM;QACL,IAAI;YACF,IAAI,WAAW,GAAG,2BAAe,EAAE,CAAA;YACnC,IAAI,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACtD,IAAI,MAAM,GAAQ,eAAe,CAAC,OAAO,CAAA;YACzC,YAAY,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,CAAC;YACrF,OAAO,YAAY,CAAA;SACpB;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,CAAA;SACR;KACF;AACH,CAAC,CAAA;AAEY,QAAA,WAAW,GAAG,CAAC,GAAG,EAAE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CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAChB;IACD,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACvB,CAAC"}

7
src/utils/lightning.ts

@ -10,6 +10,7 @@ import {loadConfig} from './config'
// var protoLoader = require('@grpc/proto-loader')
const config = loadConfig()
const LND_IP = config.lnd_ip || 'localhost'
const LND_KEYSEND_KEY = 5482373484
const SPHINX_CUSTOM_RECORD_KEY = 133773310
@ -38,7 +39,7 @@ const loadCredentials = () => {
// const packageDefinition = await protoLoader.load("rpc.proto", {})
// const lnrpcDescriptor = grpc.loadPackageDefinition(packageDefinition);
// var { lnrpc } = lnrpcDescriptor;
// lightningClient = new lnrpc.Lightning(config.lnd_ip + ':' + config.lnd_port, credentials);
// lightningClient = new lnrpc.Lightning(LND_IP + ':' + config.lnd_port, credentials);
// return lightningClient
// }
// }
@ -51,7 +52,7 @@ const loadLightning = () => {
var credentials = loadCredentials()
var lnrpcDescriptor = grpc.load("proto/rpc.proto");
var lnrpc: any = lnrpcDescriptor.lnrpc
lightningClient = new lnrpc.Lightning(config.lnd_ip + ':' + config.lnd_port, credentials);
lightningClient = new lnrpc.Lightning(LND_IP + ':' + config.lnd_port, credentials);
return lightningClient
} catch (e) {
throw e
@ -67,7 +68,7 @@ const loadWalletUnlocker = () => {
try {
var lnrpcDescriptor = grpc.load("proto/walletunlocker.proto");
var lnrpc: any = lnrpcDescriptor.lnrpc
walletUnlocker = new lnrpc.WalletUnlocker(config.lnd_ip + ':' + config.lnd_port, credentials);
walletUnlocker = new lnrpc.WalletUnlocker(LND_IP + ':' + config.lnd_port, credentials);
return walletUnlocker
} catch (e) {
console.log(e)

3
src/utils/signer.ts

@ -6,6 +6,7 @@ import {loadConfig} from './config'
// var protoLoader = require('@grpc/proto-loader')
const config = loadConfig()
const LND_IP = config.lnd_ip || 'localhost'
var signerClient = <any>null;
@ -17,7 +18,7 @@ export const loadSigner = () => {
var credentials = loadCredentials()
var lnrpcDescriptor = grpc.load("proto/signer.proto");
var signer: any = lnrpcDescriptor.signrpc
signerClient = new signer.Signer(config.lnd_ip + ':' + config.lnd_port, credentials);
signerClient = new signer.Signer(LND_IP + ':' + config.lnd_port, credentials);
return signerClient
} catch (e) {
throw e

Loading…
Cancel
Save