TLS config fix
This commit is contained in:
parent
a08f02572f
commit
65a9541673
@ -1,7 +1,13 @@
|
|||||||
|
const fs = require('fs')
|
||||||
|
const path = require('path')
|
||||||
// setup bitcoind rpc
|
// setup bitcoind rpc
|
||||||
const config = require('./config');
|
const config = require('./config');
|
||||||
let jayson = require('jayson/promise');
|
let jayson = require('jayson/promise');
|
||||||
let url = require('url');
|
let url = require('url');
|
||||||
let rpc = url.parse(config.bitcoind.rpc);
|
let rpc = url.parse(config.bitcoind.rpc);
|
||||||
rpc.timeout = 5000;
|
rpc.timeout = 5000;
|
||||||
module.exports = jayson.client.http(rpc);
|
rpc.rejectUnauthorized = false
|
||||||
|
rpc.ecdhCurve = 'auto'
|
||||||
|
const client = jayson.client.https(rpc)
|
||||||
|
module.exports = client;
|
||||||
|
|
||||||
|
10
config.js
10
config.js
@ -1,16 +1,16 @@
|
|||||||
let config = {
|
let config = {
|
||||||
bitcoind: {
|
bitcoind: {
|
||||||
rpc: 'http://login:password@1.1.1.1:8332',
|
rpc: 'https://kek:kek@127.0.0.1:18334',
|
||||||
},
|
},
|
||||||
redis: {
|
redis: {
|
||||||
port: 12914,
|
port: 6379,
|
||||||
host: '1.1.1.1',
|
host: '127.0.0.1',
|
||||||
family: 4,
|
family: 4,
|
||||||
password: 'password',
|
password: '',
|
||||||
db: 0,
|
db: 0,
|
||||||
},
|
},
|
||||||
lnd: {
|
lnd: {
|
||||||
url: '1.1.1.1:10009',
|
url: '127.0.0.1:10009',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -18,7 +18,8 @@ let lightning = require('../lightning');
|
|||||||
let identity_pubkey = false;
|
let identity_pubkey = false;
|
||||||
// ###################### SMOKE TESTS ########################
|
// ###################### SMOKE TESTS ########################
|
||||||
|
|
||||||
bitcoinclient.request('getblockchaininfo', false, function(err, info) {
|
bitcoinclient.request('getinfo', false, function(err, info) {
|
||||||
|
console.log(err)
|
||||||
if (info && info.result && info.result.blocks) {
|
if (info && info.result && info.result.blocks) {
|
||||||
if (info.result.blocks < 550000) {
|
if (info.result.blocks < 550000) {
|
||||||
console.error('bitcoind is not caught up');
|
console.error('bitcoind is not caught up');
|
||||||
@ -240,7 +241,7 @@ router.get('/balance', async function(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
|
if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
|
||||||
await u.accountForPosibleTxids();
|
u.accountForPosibleTxids();
|
||||||
let balance = await u.getBalance();
|
let balance = await u.getBalance();
|
||||||
res.send({ BTC: { AvailableBalance: balance } });
|
res.send({ BTC: { AvailableBalance: balance } });
|
||||||
});
|
});
|
||||||
@ -267,7 +268,7 @@ router.get('/gettxs', async function(req, res) {
|
|||||||
|
|
||||||
if (!(await u.getAddress())) await u.generateAddress(); // onchain addr needed further
|
if (!(await u.getAddress())) await u.generateAddress(); // onchain addr needed further
|
||||||
try {
|
try {
|
||||||
await u.accountForPosibleTxids();
|
u.accountForPosibleTxids();
|
||||||
let txs = await u.getTxs();
|
let txs = await u.getTxs();
|
||||||
res.send(txs);
|
res.send(txs);
|
||||||
} catch (Err) {
|
} catch (Err) {
|
||||||
@ -304,7 +305,7 @@ router.get('/getpending', async function(req, res) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
|
if (!(await u.getAddress())) await u.generateAddress(); // onchain address needed further
|
||||||
await u.accountForPosibleTxids();
|
u.accountForPosibleTxids();
|
||||||
let txs = await u.getPendingTxs();
|
let txs = await u.getPendingTxs();
|
||||||
res.send(txs);
|
res.send(txs);
|
||||||
});
|
});
|
||||||
|
44
package-lock.json
generated
44
package-lock.json
generated
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "LndHub",
|
"name": "LndHub",
|
||||||
"version": "1.0.0",
|
"version": "1.1.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@ -1196,6 +1196,7 @@
|
|||||||
"bech32": "^1.1.2",
|
"bech32": "^1.1.2",
|
||||||
"bitcoinjs-lib": "^3.3.1",
|
"bitcoinjs-lib": "^3.3.1",
|
||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
|
"coininfo": "git+https://github.com/cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2",
|
||||||
"lodash": "^4.17.4",
|
"lodash": "^4.17.4",
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.1.1",
|
||||||
"secp256k1": "^3.4.0"
|
"secp256k1": "^3.4.0"
|
||||||
@ -1486,6 +1487,13 @@
|
|||||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
||||||
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c="
|
||||||
},
|
},
|
||||||
|
"coininfo": {
|
||||||
|
"version": "git+https://github.com/cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2",
|
||||||
|
"from": "git+https://github.com/cryptocoinjs/coininfo.git#c7e003b2fc0db165b89e6f98f6d6360ad22616b2",
|
||||||
|
"requires": {
|
||||||
|
"safe-buffer": "^5.1.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"collection-visit": {
|
"collection-visit": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
|
||||||
@ -2368,13 +2376,11 @@
|
|||||||
},
|
},
|
||||||
"balanced-match": {
|
"balanced-match": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"brace-expansion": {
|
"brace-expansion": {
|
||||||
"version": "1.1.11",
|
"version": "1.1.11",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"balanced-match": "^1.0.0",
|
"balanced-match": "^1.0.0",
|
||||||
"concat-map": "0.0.1"
|
"concat-map": "0.0.1"
|
||||||
@ -2387,18 +2393,15 @@
|
|||||||
},
|
},
|
||||||
"code-point-at": {
|
"code-point-at": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"concat-map": {
|
"concat-map": {
|
||||||
"version": "0.0.1",
|
"version": "0.0.1",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"console-control-strings": {
|
"console-control-strings": {
|
||||||
"version": "1.1.0",
|
"version": "1.1.0",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"core-util-is": {
|
"core-util-is": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
@ -2501,8 +2504,7 @@
|
|||||||
},
|
},
|
||||||
"inherits": {
|
"inherits": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"ini": {
|
"ini": {
|
||||||
"version": "1.3.5",
|
"version": "1.3.5",
|
||||||
@ -2512,7 +2514,6 @@
|
|||||||
"is-fullwidth-code-point": {
|
"is-fullwidth-code-point": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"number-is-nan": "^1.0.0"
|
"number-is-nan": "^1.0.0"
|
||||||
}
|
}
|
||||||
@ -2525,20 +2526,17 @@
|
|||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.0.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimist": {
|
"minimist": {
|
||||||
"version": "0.0.8",
|
"version": "0.0.8",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"minipass": {
|
"minipass": {
|
||||||
"version": "2.2.4",
|
"version": "2.2.4",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"safe-buffer": "^5.1.1",
|
"safe-buffer": "^5.1.1",
|
||||||
"yallist": "^3.0.0"
|
"yallist": "^3.0.0"
|
||||||
@ -2555,7 +2553,6 @@
|
|||||||
"mkdirp": {
|
"mkdirp": {
|
||||||
"version": "0.5.1",
|
"version": "0.5.1",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "0.0.8"
|
"minimist": "0.0.8"
|
||||||
}
|
}
|
||||||
@ -2628,8 +2625,7 @@
|
|||||||
},
|
},
|
||||||
"number-is-nan": {
|
"number-is-nan": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"bundled": true,
|
"bundled": true
|
||||||
"optional": true
|
|
||||||
},
|
},
|
||||||
"object-assign": {
|
"object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
@ -2639,7 +2635,6 @@
|
|||||||
"once": {
|
"once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"wrappy": "1"
|
"wrappy": "1"
|
||||||
}
|
}
|
||||||
@ -2745,7 +2740,6 @@
|
|||||||
"string-width": {
|
"string-width": {
|
||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"bundled": true,
|
"bundled": true,
|
||||||
"optional": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"code-point-at": "^1.0.0",
|
"code-point-at": "^1.0.0",
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
"is-fullwidth-code-point": "^1.0.0",
|
||||||
@ -2874,9 +2868,9 @@
|
|||||||
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA=="
|
||||||
},
|
},
|
||||||
"grpc": {
|
"grpc": {
|
||||||
"version": "1.17.0-pre1",
|
"version": "1.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/grpc/-/grpc-1.17.0-pre1.tgz",
|
"resolved": "https://registry.npmjs.org/grpc/-/grpc-1.19.0.tgz",
|
||||||
"integrity": "sha512-LWoGYW+ylOo2Ldvq/1i/SEwDsIxmDEJK9KoHPHEQkkwdG5zC+9D3/wJsgf/JFvpUoHrPdzLfBUqxfzRVCR90jw==",
|
"integrity": "sha512-xX+jZ1M3YXjngsRj/gTxB4EwM0WoWUr54DmyNq9xTeg1oSuVaTPD/PK9wnZKOJWTt1pkeFspXqwJPhddZNxHOA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash.camelcase": "^4.3.0",
|
"lodash.camelcase": "^4.3.0",
|
||||||
"lodash.clone": "^4.5.0",
|
"lodash.clone": "^4.5.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user