ln-service 56.12.0 → 56.14.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
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 56.14.0
|
|
4
|
+
|
|
5
|
+
- `openChannel`: Add `is_allowing_minimal_reserve` to allow no reserve on peer
|
|
6
|
+
|
|
7
|
+
## 56.13.0
|
|
8
|
+
|
|
9
|
+
- `openChannels`: Add `is_simplified_taproot` to make a simplified taproot chan
|
|
10
|
+
|
|
3
11
|
## 56.12.0
|
|
4
12
|
|
|
5
13
|
- `openChannel`: Add `is_simplified_taproot` to make a simplified taproot chan
|
package/README.md
CHANGED
|
@@ -3758,6 +3758,8 @@ Requires `offchain:write`, `onchain:write`, `peers:write` permissions
|
|
|
3758
3758
|
`base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
3759
3759
|
`fee_rate` is not supported on LND 0.15.5 and below
|
|
3760
3760
|
|
|
3761
|
+
`is_allowing_minimal_reserve` is not supported on LND 0.15.0 and below
|
|
3762
|
+
|
|
3761
3763
|
`is_max_funding` is not supported on LND 0.16.4 and below
|
|
3762
3764
|
|
|
3763
3765
|
`description` is not supported on LND 0.16.4 and below
|
|
@@ -3778,6 +3780,7 @@ Requires `offchain:write`, `onchain:write`, `peers:write` permissions
|
|
|
3778
3780
|
transaction_id: <Fund With Unspent Transaction Id Hex String>
|
|
3779
3781
|
transaction_vout: <Fund With Unspent Transaction Output Index Number>
|
|
3780
3782
|
}]
|
|
3783
|
+
[is_allowing_minimal_reserve]: <Allow Peer to Have Minimal Reserve Bool>
|
|
3781
3784
|
[is_max_funding]: <Use Maximal Chain Funds For Local Funding Bool>
|
|
3782
3785
|
[is_private]: <Channel is Private Bool> // Defaults to false
|
|
3783
3786
|
[is_simplified_taproot]: <Channel is Simplified Taproot Type Bool>
|
|
@@ -3830,6 +3833,9 @@ as well as a channel open request listener to accept the trusted funding.
|
|
|
3830
3833
|
|
|
3831
3834
|
`description` is not supported on LND 0.16.4 and below
|
|
3832
3835
|
|
|
3836
|
+
`is_simplified_taproot` is not supported on LND 0.16.4 and below and requires
|
|
3837
|
+
`--protocol.simple-taproot-chans` set on both sides.
|
|
3838
|
+
|
|
3833
3839
|
{
|
|
3834
3840
|
channels: [{
|
|
3835
3841
|
[base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
|
|
@@ -3839,6 +3845,7 @@ as well as a channel open request listener to accept the trusted funding.
|
|
|
3839
3845
|
[fee_rate]: <Routing Fee Rate In Millitokens Per Million Number>
|
|
3840
3846
|
[give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
|
|
3841
3847
|
[is_private]: <Channel is Private Bool> // Defaults to false
|
|
3848
|
+
[is_simplified_taproot]: <Channel is Simplified Taproot Type Bool>
|
|
3842
3849
|
[is_trusted_funding]: <Peer Should Avoid Waiting For Confirmation Bool>
|
|
3843
3850
|
[min_htlc_mtokens]: <Minimum HTLC Millitokens String>
|
|
3844
3851
|
[partner_csv_delay]: <Peer Output CSV Delay Number>
|
package/package.json
CHANGED
|
@@ -11,10 +11,10 @@
|
|
|
11
11
|
"cors": "2.8.5",
|
|
12
12
|
"express": "4.18.2",
|
|
13
13
|
"invoices": "3.0.0",
|
|
14
|
-
"lightning": "9.
|
|
14
|
+
"lightning": "9.14.0",
|
|
15
15
|
"macaroon": "3.0.4",
|
|
16
16
|
"morgan": "1.10.0",
|
|
17
|
-
"ws": "8.
|
|
17
|
+
"ws": "8.14.2"
|
|
18
18
|
},
|
|
19
19
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
20
20
|
"devDependencies": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"asyncjs-util": "1.2.12",
|
|
25
25
|
"bip32": "4.0.0",
|
|
26
26
|
"bip66": "1.1.5",
|
|
27
|
-
"bitcoinjs-lib": "6.1.
|
|
27
|
+
"bitcoinjs-lib": "6.1.5",
|
|
28
28
|
"bn.js": "5.2.1",
|
|
29
29
|
"bs58check": "3.0.1",
|
|
30
30
|
"ecpair": "2.1.0",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"p2tr": "2.0.0",
|
|
33
33
|
"portfinder": "1.0.32",
|
|
34
34
|
"psbt": "3.0.0",
|
|
35
|
-
"rimraf": "5.0.
|
|
35
|
+
"rimraf": "5.0.5",
|
|
36
36
|
"secp256k1": "5.0.0",
|
|
37
37
|
"tiny-secp256k1": "2.2.3",
|
|
38
|
-
"uuid": "9.0.
|
|
38
|
+
"uuid": "9.0.1",
|
|
39
39
|
"varuint-bitcoin": "1.1.2"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
@@ -69,5 +69,5 @@
|
|
|
69
69
|
"integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
|
|
70
70
|
"test": "echo $DOCKER_LND_VERSION && node test/runner"
|
|
71
71
|
},
|
|
72
|
-
"version": "56.
|
|
72
|
+
"version": "56.14.0"
|
|
73
73
|
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
const {equal} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
|
|
4
|
+
const asyncRetry = require('async/retry');
|
|
5
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
6
|
+
|
|
7
|
+
const {addPeer} = require('./../../');
|
|
8
|
+
const {getChannels} = require('./../../');
|
|
9
|
+
const {getWalletInfo} = require('./../../');
|
|
10
|
+
const {openChannel} = require('./../../');
|
|
11
|
+
const {subscribeToOpenRequests} = require('./../../');
|
|
12
|
+
|
|
13
|
+
const channelCapacityTokens = 1e6;
|
|
14
|
+
const confirmationCount = 6;
|
|
15
|
+
const count = 100;
|
|
16
|
+
const dustLimit = 354;
|
|
17
|
+
const interval = 10;
|
|
18
|
+
const size = 2;
|
|
19
|
+
const times = 2000;
|
|
20
|
+
|
|
21
|
+
// Open a channel with a low channel reserve
|
|
22
|
+
test(`Open channel but allow a minimal channel reserve`, async () => {
|
|
23
|
+
const {kill, nodes} = await spawnLightningCluster({size});
|
|
24
|
+
|
|
25
|
+
const [control, target] = nodes;
|
|
26
|
+
|
|
27
|
+
const {id, lnd} = control;
|
|
28
|
+
|
|
29
|
+
await target.generate({count});
|
|
30
|
+
|
|
31
|
+
await addPeer({lnd, public_key: target.id, socket: target.socket});
|
|
32
|
+
|
|
33
|
+
await asyncRetry({interval, times}, async () => {
|
|
34
|
+
const wallet = await getWalletInfo({lnd: target.lnd});
|
|
35
|
+
|
|
36
|
+
if (!wallet.is_synced_to_chain) {
|
|
37
|
+
throw new Error('ExpectedWalletSyncedToChain');
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
const acceptSub = subscribeToOpenRequests({lnd});
|
|
42
|
+
|
|
43
|
+
acceptSub.on('channel_request', request => {
|
|
44
|
+
request.accept({
|
|
45
|
+
min_confirmations: 1,
|
|
46
|
+
remote_csv: 999,
|
|
47
|
+
remote_reserve: 354,
|
|
48
|
+
remote_max_htlcs: 20,
|
|
49
|
+
remote_max_pending_mtokens: '200000',
|
|
50
|
+
remote_min_htlc_mtokens: '2000',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
return;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
await asyncRetry({interval, times}, async () => {
|
|
58
|
+
return await openChannel({
|
|
59
|
+
lnd: target.lnd,
|
|
60
|
+
is_private: true,
|
|
61
|
+
is_allowing_minimal_reserve: true,
|
|
62
|
+
local_tokens: channelCapacityTokens,
|
|
63
|
+
partner_public_key: control.id,
|
|
64
|
+
socket: control.socket,
|
|
65
|
+
});
|
|
66
|
+
});
|
|
67
|
+
} catch (err) {
|
|
68
|
+
equal(err, null, 'Expected no error when a channel is accepted');
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
acceptSub.removeAllListeners();
|
|
72
|
+
|
|
73
|
+
await target.generate({count: confirmationCount});
|
|
74
|
+
|
|
75
|
+
const channel = await asyncRetry({interval, times}, async () => {
|
|
76
|
+
const [channel] = (await getChannels({lnd})).channels;
|
|
77
|
+
|
|
78
|
+
await control.generate({});
|
|
79
|
+
|
|
80
|
+
if (!channel) {
|
|
81
|
+
throw new Error('ExpectedChannelCreation');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return channel;
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
equal(channel.remote_reserve, dustLimit, 'Got minimal reserve value');
|
|
88
|
+
|
|
89
|
+
await kill({});
|
|
90
|
+
|
|
91
|
+
return;
|
|
92
|
+
});
|
|
@@ -5,8 +5,13 @@ const asyncRetry = require('async/retry');
|
|
|
5
5
|
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
6
6
|
|
|
7
7
|
const {addPeer} = require('./../../');
|
|
8
|
+
const {broadcastChainTransaction} = require('./../../');
|
|
9
|
+
const {fundPendingChannels} = require('./../../');
|
|
10
|
+
const {fundPsbt} = require('./../../');
|
|
8
11
|
const {getChannels} = require('./../../');
|
|
9
12
|
const {openChannel} = require('./../../');
|
|
13
|
+
const {openChannels} = require('./../../');
|
|
14
|
+
const {signPsbt} = require('./../../');
|
|
10
15
|
|
|
11
16
|
const channelCapacityTokens = 1e6;
|
|
12
17
|
const count = 100;
|
|
@@ -107,5 +112,63 @@ test(`Open simplified taproot channel`, async () => {
|
|
|
107
112
|
await kill({});
|
|
108
113
|
}
|
|
109
114
|
|
|
115
|
+
// Try opening a simplified taproot channel via PSBT funding
|
|
116
|
+
{
|
|
117
|
+
const {kill, nodes} = await spawnLightningCluster({
|
|
118
|
+
size,
|
|
119
|
+
lnd_configuration: ['--protocol.simple-taproot-chans'],
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
const [{generate, id, lnd}, target] = nodes;
|
|
123
|
+
|
|
124
|
+
await generate({count});
|
|
125
|
+
|
|
126
|
+
await addPeer({lnd, public_key: target.id, socket: target.socket});
|
|
127
|
+
|
|
128
|
+
const channelOpen = await asyncRetry({interval, times}, async () => {
|
|
129
|
+
await addPeer({lnd, public_key: target.id, socket: target.socket});
|
|
130
|
+
|
|
131
|
+
return await openChannels({
|
|
132
|
+
lnd,
|
|
133
|
+
channels: [{
|
|
134
|
+
capacity: channelCapacityTokens,
|
|
135
|
+
is_private: true,
|
|
136
|
+
is_simplified_taproot: true,
|
|
137
|
+
partner_public_key: target.id,
|
|
138
|
+
}],
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
const funded = await fundPsbt({lnd, outputs: channelOpen.pending});
|
|
143
|
+
|
|
144
|
+
const signed = await signPsbt({lnd, psbt: funded.psbt});
|
|
145
|
+
|
|
146
|
+
await fundPendingChannels({
|
|
147
|
+
lnd,
|
|
148
|
+
channels: channelOpen.pending.map(n => n.id),
|
|
149
|
+
funding: signed.psbt,
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
await broadcastChainTransaction({lnd, transaction: signed.transaction});
|
|
153
|
+
|
|
154
|
+
const channel = await asyncRetry({interval, times}, async () => {
|
|
155
|
+
await generate({});
|
|
156
|
+
|
|
157
|
+
const {channels} = await getChannels({lnd});
|
|
158
|
+
|
|
159
|
+
const [channel] = channels;
|
|
160
|
+
|
|
161
|
+
if (!channel) {
|
|
162
|
+
throw new Error('ExpectedChannelOpened');
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
return channel;
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
equal(channel.type, 'simplified_taproot', 'Opened simplified taproot');
|
|
169
|
+
|
|
170
|
+
await kill({});
|
|
171
|
+
}
|
|
172
|
+
|
|
110
173
|
return;
|
|
111
174
|
});
|