Browse Source

testing

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
2dc8593695
  1. 4
      dist/src/grpc/index.js
  2. 2
      dist/src/grpc/index.js.map
  3. 3
      dist/src/utils/lightning.js
  4. 2
      dist/src/utils/lightning.js.map
  5. 4
      dist/src/utils/unlock.js
  6. 2
      dist/src/utils/unlock.js.map
  7. 4
      src/grpc/index.ts
  8. 3
      src/utils/lightning.ts
  9. 4
      src/utils/unlock.ts

4
dist/src/grpc/index.js

@ -18,7 +18,7 @@ const lightning_1 = require("../utils/lightning");
const network = require("../network");
const moment = require("moment");
const constants_1 = require("../constants");
const unlock_1 = require("../utils/unlock");
// import {tryToUnlockLND} from '../utils/unlock'
const ERR_CODE_UNAVAILABLE = 14;
const ERR_CODE_STREAM_REMOVED = 2;
const ERR_CODE_UNIMPLEMENTED = 12; // locked
@ -151,7 +151,7 @@ function reconnectToLND(innerCtx) {
}
catch (e) {
if (e.code === ERR_CODE_UNIMPLEMENTED) {
yield unlock_1.tryToUnlockLND();
// await tryToUnlockLND()
}
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
if (ctx === innerCtx) { // if another retry fires, then this will not run

2
dist/src/grpc/index.js.map

File diff suppressed because one or more lines are too long

3
dist/src/utils/lightning.js

@ -59,8 +59,11 @@ const loadLightning = () => {
try {
var credentials = loadCredentials();
var lnrpcDescriptor = grpc.load("proto/rpc.proto");
console.log('lnrpcDescriptor', lnrpcDescriptor);
var lnrpc = lnrpcDescriptor.lnrpc;
console.log('lnrpc', lnrpc);
lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials);
console.log("lightningClient", lightningClient);
return lightningClient;
}
catch (e) {

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

File diff suppressed because one or more lines are too long

4
dist/src/utils/unlock.js

@ -16,7 +16,9 @@ const readline = require('readline');
const env = process.env.NODE_ENV || 'development';
const config = require(path.join(__dirname, '../../config/app.json'))[env];
console.log(JSON.stringify(config, null, 2));
// /relay/.lnd/.lndpwd
/*
"lnd_pwd_path": "/relay/.lnd/.lndpwd"
*/
function tryToUnlockLND() {
return __awaiter(this, void 0, void 0, function* () {
const p = config.lnd_pwd_path;

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

@ -1 +1 @@
{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAA;AAE1C,sBAAsB;AAEtB,SAAsB,cAAc;;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,YAAY,CAAA;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAM;QAEd,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,CAAC,CAAA;QAEpB,IAAI,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAClD,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AAZD,wCAYC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAA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EAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AAZD,wCAYC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"}

4
src/grpc/index.ts

@ -7,7 +7,7 @@ import {loadLightning} from '../utils/lightning'
import * as network from '../network'
import * as moment from 'moment'
import constants from '../constants'
import {tryToUnlockLND} from '../utils/unlock'
// import {tryToUnlockLND} from '../utils/unlock'
const ERR_CODE_UNAVAILABLE = 14
const ERR_CODE_STREAM_REMOVED = 2
@ -144,7 +144,7 @@ export async function reconnectToLND(innerCtx:number) {
resolve()
} catch(e) {
if(e.code===ERR_CODE_UNIMPLEMENTED) {
await tryToUnlockLND()
// await tryToUnlockLND()
}
setTimeout(async()=>{ // retry each 2 secs
if(ctx===innerCtx) { // if another retry fires, then this will not run

3
src/utils/lightning.ts

@ -51,8 +51,11 @@ const loadLightning = () => {
try{
var credentials = loadCredentials()
var lnrpcDescriptor = grpc.load("proto/rpc.proto");
console.log('lnrpcDescriptor',lnrpcDescriptor)
var lnrpc: any = lnrpcDescriptor.lnrpc
console.log('lnrpc',lnrpc)
lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials);
console.log("lightningClient",lightningClient)
return lightningClient
} catch(e) {
throw e

4
src/utils/unlock.ts

@ -8,7 +8,9 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env]
console.log(JSON.stringify(config,null,2))
// /relay/.lnd/.lndpwd
/*
"lnd_pwd_path": "/relay/.lnd/.lndpwd"
*/
export async function tryToUnlockLND() {
const p = config.lnd_pwd_path

Loading…
Cancel
Save