Compare commits
53 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4e7731ff54 | ||
|
|
1c8232d1ec | ||
|
|
fd6caf859c | ||
|
|
df6412a525 | ||
|
|
c46c1385c6 | ||
|
|
dd5d96aa56 | ||
|
|
d6d563039e | ||
|
|
f5eb5d0c78 | ||
|
|
9d17ceb23f | ||
|
|
d0406afd31 | ||
|
|
6411e9bd28 | ||
|
|
db218ef440 | ||
|
|
735b65dc0f | ||
|
|
c73d762028 | ||
|
|
4f3dff6022 | ||
|
|
a792432700 | ||
|
|
590bccd4c0 | ||
|
|
d90881771c | ||
|
|
d9d75a0b29 | ||
|
|
34ffd59c1b | ||
|
|
7dce6b848e | ||
|
|
0d337bdc7b | ||
|
|
f0bf066cfd | ||
|
|
f0ad86f1b9 | ||
|
|
12d1e9560f | ||
|
|
1eaf6c5a47 | ||
|
|
dfcaac2cfa | ||
|
|
f11c02d2f2 | ||
|
|
a4eedde3fb | ||
|
|
597615209b | ||
|
|
5fc7b074f9 | ||
|
|
df9b9a71d9 | ||
|
|
ede2359e8a | ||
|
|
b9a55f01d7 | ||
|
|
1c4eb6d83a | ||
|
|
d4c2771f4a | ||
|
|
f64a8c8102 | ||
|
|
170bf0d120 | ||
|
|
049ae5de5c | ||
|
|
877d7762ff | ||
|
|
e0a0eed038 | ||
|
|
26692d6c92 | ||
|
|
68fd866894 | ||
|
|
d7216e1506 | ||
|
|
30c8bb2d94 | ||
|
|
17e9bd30c8 | ||
|
|
d47f03501d | ||
|
|
3d1abda05b | ||
|
|
de64f1c55a | ||
|
|
bcf87de2b4 | ||
|
|
ad1b1d3da4 | ||
|
|
a6f354600c | ||
|
|
647632c914 |
9
.github/workflows/push.yml
vendored
9
.github/workflows/push.yml
vendored
@@ -12,12 +12,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build image
|
name: Build image
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project
|
- name: Checkout project
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -49,6 +44,6 @@ jobs:
|
|||||||
docker buildx build \
|
docker buildx build \
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform ${{matrix.platform}} \
|
--platform linux/arm64,linux/amd64 \
|
||||||
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:$BRANCH \
|
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:$BRANCH \
|
||||||
--output "type=registry" ./
|
--output "type=registry" ./
|
||||||
11
.github/workflows/tag.yml
vendored
11
.github/workflows/tag.yml
vendored
@@ -13,12 +13,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: Build image
|
name: Build image
|
||||||
runs-on: ubuntu-20.04
|
runs-on: ubuntu-20.04
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
platform:
|
|
||||||
- linux/amd64
|
|
||||||
- linux/arm64
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout project
|
- name: Checkout project
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@@ -49,7 +44,7 @@ jobs:
|
|||||||
docker buildx build \
|
docker buildx build \
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform ${{matrix.platform}} \
|
--platform linux/arm64,linux/amd64 \
|
||||||
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:$TAG \
|
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:$TAG \
|
||||||
--output "type=registry" ./
|
--output "type=registry" ./
|
||||||
- name: Run Docker buildx
|
- name: Run Docker buildx
|
||||||
@@ -57,6 +52,6 @@ jobs:
|
|||||||
docker buildx build \
|
docker buildx build \
|
||||||
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
--cache-from "type=local,src=/tmp/.buildx-cache" \
|
||||||
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
--cache-to "type=local,dest=/tmp/.buildx-cache" \
|
||||||
--platform ${{matrix.platform}} \
|
--platform linux/arm64,linux/amd64 \
|
||||||
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:latest \
|
--tag ${{ secrets.DOCKER_CONTAINER_USERNAME }}/lndhub:latest \
|
||||||
--output "type=registry" ./
|
--output "type=registry" ./
|
||||||
|
|||||||
@@ -23,6 +23,9 @@ Copy `admin.macaroon` and `tls.cert` in root folder of LndHub.
|
|||||||
`bitcoind` should run with `-deprecatedrpc=accounts`, for now. Lndhub expects Lnd's wallet to be unlocked, if not - it will attempt to unlock it with password stored in `config.lnd.password`.
|
`bitcoind` should run with `-deprecatedrpc=accounts`, for now. Lndhub expects Lnd's wallet to be unlocked, if not - it will attempt to unlock it with password stored in `config.lnd.password`.
|
||||||
Don't forget to enable disk-persistance for `redis`.
|
Don't forget to enable disk-persistance for `redis`.
|
||||||
|
|
||||||
|
If you have no `bitcoind` instance, for example if you use neutrino, or you have no bitcoind wallet,
|
||||||
|
for example if you use LND for wallet managment, you can remove the bitcoind settings from `config.js`.
|
||||||
|
Please not that this feature is limited to Bitcoin, so you can't use this feature if you use any other cryptocurrency with LND.
|
||||||
|
|
||||||
### Deploy to Heroku
|
### Deploy to Heroku
|
||||||
|
|
||||||
@@ -31,6 +34,12 @@ Add config vars :
|
|||||||
* `MACAROON`: hex-encoded `admin.macaroon`
|
* `MACAROON`: hex-encoded `admin.macaroon`
|
||||||
* `TLSCERT`: hex-encoded `tls.cert`
|
* `TLSCERT`: hex-encoded `tls.cert`
|
||||||
|
|
||||||
|
### Run in docker
|
||||||
|
|
||||||
|
LndHub is available on Docker Hub as [`bluewalletorganization/lndhub`](https://hub.docker.com/r/bluewalletorganization/lndhub).
|
||||||
|
Please note that this requires a separate instance of redis and LND and optionally, bitcoind.
|
||||||
|
You can also view Umbrel's implementation using docker-compose [here](https://github.com/getumbrel/umbrel/blob/280c87f0f323666b1b0552aeb24f60df94d1e43c/apps/lndhub/docker-compose.yml).
|
||||||
|
|
||||||
### Reference client implementation
|
### Reference client implementation
|
||||||
|
|
||||||
Can be used in ReactNative or Nodejs environment
|
Can be used in ReactNative or Nodejs environment
|
||||||
|
|||||||
@@ -412,7 +412,7 @@ export class User {
|
|||||||
amount: tx.amount,
|
amount: tx.amount,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
address: tx.address,
|
address: tx.address,
|
||||||
time: tx.time,
|
time: tx.blocktime || tx.time,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
let config = {
|
let config = {
|
||||||
|
enableUpdateDescribeGraph: false,
|
||||||
|
postRateLimit: 100,
|
||||||
|
rateLimit: 200,
|
||||||
bitcoind: {
|
bitcoind: {
|
||||||
rpc: 'http://login:password@1.1.1.1:8332/wallet/wallet.dat',
|
rpc: 'http://login:password@1.1.1.1:8332/wallet/wallet.dat',
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ if (config.bitcoind) {
|
|||||||
console.error('bitcoind is not caught up');
|
console.error('bitcoind is not caught up');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
console.log('bitcoind getblockchaininfo:', info);
|
||||||
} else {
|
} else {
|
||||||
console.error('bitcoind failure:', err, info);
|
console.error('bitcoind failure:', err, info);
|
||||||
process.exit(2);
|
process.exit(2);
|
||||||
@@ -41,7 +42,7 @@ lightning.getInfo({}, function (err, info) {
|
|||||||
process.exit(3);
|
process.exit(3);
|
||||||
}
|
}
|
||||||
if (info) {
|
if (info) {
|
||||||
console.info(info);
|
console.info('lnd getinfo:', info);
|
||||||
if (!info.synced_to_chain && !config.forceStart) {
|
if (!info.synced_to_chain && !config.forceStart) {
|
||||||
console.error('lnd not synced');
|
console.error('lnd not synced');
|
||||||
// process.exit(4);
|
// process.exit(4);
|
||||||
@@ -109,12 +110,25 @@ subscribeInvoicesCall.on('end', function () {
|
|||||||
// The server has closed the stream.
|
// The server has closed the stream.
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let lightningDescribeGraph = {};
|
||||||
|
function updateDescribeGraph() {
|
||||||
|
console.log('updateDescribeGraph()');
|
||||||
|
lightning.describeGraph({ include_unannounced: true }, function (err, response) {
|
||||||
|
if (!err) lightningDescribeGraph = response;
|
||||||
|
console.log('updated graph');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (config.enableUpdateDescribeGraph) {
|
||||||
|
updateDescribeGraph();
|
||||||
|
setInterval(updateDescribeGraph, 120000);
|
||||||
|
}
|
||||||
|
|
||||||
// ######################## ROUTES ########################
|
// ######################## ROUTES ########################
|
||||||
|
|
||||||
const rateLimit = require('express-rate-limit');
|
const rateLimit = require('express-rate-limit');
|
||||||
const postLimiter = rateLimit({
|
const postLimiter = rateLimit({
|
||||||
windowMs: 30 * 60 * 1000,
|
windowMs: 30 * 60 * 1000,
|
||||||
max: 100,
|
max: config.postRateLimit || 100,
|
||||||
});
|
});
|
||||||
|
|
||||||
router.post('/create', postLimiter, async function (req, res) {
|
router.post('/create', postLimiter, async function (req, res) {
|
||||||
@@ -489,6 +503,19 @@ router.get('/queryroutes/:source/:dest/:amt', async function (req, res) {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get('/getchaninfo/:chanid', async function (req, res) {
|
||||||
|
logger.log('/getchaninfo', [req.id]);
|
||||||
|
|
||||||
|
if (lightningDescribeGraph && lightningDescribeGraph.edges) {
|
||||||
|
for (const edge of lightningDescribeGraph.edges) {
|
||||||
|
if (edge.channel_id == req.params.chanid) {
|
||||||
|
return res.send(JSON.stringify(edge, null, 2));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
res.send('');
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = router;
|
module.exports = router;
|
||||||
|
|
||||||
// ################# HELPERS ###########################
|
// ################# HELPERS ###########################
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ function updateLightning() {
|
|||||||
lightning.getInfo({}, function (err, info) {
|
lightning.getInfo({}, function (err, info) {
|
||||||
if (err) {
|
if (err) {
|
||||||
console.error('lnd failure:', err);
|
console.error('lnd failure:', err);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
lightningGetInfo = info;
|
lightningGetInfo = info;
|
||||||
});
|
});
|
||||||
@@ -23,6 +24,7 @@ function updateLightning() {
|
|||||||
console.error('lnd failure:', err);
|
console.error('lnd failure:', err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log('updated');
|
||||||
lightningListChannels = response;
|
lightningListChannels = response;
|
||||||
let channels = [];
|
let channels = [];
|
||||||
let max_chan_capacity = -1;
|
let max_chan_capacity = -1;
|
||||||
@@ -47,7 +49,6 @@ function updateLightning() {
|
|||||||
} catch (Err) {
|
} catch (Err) {
|
||||||
console.log(Err);
|
console.log(Err);
|
||||||
}
|
}
|
||||||
console.log('updated');
|
|
||||||
}
|
}
|
||||||
updateLightning();
|
updateLightning();
|
||||||
setInterval(updateLightning, 60000);
|
setInterval(updateLightning, 60000);
|
||||||
@@ -69,6 +70,7 @@ const pubkey2name = {
|
|||||||
'026c7d28784791a4b31a64eb34d9ab01552055b795919165e6ae886de637632efb': 'LivingRoomOfSatoshi',
|
'026c7d28784791a4b31a64eb34d9ab01552055b795919165e6ae886de637632efb': 'LivingRoomOfSatoshi',
|
||||||
'02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774': 'ln.pizza',
|
'02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774': 'ln.pizza',
|
||||||
'0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3': 'bitrefill thor',
|
'0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3': 'bitrefill thor',
|
||||||
|
'03d607f3e69fd032524a867b288216bfab263b6eaee4e07783799a6fe69bb84fac': 'bitrefill 3',
|
||||||
'02a0bc43557fae6af7be8e3a29fdebda819e439bea9c0f8eb8ed6a0201f3471ca9': 'LightningPeachHub',
|
'02a0bc43557fae6af7be8e3a29fdebda819e439bea9c0f8eb8ed6a0201f3471ca9': 'LightningPeachHub',
|
||||||
'02d4531a2f2e6e5a9033d37d548cff4834a3898e74c3abe1985b493c42ebbd707d': 'coinfinity.co',
|
'02d4531a2f2e6e5a9033d37d548cff4834a3898e74c3abe1985b493c42ebbd707d': 'coinfinity.co',
|
||||||
'02d23fa6794d8fd056c757f3c8f4877782138dafffedc831fc570cab572620dc61': 'paywithmoon.com',
|
'02d23fa6794d8fd056c757f3c8f4877782138dafffedc831fc570cab572620dc61': 'paywithmoon.com',
|
||||||
|
|||||||
@@ -512,25 +512,3 @@ Oauth2 process consists of such stages as:
|
|||||||
- Token service checks user id and secret and sends token data with refresh token to Authorization service which sends it to Client
|
- Token service checks user id and secret and sends token data with refresh token to Authorization service which sends it to Client
|
||||||
- Client uses token to access protected resources (GET ?access_token=XXXXXXXXXXXXXX)
|
- Client uses token to access protected resources (GET ?access_token=XXXXXXXXXXXXXX)
|
||||||
- When token expires or needs to refresh token for security issues Client sends refresh_token to Token service (POST /auth?type=refresh_token), which sends new token data with refresh_token and disables to access old
|
- When token expires or needs to refresh token for security issues Client sends refresh_token to Token service (POST /auth?type=refresh_token), which sends new token data with refresh_token and disables to access old
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
Добавил POST метод /addinvoice для того, чтобы пользователь мог создать свой инвойс
|
|
||||||
в боди передаются параметы:
|
|
||||||
{
|
|
||||||
"amt": "string" обязательный
|
|
||||||
"memo":"string" не обязательный
|
|
||||||
"receipt":"string" не обязательный
|
|
||||||
"preimage": "string" не обязательный
|
|
||||||
"fallbackAddr": "string" не обязательны
|
|
||||||
"expiry": "string" не обязательны
|
|
||||||
"private": "string" не обязательны
|
|
||||||
}
|
|
||||||
|
|
||||||
информация по инвойсам, которые оплатили пользователям досутпна через метод GET /getuserinvoices , полученные коины учитываются в балансе (settled в unconfirmed balance, остальной в confirmed balance)
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ User storage schema
|
|||||||
* metadata_for_{userid}= {serialized json}
|
* metadata_for_{userid}= {serialized json}
|
||||||
* userinvoices_for_{userid} = []
|
* userinvoices_for_{userid} = []
|
||||||
* payment_hash_{payment_hash} = {userid}
|
* payment_hash_{payment_hash} = {userid}
|
||||||
* ispaid_{payment_hash} = 1
|
* ispaid_{payment_hash} = {settleAmountSat}
|
||||||
|
|
||||||
|
|
||||||
####cleanup test user
|
####cleanup test user
|
||||||
@@ -36,4 +36,5 @@ User storage schema
|
|||||||
* del locked_payments_for_666
|
* del locked_payments_for_666
|
||||||
* del txs_for_666
|
* del txs_for_666
|
||||||
* del invoice_paying_for_666
|
* del invoice_paying_for_666
|
||||||
* del userinvoices_for_666
|
* del userinvoices_for_666
|
||||||
|
* del balance_for_666
|
||||||
7
index.js
7
index.js
@@ -5,9 +5,11 @@ process.on('uncaughtException', function (err) {
|
|||||||
|
|
||||||
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
|
||||||
let express = require('express');
|
let express = require('express');
|
||||||
|
const helmet = require('helmet');
|
||||||
let morgan = require('morgan');
|
let morgan = require('morgan');
|
||||||
import { v4 as uuidv4 } from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
let logger = require('./utils/logger');
|
let logger = require('./utils/logger');
|
||||||
|
const config = require('./config');
|
||||||
|
|
||||||
morgan.token('id', function getId(req) {
|
morgan.token('id', function getId(req) {
|
||||||
return req.id;
|
return req.id;
|
||||||
@@ -15,11 +17,13 @@ morgan.token('id', function getId(req) {
|
|||||||
|
|
||||||
let app = express();
|
let app = express();
|
||||||
app.enable('trust proxy');
|
app.enable('trust proxy');
|
||||||
|
app.use(helmet.hsts());
|
||||||
|
app.use(helmet.hidePoweredBy());
|
||||||
|
|
||||||
const rateLimit = require('express-rate-limit');
|
const rateLimit = require('express-rate-limit');
|
||||||
const limiter = rateLimit({
|
const limiter = rateLimit({
|
||||||
windowMs: 15 * 60 * 1000,
|
windowMs: 15 * 60 * 1000,
|
||||||
max: 200,
|
max: config.rateLimit || 200,
|
||||||
});
|
});
|
||||||
app.use(limiter);
|
app.use(limiter);
|
||||||
|
|
||||||
@@ -35,7 +39,6 @@ app.use(
|
|||||||
);
|
);
|
||||||
|
|
||||||
let bodyParser = require('body-parser');
|
let bodyParser = require('body-parser');
|
||||||
let config = require('./config');
|
|
||||||
|
|
||||||
app.use(bodyParser.urlencoded({ extended: false })); // parse application/x-www-form-urlencoded
|
app.use(bodyParser.urlencoded({ extended: false })); // parse application/x-www-form-urlencoded
|
||||||
app.use(bodyParser.json(null)); // parse application/json
|
app.use(bodyParser.json(null)); // parse application/json
|
||||||
|
|||||||
9013
package-lock.json
generated
9013
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
33
package.json
33
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lndhub",
|
"name": "lndhub",
|
||||||
"version": "1.3.0",
|
"version": "1.3.5",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -12,29 +12,30 @@
|
|||||||
"author": "Igor Korsakov <overtorment@gmail.com>",
|
"author": "Igor Korsakov <overtorment@gmail.com>",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/cli": "^7.13.0",
|
"@babel/cli": "^7.14.3",
|
||||||
"@babel/core": "^7.13.1",
|
"@babel/core": "^7.14.3",
|
||||||
"@babel/eslint-parser": "^7.13.4",
|
"@babel/eslint-parser": "^7.14.2",
|
||||||
"@babel/node": "^7.13.0",
|
"@babel/node": "^7.13.0",
|
||||||
"@babel/preset-env": "^7.13.5",
|
"@babel/preset-env": "^7.14.1",
|
||||||
"@babel/register": "^7.13.0",
|
"@babel/register": "^7.13.16",
|
||||||
"@grpc/grpc-js": "^1.2.8",
|
"@grpc/grpc-js": "^1.3.2",
|
||||||
"@grpc/proto-loader": "^0.5.6",
|
"@grpc/proto-loader": "^0.6.2",
|
||||||
"bignumber.js": "^9.0.1",
|
"bignumber.js": "^9.0.1",
|
||||||
"bitcoinjs-lib": "^5.2.0",
|
"bitcoinjs-lib": "^5.2.0",
|
||||||
"bolt11": "^1.2.7",
|
"bolt11": "^1.3.1",
|
||||||
"core-js": "^3.9.0",
|
"core-js": "^3.13.0",
|
||||||
"eslint": "^7.20.0",
|
"eslint": "^7.24.0",
|
||||||
"eslint-config-prettier": "^8.0.0",
|
"eslint-config-prettier": "^8.3.0",
|
||||||
"eslint-plugin-prettier": "^3.3.1",
|
"eslint-plugin-prettier": "^3.4.0",
|
||||||
"express": "^4.17.1",
|
"express": "^4.17.1",
|
||||||
"express-rate-limit": "^5.2.6",
|
"express-rate-limit": "^5.2.6",
|
||||||
"frisbee": "^3.1.4",
|
"frisbee": "^3.1.4",
|
||||||
"ioredis": "^4.22.0",
|
"helmet": "^4.6.0",
|
||||||
"jayson": "^3.4.4",
|
"ioredis": "^4.27.2",
|
||||||
|
"jayson": "^3.6.3",
|
||||||
"morgan": "^1.10.0",
|
"morgan": "^1.10.0",
|
||||||
"mustache": "^4.1.0",
|
"mustache": "^4.1.0",
|
||||||
"prettier": "^2.2.1",
|
"prettier": "^2.3.0",
|
||||||
"qr-image": "3.2.0",
|
"qr-image": "3.2.0",
|
||||||
"request": "^2.88.2",
|
"request": "^2.88.2",
|
||||||
"request-promise": "^4.2.6",
|
"request-promise": "^4.2.6",
|
||||||
|
|||||||
@@ -9,18 +9,23 @@ const important_channels = {
|
|||||||
uri: '03abf6f44c355dec0d5aa155bdbdd6e0c8fefe318eff402de65c6eb2e1be55dc3e@18.221.23.28:9735',
|
uri: '03abf6f44c355dec0d5aa155bdbdd6e0c8fefe318eff402de65c6eb2e1be55dc3e@18.221.23.28:9735',
|
||||||
wumbo: 1,
|
wumbo: 1,
|
||||||
},
|
},
|
||||||
'0242a4ae0c5bef18048fbecf995094b74bfb0f7391418d71ed394784373f41e4f3': {
|
// '0242a4ae0c5bef18048fbecf995094b74bfb0f7391418d71ed394784373f41e4f3': {
|
||||||
name: 'coingate.com',
|
// name: 'coingate.com',
|
||||||
uri: '0242a4ae0c5bef18048fbecf995094b74bfb0f7391418d71ed394784373f41e4f3@3.124.63.44:9735',
|
// uri: '0242a4ae0c5bef18048fbecf995094b74bfb0f7391418d71ed394784373f41e4f3@3.124.63.44:9735',
|
||||||
},
|
// },
|
||||||
// '0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3': {
|
// '0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3': {
|
||||||
// name: 'bitrefill thor',
|
// name: 'bitrefill thor',
|
||||||
// uri: '0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3@52.30.63.2:9735',
|
// uri: '0254ff808f53b2f8c45e74b70430f336c6c76ba2f4af289f48d6086ae6e60462d3@52.30.63.2:9735',
|
||||||
// wumbo: 1,
|
// wumbo: 1,
|
||||||
// },
|
// },
|
||||||
'030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f': {
|
// '030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f': {
|
||||||
name: 'bitrefill 2',
|
// name: 'bitrefill 2',
|
||||||
uri: '030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f@52.50.244.44:9735',
|
// uri: '030c3f19d742ca294a55c00376b3b355c3c90d61c6b6b39554dbc7ac19b141c14f@52.50.244.44:9735',
|
||||||
|
// wumbo: 1,
|
||||||
|
// },
|
||||||
|
'03d607f3e69fd032524a867b288216bfab263b6eaee4e07783799a6fe69bb84fac': {
|
||||||
|
name: 'bitrefill 3',
|
||||||
|
uri: '03d607f3e69fd032524a867b288216bfab263b6eaee4e07783799a6fe69bb84fac@3.237.23.179:9735',
|
||||||
wumbo: 1,
|
wumbo: 1,
|
||||||
},
|
},
|
||||||
// '025f1456582e70c4c06b61d5c8ed3ce229e6d0db538be337a2dc6d163b0ebc05a5': {
|
// '025f1456582e70c4c06b61d5c8ed3ce229e6d0db538be337a2dc6d163b0ebc05a5': {
|
||||||
@@ -40,6 +45,11 @@ const important_channels = {
|
|||||||
uri: '02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774@35.238.153.25:9735',
|
uri: '02816caed43171d3c9854e3b0ab2cf0c42be086ff1bd4005acc2a5f7db70d83774@35.238.153.25:9735',
|
||||||
wumbo: 1,
|
wumbo: 1,
|
||||||
},
|
},
|
||||||
|
'036b53093df5a932deac828cca6d663472dbc88322b05eec1d42b26ab9b16caa1c': {
|
||||||
|
name: 'okcoin',
|
||||||
|
uri: '036b53093df5a932deac828cca6d663472dbc88322b05eec1d42b26ab9b16caa1c@47.243.25.4:26658',
|
||||||
|
wumbo: 1,
|
||||||
|
},
|
||||||
// '0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c': {
|
// '0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c': {
|
||||||
// name: 'LightningPowerUsers.com',
|
// name: 'LightningPowerUsers.com',
|
||||||
// uri: '0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c@34.200.181.109:9735',
|
// uri: '0331f80652fb840239df8dc99205792bba2e559a05469915804c08420230e23c7c@34.200.181.109:9735',
|
||||||
@@ -52,10 +62,10 @@ const important_channels = {
|
|||||||
// name: 'fixedfloat.com',
|
// name: 'fixedfloat.com',
|
||||||
// uri: '037f990e61acee8a7697966afd29dd88f3b1f8a7b14d625c4f8742bd952003a590@185.5.53.91:9735',
|
// uri: '037f990e61acee8a7697966afd29dd88f3b1f8a7b14d625c4f8742bd952003a590@185.5.53.91:9735',
|
||||||
// },
|
// },
|
||||||
'03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda': {
|
// '03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda': {
|
||||||
name: 'tippin.me',
|
// name: 'tippin.me',
|
||||||
uri: '03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda@157.245.68.47:9735',
|
// uri: '03c2abfa93eacec04721c019644584424aab2ba4dff3ac9bdab4e9c97007491dda@157.245.68.47:9735',
|
||||||
},
|
// },
|
||||||
};
|
};
|
||||||
|
|
||||||
let lightning = require('../lightning');
|
let lightning = require('../lightning');
|
||||||
@@ -143,7 +153,7 @@ lightning.listChannels({}, function (err, response) {
|
|||||||
'--connect',
|
'--connect',
|
||||||
important_channels[important].uri.split('@')[1],
|
important_channels[important].uri.split('@')[1],
|
||||||
'--local_amt',
|
'--local_amt',
|
||||||
important_channels[important].wumbo ? '50000000' : '16777215',
|
important_channels[important].wumbo ? '100000000' : '16777215',
|
||||||
'--remote_csv_delay 144',
|
'--remote_csv_delay 144',
|
||||||
'--sat_per_byte 10',
|
'--sat_per_byte 10',
|
||||||
'#',
|
'#',
|
||||||
|
|||||||
25
scripts/migrate_addresses_to_other_bitcoind.sh
Normal file
25
scripts/migrate_addresses_to_other_bitcoind.sh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
# this script should be used if youre retiring one bitcoind in favor of new one
|
||||||
|
# it exports all addresses from the old one and prepares script to import them on a new node
|
||||||
|
#
|
||||||
|
echo export 1...
|
||||||
|
./bitcoin-0.21.0/bin/bitcoin-cli -rpcwallet="" -rpcconnect=1.1.1.1 -rpcuser=user -rpcpassword=oldPassword listreceivedbyaddress 0 true true > addresses.txt
|
||||||
|
echo export 2...
|
||||||
|
./bitcoin-0.21.0/bin/bitcoin-cli -rpcwallet="wallet.dat" -rpcconnect=1.1.1.1 -rpcuser=user -rpcpassword=oldPassword listreceivedbyaddress 0 true true >> addresses.txt
|
||||||
|
|
||||||
|
echo clean...
|
||||||
|
cat addresses.txt | grep address | sort -u | awk '{print $2}' | sed 's/"//g' | sed 's/,//g' > addresses_clean.txt
|
||||||
|
|
||||||
|
echo "got addresses:"
|
||||||
|
wc -l < addresses_clean.txt
|
||||||
|
|
||||||
|
|
||||||
|
echo writing import_on_other_node.sh ...
|
||||||
|
>import_on_other_node.sh
|
||||||
|
chmod +x import_on_other_node.sh
|
||||||
|
|
||||||
|
while read in; do
|
||||||
|
echo "./bitcoin-0.21.0/bin/bitcoin-cli -rpcconnect=2.2.2.2 -rpcuser=user -rpcpassword=newPassword importaddress $in $in false" >> import_on_other_node.sh
|
||||||
|
done < addresses_clean.txt
|
||||||
|
|
||||||
|
echo 'done. dont forget to run ./import_on_other_node.sh and then ./bitcoin-0.21.0/bin/bitcoin-cli -rpcconnect=2.2.2.2 -rpcwallet="wallet.dat" -rpcuser=user -rpcpassword=newPassword rescanblockchain 459491'
|
||||||
|
|
||||||
@@ -112,8 +112,10 @@ body {
|
|||||||
appearance: none;
|
appearance: none;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
max-width : 100%;
|
max-width: 100%;
|
||||||
-webkit-appearance: none;
|
-webkit-appearance: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
#progressbar[max]::-webkit-progress-value {
|
#progressbar[max]::-webkit-progress-value {
|
||||||
border-radius: 8px 4px 4px 8px;
|
border-radius: 8px 4px 4px 8px;
|
||||||
|
|||||||
Reference in New Issue
Block a user