ln-service 54.4.0 → 54.4.1
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 +1 -1
- package/package.json +4 -4
- 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
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.4.
|
|
14
|
+
"lightning": "6.4.1",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
17
|
"ws": "8.11.0"
|
|
@@ -24,7 +24,7 @@
|
|
|
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",
|
|
@@ -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.4.
|
|
67
|
+
"version": "54.4.1"
|
|
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
|
-
});
|