ln-docker-daemons 2.0.0 → 2.1.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 +12 -3
- package/cluster/spawn_lightning_cluster.js +2 -2
- package/docker/spawn_docker_image.js +2 -0
- package/lnd/constants.json +1 -1
- package/lnd/spawn_lnd_docker.js +3 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -18,6 +18,16 @@ const publicKey = (await getIdentity({lnd})).public_key;
|
|
|
18
18
|
await kill({});
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
## Environment Variables
|
|
22
|
+
|
|
23
|
+
- `DOCKER_LND_VERSION`: set this to use a custom LND docker image
|
|
24
|
+
|
|
25
|
+
Example:
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
export DOCKER_LND_VERSION="v0.14.0-beta"
|
|
29
|
+
```
|
|
30
|
+
|
|
21
31
|
## spawnBitcoindDocker
|
|
22
32
|
|
|
23
33
|
Spawn a Bitcoin Core Docker image
|
|
@@ -83,11 +93,10 @@ const {spawnLightningCluster} = require('ln-docker-daemons');
|
|
|
83
93
|
const {nodes} = await spawnLightningCluster({});
|
|
84
94
|
const [{lnd, generate, kill}] = nodes;
|
|
85
95
|
|
|
86
|
-
const
|
|
96
|
+
const publicKey = (await getIdentity({lnd})).public_key;
|
|
87
97
|
|
|
88
98
|
// Generate some coins for the wallet
|
|
89
|
-
|
|
90
|
-
await generate({address, count: 500});
|
|
99
|
+
await generate({count: 500});
|
|
91
100
|
|
|
92
101
|
// Stop the image
|
|
93
102
|
await kill({});
|
|
@@ -17,7 +17,7 @@ const count = size => size || 1;
|
|
|
17
17
|
const endPort = 65000;
|
|
18
18
|
const generateAddress = '2N8hwP1WmJrFF5QWABn38y63uYLhnJYJYTF';
|
|
19
19
|
const interval = 10;
|
|
20
|
-
const makeAddress = ({lnd}) => createChainAddress({lnd
|
|
20
|
+
const makeAddress = ({lnd}) => createChainAddress({lnd});
|
|
21
21
|
const maturity = 100;
|
|
22
22
|
const pairs = n => n.map((x, i) => n.slice(i + 1).map(y => [x, y])).flat();
|
|
23
23
|
const portsPerLnd = 6;
|
|
@@ -46,7 +46,7 @@ module.exports = (args, cbk) => {
|
|
|
46
46
|
return asyncAuto({
|
|
47
47
|
// Spawn nodes
|
|
48
48
|
spawn: async () => {
|
|
49
|
-
return await asyncRetry({}, async () => {
|
|
49
|
+
return await asyncRetry({interval, times: 25}, async () => {
|
|
50
50
|
const options = {startPort: between(startPort, endPort)};
|
|
51
51
|
|
|
52
52
|
// Find ports for the requested daemons
|
package/lnd/constants.json
CHANGED
package/lnd/spawn_lnd_docker.js
CHANGED
|
@@ -8,7 +8,8 @@ const {unauthenticatedLndGrpc} = require('lightning');
|
|
|
8
8
|
const {dockerLndImage} = require('./constants');
|
|
9
9
|
const {spawnDockerImage} = require('./../docker');
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const imageName = ver => !!ver ? `lightninglabs/lnd:${ver}` : dockerLndImage;
|
|
12
|
+
const interval = 100;
|
|
12
13
|
const macaroonPath = '/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon';
|
|
13
14
|
const times = 500;
|
|
14
15
|
const tlsCertPath = '/root/.lnd/tls.cert';
|
|
@@ -101,7 +102,7 @@ module.exports = (args, cbk) => {
|
|
|
101
102
|
'--trickledelay=1',
|
|
102
103
|
'--unsafe-disconnect',
|
|
103
104
|
],
|
|
104
|
-
image:
|
|
105
|
+
image: imageName(process.env.DOCKER_LND_VERSION),
|
|
105
106
|
ports: {
|
|
106
107
|
'9735/tcp': args.p2p_port,
|
|
107
108
|
'10009/tcp': args.rpc_port,
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"asyncjs-util": "1.2.7",
|
|
13
13
|
"dockerode": "3.3.1",
|
|
14
14
|
"find-free-ports": "3.0.0",
|
|
15
|
-
"lightning": "
|
|
15
|
+
"lightning": "5.0.0",
|
|
16
16
|
"tar-stream": "2.2.0"
|
|
17
17
|
},
|
|
18
18
|
"description": "Spawn and control LN Docker daemons",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"scripts": {
|
|
36
36
|
"test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -j 1 test/bitcoind/*.js test/lnd/*.js"
|
|
37
37
|
},
|
|
38
|
-
"version": "2.
|
|
38
|
+
"version": "2.1.0"
|
|
39
39
|
}
|