ln-service 57.5.0 → 57.6.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 +4 -0
- package/README.md +28 -1
- package/index.js +2 -0
- package/package.json +3 -3
- package/test/peersrpc-integration/test_add_advertised_feature.js +43 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ through npm.
|
|
|
9
9
|
|
|
10
10
|
Supported LND versions:
|
|
11
11
|
|
|
12
|
-
- v0.17.0-beta to v0.17.
|
|
12
|
+
- v0.17.0-beta to v0.17.4-beta
|
|
13
13
|
- v0.16.0-beta to v0.16.4-beta
|
|
14
14
|
- v0.15.2-beta to v0.15.5-beta
|
|
15
15
|
- v0.14.4-beta to v0.14.5-beta
|
|
@@ -135,6 +135,7 @@ for `unlocker` methods.
|
|
|
135
135
|
|
|
136
136
|
## All Methods
|
|
137
137
|
|
|
138
|
+
- [addAdvertisedFeature](#addadvertisedfeature) - Advertise a supported feature
|
|
138
139
|
- [addExternalSocket](#addexternalsocket) - Advertise a new p2p host:ip address
|
|
139
140
|
- [addPeer](#addpeer) - Connect to a peer
|
|
140
141
|
- [authenticatedLndGrpc](#authenticatedlndgrpc) - LND API Object
|
|
@@ -329,6 +330,32 @@ for `unlocker` methods.
|
|
|
329
330
|
- [probing](https://npmjs.com/package/probing) - payment probing utilities
|
|
330
331
|
- [psbt](https://www.npmjs.com/package/psbt) - BIP 174 PSBT utilities
|
|
331
332
|
|
|
333
|
+
### addAdvertisedFeature
|
|
334
|
+
|
|
335
|
+
Add an advertised feature to the graph node announcement
|
|
336
|
+
|
|
337
|
+
Note: this method is not supported in LND versions 0.14.5 and below
|
|
338
|
+
|
|
339
|
+
Requires LND built with `peersrpc` build tag
|
|
340
|
+
|
|
341
|
+
Requires `peers:write` permissions
|
|
342
|
+
|
|
343
|
+
{
|
|
344
|
+
feature: <BOLT 09 Feature Bit Number>
|
|
345
|
+
lnd: <Authenticated LND API Object>
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@returns via cbk or Promise
|
|
349
|
+
|
|
350
|
+
Example:
|
|
351
|
+
|
|
352
|
+
```node
|
|
353
|
+
const {addAdvertisedFeature} = require('ln-service');
|
|
354
|
+
|
|
355
|
+
// Add a new supported feature to the graph node announcement
|
|
356
|
+
await addAdvertisedFeature({lnd, feature: 12345});
|
|
357
|
+
```
|
|
358
|
+
|
|
332
359
|
### addExternalSocket
|
|
333
360
|
|
|
334
361
|
Add a new advertised p2p socket address
|
package/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const {addAdvertisedFeature} = require('lightning');
|
|
1
2
|
const {addExternalSocket} = require('lightning');
|
|
2
3
|
const {addPeer} = require('lightning');
|
|
3
4
|
const {authenticatedLndGrpc} = require('lightning');
|
|
@@ -158,6 +159,7 @@ const {verifyChainAddressMessage} = require('lightning');
|
|
|
158
159
|
const {verifyMessage} = require('lightning');
|
|
159
160
|
|
|
160
161
|
module.exports = {
|
|
162
|
+
addAdvertisedFeature,
|
|
161
163
|
addExternalSocket,
|
|
162
164
|
addPeer,
|
|
163
165
|
authenticatedLndGrpc,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"bolt07": "1.8.4",
|
|
11
11
|
"invoices": "3.0.0",
|
|
12
|
-
"lightning": "10.
|
|
12
|
+
"lightning": "10.6.0",
|
|
13
13
|
"macaroon": "3.0.4"
|
|
14
14
|
},
|
|
15
15
|
"description": "Interaction helper for your Lightning Network daemon",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"bn.js": "5.2.1",
|
|
25
25
|
"bs58check": "3.0.1",
|
|
26
26
|
"ecpair": "2.1.0",
|
|
27
|
-
"ln-docker-daemons": "6.0.
|
|
27
|
+
"ln-docker-daemons": "6.0.10",
|
|
28
28
|
"p2tr": "2.0.0",
|
|
29
29
|
"portfinder": "1.0.32",
|
|
30
30
|
"psbt": "3.0.0",
|
|
@@ -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": "57.
|
|
72
|
+
"version": "57.6.0"
|
|
73
73
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
const {deepEqual} = require('node:assert').strict;
|
|
2
|
+
const test = require('node:test');
|
|
3
|
+
|
|
4
|
+
const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
5
|
+
|
|
6
|
+
const {addAdvertisedFeature} = require('./../../');
|
|
7
|
+
const {getWalletInfo} = require('./../../');
|
|
8
|
+
|
|
9
|
+
const feature = 12345;
|
|
10
|
+
|
|
11
|
+
// Adding a feature should result in an updated advertised feature
|
|
12
|
+
test(`Add external socket`, async () => {
|
|
13
|
+
const {kill, nodes} = await spawnLightningCluster({});
|
|
14
|
+
|
|
15
|
+
const [{id, lnd}] = nodes;
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
await addAdvertisedFeature({feature, lnd});
|
|
19
|
+
|
|
20
|
+
const {features} = await getWalletInfo({lnd});
|
|
21
|
+
|
|
22
|
+
const added = features.find(n => n.bit === feature);
|
|
23
|
+
|
|
24
|
+
deepEqual(
|
|
25
|
+
added,
|
|
26
|
+
{
|
|
27
|
+
bit: 12345,
|
|
28
|
+
is_known: false,
|
|
29
|
+
is_required: false,
|
|
30
|
+
type: undefined,
|
|
31
|
+
},
|
|
32
|
+
'Feature bit is advertised'
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
await kill({});
|
|
36
|
+
} catch (err) {
|
|
37
|
+
await kill({});
|
|
38
|
+
|
|
39
|
+
deepEqual(err, [400, 'ExpectedPeersRpcLndBuildTagToAddFeature']);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return;
|
|
43
|
+
});
|