ln-service 54.4.0 → 54.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -1
- package/README.md +20 -0
- package/package.json +5 -5
- package/test/tower_clientrpc-integration/test_connect_watchtower.js +39 -0
- package/test/tower_clientrpc-integration/test_get_connected_watchtowers.js +49 -0
- package/test/extra-integration/tower_clientrpc-integration/test_connect_watchtower.js +0 -43
- package/test/extra-integration/tower_clientrpc-integration/test_get_connected_watchtowers.js +0 -55
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
-
## 54.
|
|
3
|
+
## 54.5.0
|
|
4
|
+
|
|
5
|
+
- `getFailedPayments`, `getInvoices`, `getPayments`, `getPendingPayments`: add
|
|
6
|
+
support for date based filtering with `created_after` and `created_before`
|
|
7
|
+
arguments
|
|
8
|
+
|
|
9
|
+
## 54.4.1
|
|
4
10
|
|
|
5
11
|
- `subscribeToRpcRequests`: `open_channel_request` add support for
|
|
6
12
|
`fee_rate`, `base_fee_mtokens`
|
package/README.md
CHANGED
|
@@ -1832,7 +1832,12 @@ Get failed payments made through channels.
|
|
|
1832
1832
|
|
|
1833
1833
|
Requires `offchain:read` permission
|
|
1834
1834
|
|
|
1835
|
+
`created_after` is not supported on LND 0.15.5 and below
|
|
1836
|
+
`created_before` is not supported on LND 0.15.5 and below
|
|
1837
|
+
|
|
1835
1838
|
{
|
|
1839
|
+
[created_after]: <Creation Date After or Equal to ISO 8601 Date String>
|
|
1840
|
+
[created_before]: <Creation Date Before or Equal to ISO 8601 Date String>
|
|
1836
1841
|
[limit]: <Page Result Limit Number>
|
|
1837
1842
|
lnd: <Authenticated LND API Object>
|
|
1838
1843
|
[token]: <Opaque Paging Token String>
|
|
@@ -2176,7 +2181,12 @@ Requires `invoices:read` permission
|
|
|
2176
2181
|
|
|
2177
2182
|
Invoice `payment` is not supported on LND 0.11.1 and below
|
|
2178
2183
|
|
|
2184
|
+
`created_after` is not supported on LND 0.15.5 and below
|
|
2185
|
+
`created_before` is not supported on LND 0.15.5 and below
|
|
2186
|
+
|
|
2179
2187
|
{
|
|
2188
|
+
[created_after]: <Creation Date After or Equal to ISO 8601 Date String>
|
|
2189
|
+
[created_before]: <Creation Date Before or Equal to ISO 8601 Date String>
|
|
2180
2190
|
[is_unconfirmed]: <Omit Canceled and Settled Invoices Bool>
|
|
2181
2191
|
[limit]: <Page Result Limit Number>
|
|
2182
2192
|
lnd: <Authenticated LND API Object>
|
|
@@ -2631,7 +2641,12 @@ Get payments made through channels.
|
|
|
2631
2641
|
|
|
2632
2642
|
Requires `offchain:read` permission
|
|
2633
2643
|
|
|
2644
|
+
`created_after` is not supported on LND 0.15.5 and below
|
|
2645
|
+
`created_before` is not supported on LND 0.15.5 and below
|
|
2646
|
+
|
|
2634
2647
|
{
|
|
2648
|
+
[created_after]: <Creation Date After or Equal to ISO 8601 Date String>
|
|
2649
|
+
[created_before]: <Creation Date Before or Equal to ISO 8601 Date String>
|
|
2635
2650
|
[limit]: <Page Result Limit Number>
|
|
2636
2651
|
lnd: <Authenticated LND API Object>
|
|
2637
2652
|
[token]: <Opaque Paging Token String>
|
|
@@ -2848,7 +2863,12 @@ Get pending payments made through channels.
|
|
|
2848
2863
|
|
|
2849
2864
|
Requires `offchain:read` permission
|
|
2850
2865
|
|
|
2866
|
+
`created_after` is not supported on LND 0.15.5 and below
|
|
2867
|
+
`created_before` is not supported on LND 0.15.5 and below
|
|
2868
|
+
|
|
2851
2869
|
{
|
|
2870
|
+
[created_after]: <Creation Date After or Equal to ISO 8601 Date String>
|
|
2871
|
+
[created_before]: <Creation Date Before or Equal to ISO 8601 Date String>
|
|
2852
2872
|
[limit]: <Page Result Limit Number>
|
|
2853
2873
|
lnd: <Authenticated LND API Object>
|
|
2854
2874
|
[token]: <Opaque Paging Token String>
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"cors": "2.8.5",
|
|
12
12
|
"express": "4.18.2",
|
|
13
13
|
"invoices": "2.2.2",
|
|
14
|
-
"lightning": "6.
|
|
14
|
+
"lightning": "6.5.0",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
17
|
"ws": "8.11.0"
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"asyncjs-util": "1.2.10",
|
|
25
25
|
"bip32": "3.1.0",
|
|
26
26
|
"bip66": "1.1.5",
|
|
27
|
-
"bitcoinjs-lib": "6.0
|
|
27
|
+
"bitcoinjs-lib": "6.1.0",
|
|
28
28
|
"bn.js": "5.2.1",
|
|
29
29
|
"bs58check": "2.1.2",
|
|
30
30
|
"ecpair": "2.1.0",
|
|
31
|
-
"ln-docker-daemons": "4.0.
|
|
31
|
+
"ln-docker-daemons": "4.0.1",
|
|
32
32
|
"p2tr": "1.3.2",
|
|
33
33
|
"portfinder": "1.0.32",
|
|
34
34
|
"psbt": "2.7.1",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"integration-test-0.15.2": "DOCKER_LND_VERSION=v0.15.2-beta npm run test",
|
|
63
63
|
"integration-test-0.14.5": "DOCKER_LND_VERSION=v0.14.5-beta npm run test",
|
|
64
64
|
"integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
|
|
65
|
-
"test": "echo $DOCKER_LND_VERSION && tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 200 test/autopilotrpc-integration/*.js test/chainrpc-integration/*.js test/integration/*.js test/invoicesrpc-integration/*.js test/peersrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
|
|
65
|
+
"test": "echo $DOCKER_LND_VERSION && tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 200 test/autopilotrpc-integration/*.js test/chainrpc-integration/*.js test/integration/*.js test/invoicesrpc-integration/*.js test/peersrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
|
|
66
66
|
},
|
|
67
|
-
"version": "54.
|
|
67
|
+
"version": "54.5.0"
|
|
68
68
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
const {connectWatchtower} = require('./../../');
|
|
2
|
+
const {getConnectedWatchtowers} = require('./../../');
|
|
3
|
+
const {getTowerServerInfo} = require('./../../');
|
|
4
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
5
|
+
const {test} = require('@alexbosworth/tap');
|
|
6
|
+
|
|
7
|
+
const conf = ['--watchtower.active', '--wtclient.active'];
|
|
8
|
+
const size = 2;
|
|
9
|
+
|
|
10
|
+
// Connecting to a watchtower should add a watchtower
|
|
11
|
+
test(`Connect watchtower`, async ({end, equal, fail, match}) => {
|
|
12
|
+
const {kill, nodes} = await spawnLightningCluster({
|
|
13
|
+
size,
|
|
14
|
+
lnd_configuration: conf
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const [{lnd}, target] = nodes;
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const {tower} = await getTowerServerInfo({lnd: target.lnd});
|
|
21
|
+
|
|
22
|
+
const [socket] = tower.sockets;
|
|
23
|
+
|
|
24
|
+
await connectWatchtower({lnd, socket, public_key: tower.public_key});
|
|
25
|
+
|
|
26
|
+
const [watcher] = (await getConnectedWatchtowers({lnd})).towers;
|
|
27
|
+
|
|
28
|
+
equal(watcher.is_active, true, 'Tower is active');
|
|
29
|
+
equal(watcher.public_key, tower.public_key, 'Tower public key added');
|
|
30
|
+
equal(watcher.sessions.length, [].length, 'Tower has no sessions');
|
|
31
|
+
equal(watcher.sockets.pop(), socket, 'Tower at socket added');
|
|
32
|
+
} catch (err) {
|
|
33
|
+
equal(err, null, 'Expected no error');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
await kill({});
|
|
37
|
+
|
|
38
|
+
return end();
|
|
39
|
+
});
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const {connectWatchtower} = require('./../../');
|
|
2
|
+
const {getConnectedWatchtowers} = require('./../../');
|
|
3
|
+
const {getTowerServerInfo} = require('./../../');
|
|
4
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
5
|
+
const {test} = require('@alexbosworth/tap');
|
|
6
|
+
|
|
7
|
+
const conf = ['--watchtower.active', '--wtclient.active'];
|
|
8
|
+
const size = 2;
|
|
9
|
+
|
|
10
|
+
// Getting connected watchtowers should return watchtowers
|
|
11
|
+
test(`Get connected watchtowers`, async ({end, equal, fail, match}) => {
|
|
12
|
+
const {kill, nodes} = await spawnLightningCluster({
|
|
13
|
+
size,
|
|
14
|
+
lnd_configuration: conf
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const [{lnd}, target] = nodes;
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
const {tower} = await getTowerServerInfo({lnd: target.lnd});
|
|
21
|
+
|
|
22
|
+
const [socket] = tower.sockets;
|
|
23
|
+
|
|
24
|
+
await connectWatchtower({lnd, socket, public_key: tower.public_key});
|
|
25
|
+
|
|
26
|
+
const res = (await getConnectedWatchtowers({lnd}));
|
|
27
|
+
|
|
28
|
+
const [watcher] = res.towers;
|
|
29
|
+
|
|
30
|
+
equal(res.backups_count, 0, 'Got backups count');
|
|
31
|
+
equal(res.failed_backups_count, 0, 'Got failed backups count');
|
|
32
|
+
equal(res.finished_sessions_count, 0, 'Got finished sessions count');
|
|
33
|
+
equal(res.max_session_update_count, 1024, 'Got max session update count');
|
|
34
|
+
equal(res.pending_backups_count, 0, 'Got pending backups count');
|
|
35
|
+
equal(res.sessions_count, 0, 'Got sessions count');
|
|
36
|
+
equal(res.sweep_tokens_per_vbyte, 10, 'Got sweep tokens per vbyte');
|
|
37
|
+
|
|
38
|
+
equal(watcher.is_active, true, 'Tower is active');
|
|
39
|
+
equal(watcher.public_key, tower.public_key, 'Tower is connected');
|
|
40
|
+
equal(watcher.sessions.length, [].length, 'No sessions initiated');
|
|
41
|
+
equal(watcher.sockets.slice().pop(), socket, 'Tower socket returned');
|
|
42
|
+
} catch (err) {
|
|
43
|
+
equal(err, null, 'Expected no error');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
await kill({});
|
|
47
|
+
|
|
48
|
+
return end();
|
|
49
|
+
});
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
const {test} = require('@alexbosworth/tap');
|
|
2
|
-
|
|
3
|
-
const {connectWatchtower} = require('./../../');
|
|
4
|
-
const {getConnectedWatchtowers} = require('./../../');
|
|
5
|
-
const {getTowerServerInfo} = require('./../../');
|
|
6
|
-
const {spawnLnd} = require('./../macros');
|
|
7
|
-
const {waitForTermination} = require('./../macros');
|
|
8
|
-
|
|
9
|
-
const all = promise => Promise.all(promise);
|
|
10
|
-
const nodes = [{watchers: true}, {tower: true}];
|
|
11
|
-
|
|
12
|
-
// Connecting to a watchtower should add a watchtower
|
|
13
|
-
test(`Connect watchtower`, async ({end, equal, fail, match}) => {
|
|
14
|
-
let client;
|
|
15
|
-
let tower;
|
|
16
|
-
|
|
17
|
-
client = await spawnLnd({watchers: true});
|
|
18
|
-
tower = await spawnLnd({tower: true});
|
|
19
|
-
|
|
20
|
-
const info = (await getTowerServerInfo({lnd: tower.lnd})).tower;
|
|
21
|
-
const {lnd} = client;
|
|
22
|
-
|
|
23
|
-
const [socket] = info.sockets;
|
|
24
|
-
|
|
25
|
-
try {
|
|
26
|
-
await connectWatchtower({lnd, socket, public_key: info.public_key});
|
|
27
|
-
|
|
28
|
-
const [watcher] = (await getConnectedWatchtowers({lnd})).towers;
|
|
29
|
-
|
|
30
|
-
equal(watcher.is_active, true, 'Tower is active');
|
|
31
|
-
equal(watcher.public_key, info.public_key, 'Tower public key added');
|
|
32
|
-
equal(watcher.sessions.length, [].length, 'Tower has no sessions');
|
|
33
|
-
equal(watcher.sockets.pop(), socket, 'Tower at socket added');
|
|
34
|
-
} catch (err) {
|
|
35
|
-
equal(err, null, 'Expects no error');
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
[client, tower].forEach(n => n.kill());
|
|
39
|
-
|
|
40
|
-
await all([client, tower].map(({lnd}) => waitForTermination({lnd})));
|
|
41
|
-
|
|
42
|
-
return end();
|
|
43
|
-
});
|
package/test/extra-integration/tower_clientrpc-integration/test_get_connected_watchtowers.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
const {test} = require('@alexbosworth/tap');
|
|
2
|
-
|
|
3
|
-
const {connectWatchtower} = require('./../../');
|
|
4
|
-
const {createCluster} = require('./../macros');
|
|
5
|
-
const {delay} = require('./../macros');
|
|
6
|
-
const {disconnectWatchtower} = require('./../../');
|
|
7
|
-
const {getConnectedWatchtowers} = require('./../../');
|
|
8
|
-
const {getTowerServerInfo} = require('./../../');
|
|
9
|
-
const {openChannel} = require('./../../');
|
|
10
|
-
const {pay} = require('./../../');
|
|
11
|
-
const {spawnLnd} = require('./../macros');
|
|
12
|
-
const {stopDaemon} = require('./../../');
|
|
13
|
-
const {waitForChannel} = require('./../macros');
|
|
14
|
-
const {waitForPendingChannel} = require('./../macros');
|
|
15
|
-
const {waitForTermination} = require('./../macros');
|
|
16
|
-
|
|
17
|
-
// Getting connected watchtowers should return watchtowers
|
|
18
|
-
test(`Connect watchtower`, async ({end, equal, match}) => {
|
|
19
|
-
let control;
|
|
20
|
-
let tower;
|
|
21
|
-
|
|
22
|
-
control = await spawnLnd({watchers: true});
|
|
23
|
-
tower = await spawnLnd({tower: true});
|
|
24
|
-
|
|
25
|
-
const info = (await getTowerServerInfo({lnd: tower.lnd})).tower;
|
|
26
|
-
const {lnd} = control;
|
|
27
|
-
|
|
28
|
-
const [socket] = info.sockets;
|
|
29
|
-
|
|
30
|
-
await connectWatchtower({lnd, socket, public_key: info.public_key});
|
|
31
|
-
|
|
32
|
-
const res = (await getConnectedWatchtowers({lnd}));
|
|
33
|
-
|
|
34
|
-
equal(res.backups_count, 0, 'Got backups count');
|
|
35
|
-
equal(res.failed_backups_count, 0, 'Got failed backups count');
|
|
36
|
-
equal(res.finished_sessions_count, 0, 'Got finished sessions count');
|
|
37
|
-
equal(res.max_session_update_count, 1024, 'Got max session update count');
|
|
38
|
-
equal(res.pending_backups_count, 0, 'Got pending backups count');
|
|
39
|
-
equal(res.sessions_count, 0, 'Got sessions count');
|
|
40
|
-
equal(res.sweep_tokens_per_vbyte, 10, 'Got sweep tokens per vbyte');
|
|
41
|
-
|
|
42
|
-
const [watcher] = res.towers;
|
|
43
|
-
|
|
44
|
-
equal(watcher.is_active, true, 'Tower is active');
|
|
45
|
-
equal(watcher.public_key, info.public_key, 'Tower is connected');
|
|
46
|
-
equal(watcher.sessions.length, [].length, 'No sessions initiated');
|
|
47
|
-
equal(watcher.sockets.slice().pop(), socket, 'Tower socket returned');
|
|
48
|
-
|
|
49
|
-
[control, tower].forEach(n => n.kill());
|
|
50
|
-
|
|
51
|
-
await waitForTermination({lnd});
|
|
52
|
-
await waitForTermination({lnd: tower.lnd});
|
|
53
|
-
|
|
54
|
-
return end();
|
|
55
|
-
});
|