diff --git a/dist/src/controllers/details.js b/dist/src/controllers/details.js index 2b09880..44ec2b0 100644 --- a/dist/src/controllers/details.js +++ b/dist/src/controllers/details.js @@ -14,8 +14,16 @@ const res_1 = require("../utils/res"); const readLastLines = require("read-last-lines"); const nodeinfo_1 = require("../utils/nodeinfo"); const path = require("path"); +const constants_1 = require("../constants"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env]; +exports.checkRoute = (req, res) => { + const { pubkey, amount } = req.params; + if (!(pubkey && pubkey.length === 66)) + return res_1.failure(res, 'wrong pubkey'); + const r = lightning_1.queryRoute(pubkey, amount || constants_1.default.min_sat_amount); + console.log(JSON.stringify(r)); +}; const defaultLogFiles = [ '/var/log/supervisor/relay.log', '/home/lnd/.pm2/logs/app-error.log', diff --git a/dist/src/controllers/details.js.map b/dist/src/controllers/details.js.map index 141d6ca..c1a1de3 100644 --- a/dist/src/controllers/details.js.map +++ b/dist/src/controllers/details.js.map @@ -1 +1 @@ -{"version":3,"file":"details.js","sourceRoot":"","sources":["../../../src/controllers/details.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,kDAAgD;AAChD,sCAA+C;AAC/C,iDAAgD;AAChD,gDAA6C;AAC7C,6BAA4B;AAE5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG;IACvB,+BAA+B;IAC/B,mCAAmC;IACnC,iBAAiB;CACjB,CAAA;AACD,SAAsB,YAAY,CAAC,GAAG,EAAE,GAAG;;QAC1C,MAAM,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAA;QACtE,IAAI,GAAG,CAA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QAAQ,EAAE,EAAE,aAAa,EAAE,iBAAiB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE,CAAC,CAAC;SAChH;aAAM;YACN,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;SAC7B;QACD,GAAG,CAAC,GAAG,EAAE,CAAC;IACX,CAAC,CAAC,CAAA;AACH,CAAC,CAAA,CAAC;AAEW,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,IAAI,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC,aAAa,CAAC;IAC9C,IAAI,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE;QAC5E,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACf,GAAG,CAAC,GAAG,EAAE,CAAA;QACT,OAAM;KACN;IACD,MAAM,IAAI,GAAG,MAAM,mBAAQ,EAAE,CAAA;IAC7B,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;IACf,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACd,GAAG,CAAC,GAAG,EAAE,CAAA;AACV,CAAC,CAAA,CAAA;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAClD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC3C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/index.js b/dist/src/controllers/index.js index 5719ef2..f928c91 100644 --- a/dist/src/controllers/index.js +++ b/dist/src/controllers/index.js @@ -28,6 +28,7 @@ const gitinfo_1 = require("../utils/gitinfo"); const timers = require("../utils/timers"); const builtInBots = require("../builtin"); const constants_1 = require("../constants"); +const lightning_1 = require("../utils/lightning"); const env = process.env.NODE_ENV || 'development'; console.log("=> env:", env); function set(app) { @@ -92,6 +93,7 @@ function set(app) { app.get('/getinfo', details.getInfo); app.get('/logs', details.getLogsSince); app.get('/info', details.getNodeInfo); + app.get('/route', details.checkRoute); app.post('/action', actions.processAction); app.get('/bots', bots.getBots); app.post('/bot', bots.createBot); @@ -118,6 +120,9 @@ function set(app) { } }); }); + const pubkey = '03a9a8d953fe747d0dd94dd3c567ddc58451101e987e2d2bf7a4d1e10a2c89ff38'; + const r = lightning_1.queryRoute(pubkey, constants_1.default.min_sat_amount); + console.log(JSON.stringify(r)); }); } exports.set = set; diff --git a/dist/src/controllers/index.js.map b/dist/src/controllers/index.js.map index 09772ea..56f6138 100644 --- a/dist/src/controllers/index.js.map +++ b/dist/src/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,iCAAgC;AAChC,8CAAyC;AACzC,0CAAyC;AACzC,0CAAyC;AACzC,4CAAoC;AAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAE1B,SAAsB,GAAG,CAAC,GAAG;;QAE5B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,K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EAAE,KAAK,CAAC,mBAAmB;IACnD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,0BAA0B;IACzD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC,0BAA0B;IACzD,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,gBAAgB;IAChD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,iBAAiB;IAC/C,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,KAAK,CAAC,gBAAgB;IAC7C,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,oBAAoB;IAChD,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,GAAE,EAAE,GAAC,CAAC;IAC5B,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,oBAAoB;IAC1D,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,UAAU,CAAC,oBAAoB;IAC1D,CAAC,QAAQ,CAAC,aAAa,CAAC,EAAE,UAAU,CAAC,mBAAmB;IACxD,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,UAAU,CAAC,kBAAkB;IACtD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB;IAC9C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;CAC7E,CAAA"} \ No newline at end of file diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index b522a1b..74bb5ba 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -113,6 +113,20 @@ const getRoute = (pub_key, amt, callback) => __awaiter(void 0, void 0, void 0, f lightning.queryRoutes({ pub_key, amt }, (err, response) => callback(err, response)); }); exports.getRoute = getRoute; +const queryRoute = (pub_key, amt) => __awaiter(void 0, void 0, void 0, function* () { + return new Promise(function (resolve, reject) { + return __awaiter(this, void 0, void 0, function* () { + let lightning = yield loadLightning(); + lightning.queryRoutes({ pub_key, amt }, (err, response) => { + if (err) + reject(err); + else + resolve(response); + }); + }); + }); +}); +exports.queryRoute = queryRoute; const keysend = (opts) => { return new Promise(function (resolve, reject) { return __awaiter(this, void 0, void 0, function* () { diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index 1676d1b..906025d 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAE5B,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAqYhC,0CAAe;AApYjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAqYxC,4DAAwB;AAnY1B,IAAI,eAAe,GAAS,IAAI,CAAC;AACjC,IAAI,cAAc,GAAU,IAAI,CAAC;AAEjC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CA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AC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAoCC,kCAAW;AAlCb,SAAe,OAAO;;QACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAC,MAAM,EAAC,EAAE;YACpC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAA;YACjC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAS,GAAG,EAAE,QAAQ;gBAC3C,IAAI,GAAG,IAAI,IAAI,EAAE;oBAChB,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AA+BC,0BAAO;AA7BT,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAE5B,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,I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AChB,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AA+BC,0BAAO;AA7BT,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/src/controllers/details.ts b/src/controllers/details.ts index eff4bd1..5dc2df9 100644 --- a/src/controllers/details.ts +++ b/src/controllers/details.ts @@ -1,11 +1,21 @@ -import {loadLightning} from '../utils/lightning' +import { loadLightning, queryRoute } from '../utils/lightning' import { success, failure } from '../utils/res' import * as readLastLines from 'read-last-lines' import { nodeinfo } from '../utils/nodeinfo'; import * as path from 'path' +import constants from '../constants' const env = process.env.NODE_ENV || 'development'; -const config = require(path.join(__dirname,'../../config/app.json'))[env] +const config = require(path.join(__dirname, '../../config/app.json'))[env] + + +export const checkRoute = (req, res) => { + const {pubkey, amount} = req.params + if(!(pubkey && pubkey.length===66)) return failure(res, 'wrong pubkey') + + const r = queryRoute(pubkey, amount||constants.min_sat_amount) + console.log(JSON.stringify(r)) +}; const defaultLogFiles = [ '/var/log/supervisor/relay.log', @@ -16,28 +26,28 @@ export async function getLogsSince(req, res) { const logFiles = config.log_file ? [config.log_file] : defaultLogFiles let txt let err - await asyncForEach(logFiles, async filepath=>{ - if(!txt){ + await asyncForEach(logFiles, async filepath => { + if (!txt) { try { const lines = await readLastLines.read(filepath, 500) - if(lines) { + if (lines) { var linesArray = lines.split('\n') linesArray.reverse() - txt = linesArray.join('\n') - } - } catch(e) { + txt = linesArray.join('\n') + } + } catch (e) { err = e } } }) - if(txt) success(res, txt) + if (txt) success(res, txt) else failure(res, err) } export const getInfo = async (req, res) => { const lightning = loadLightning() var request = {} - lightning.getInfo(request, function(err, response) { + lightning.getInfo(request, function (err, response) { res.status(200); if (err == null) { res.json({ success: true, response }); @@ -49,9 +59,9 @@ export const getInfo = async (req, res) => { }; export const getChannels = async (req, res) => { - const lightning = loadLightning() + const lightning = loadLightning() var request = {} - lightning.listChannels(request, function(err, response) { + lightning.listChannels(request, function (err, response) { res.status(200); if (err == null) { res.json({ success: true, response }); @@ -63,9 +73,9 @@ export const getChannels = async (req, res) => { }; export const getBalance = (req, res) => { - const lightning = loadLightning() + const lightning = loadLightning() var request = {} - lightning.channelBalance(request, function(err, response) { + lightning.channelBalance(request, function (err, response) { res.status(200); if (err == null) { res.json({ success: true, response }); @@ -80,7 +90,7 @@ export const getLocalRemoteBalance = async (req, res) => { const lightning = loadLightning() lightning.listChannels({}, (err, channelList) => { const { channels } = channelList - + const localBalances = channels.map(c => c.local_balance) const remoteBalances = channels.map(c => c.remote_balance) const totalLocalBalance = localBalances.reduce((a, b) => parseInt(a) + parseInt(b), 0) @@ -93,12 +103,12 @@ export const getLocalRemoteBalance = async (req, res) => { res.json({ success: false }); } res.end(); - }) + }) }; export const getNodeInfo = async (req, res) => { var ipOfSource = req.connection.remoteAddress; - if(!(ipOfSource.includes('127.0.0.1') || ipOfSource.includes('localhost'))){ + if (!(ipOfSource.includes('127.0.0.1') || ipOfSource.includes('localhost'))) { res.status(401) res.end() return @@ -111,6 +121,6 @@ export const getNodeInfo = async (req, res) => { async function asyncForEach(array, callback) { for (let index = 0; index < array.length; index++) { - await callback(array[index], index, array); + await callback(array[index], index, array); } } \ No newline at end of file diff --git a/src/controllers/index.ts b/src/controllers/index.ts index 6e62308..09435bd 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -18,6 +18,8 @@ import * as timers from '../utils/timers' import * as builtInBots from '../builtin' import constants from '../constants' +import { queryRoute } from '../utils/lightning' + const env = process.env.NODE_ENV || 'development'; console.log("=> env:",env) @@ -94,6 +96,7 @@ export async function set(app) { app.get('/getinfo', details.getInfo) app.get('/logs', details.getLogsSince) app.get('/info', details.getNodeInfo) + app.get('/route', details.checkRoute) app.post('/action', actions.processAction) app.get('/bots', bots.getBots) @@ -120,6 +123,10 @@ export async function set(app) { } }) + const pubkey = '03a9a8d953fe747d0dd94dd3c567ddc58451101e987e2d2bf7a4d1e10a2c89ff38' + const r = queryRoute(pubkey, constants.min_sat_amount) + console.log(JSON.stringify(r)) + } const msgtypes = constants.message_types diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index 19f7ef4..2924143 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -103,6 +103,19 @@ const getRoute = async (pub_key, amt, callback) => { ) } +const queryRoute = async (pub_key, amt) => { + return new Promise(async function(resolve, reject) { + let lightning = await loadLightning() + lightning.queryRoutes( + { pub_key, amt }, + (err, response) => { + if(err) reject(err) + else resolve(response) + } + ) + }) +} + const keysend = (opts) => { return new Promise(async function(resolve, reject) { let lightning = await loadLightning() @@ -406,4 +419,5 @@ export { getInfo, listAllInvoices, listAllPaymentsFull, + queryRoute, }