ln-docker-daemons 2.1.1 → 2.2.3
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 +13 -0
- package/README.md +2 -0
- package/bitcoind/constants.json +1 -1
- package/cluster/spawn_lightning_cluster.js +2 -0
- package/lnd/constants.json +1 -1
- package/lnd/spawn_lightning_docker.js +2 -0
- package/lnd/spawn_lnd_docker.js +34 -43
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 2.2.3
|
|
4
|
+
|
|
5
|
+
- Change Bitcoin Core version to 22.0
|
|
6
|
+
|
|
7
|
+
## 2.2.2
|
|
8
|
+
|
|
9
|
+
- Change default LND version to v0.14.1-beta
|
|
10
|
+
|
|
11
|
+
## 2.2.1
|
|
12
|
+
|
|
13
|
+
- `spawnLightningCluster`, `spawnLightningDocker`: Add `lnd_configuration` to
|
|
14
|
+
allow specifying additional LND configuration parameters
|
|
15
|
+
|
|
3
16
|
## 2.1.1
|
|
4
17
|
|
|
5
18
|
- `DOCKER_LND_VERSION`: add environment variable to control docker lnd image
|
package/README.md
CHANGED
|
@@ -69,6 +69,7 @@ await kill({});
|
|
|
69
69
|
Spawn a cluster of nodes
|
|
70
70
|
|
|
71
71
|
{
|
|
72
|
+
[lnd_configuration]: [<LND Configuration Argument String>]
|
|
72
73
|
[size]: <Total Lightning Nodes Number>
|
|
73
74
|
}
|
|
74
75
|
|
|
@@ -114,6 +115,7 @@ Spawn an LND Docker
|
|
|
114
115
|
generate_address: <Generate Blocks to Address String>
|
|
115
116
|
lightning_p2p_port: <Lightning Network P2P Listen Port Number>
|
|
116
117
|
lightning_rpc_port: <Lightning Node RPC Port Number>
|
|
118
|
+
[lnd_configuration]: [<LND Configuration Argument String>]
|
|
117
119
|
}
|
|
118
120
|
|
|
119
121
|
@returns via cbk or Promise
|
package/bitcoind/constants.json
CHANGED
|
@@ -27,6 +27,7 @@ const times = 3000;
|
|
|
27
27
|
/** Spawn a cluster of nodes
|
|
28
28
|
|
|
29
29
|
{
|
|
30
|
+
[lnd_configuration]: [<LND Configuration Argument String>]
|
|
30
31
|
[size]: <Total Lightning Nodes Number>
|
|
31
32
|
}
|
|
32
33
|
|
|
@@ -75,6 +76,7 @@ module.exports = (args, cbk) => {
|
|
|
75
76
|
generate_address: generateAddress,
|
|
76
77
|
lightning_p2p_port: lightningP2pPort,
|
|
77
78
|
lightning_rpc_port: lightningRpcPort,
|
|
79
|
+
lnd_configuration: args.lnd_configuration,
|
|
78
80
|
});
|
|
79
81
|
|
|
80
82
|
const {lnd} = authenticatedLndGrpc({
|
package/lnd/constants.json
CHANGED
|
@@ -18,6 +18,7 @@ const spawnLndDocker = require('./spawn_lnd_docker');
|
|
|
18
18
|
generate_address: <Generate Blocks to Address String>
|
|
19
19
|
lightning_p2p_port: <Lightning Network P2P Listen Port Number>
|
|
20
20
|
lightning_rpc_port: <Lightning Node RPC Port Number>
|
|
21
|
+
[lnd_configuration]: [<LND Configuration Argument String>]
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
@returns via cbk or Promise
|
|
@@ -99,6 +100,7 @@ module.exports = (args, cbk) => {
|
|
|
99
100
|
({spawnChainDaemon}, cbk) =>
|
|
100
101
|
{
|
|
101
102
|
return spawnLndDocker({
|
|
103
|
+
configuration: args.lnd_configuration,
|
|
102
104
|
bitcoind_rpc_host: spawnChainDaemon.host,
|
|
103
105
|
bitcoind_rpc_pass: spawnChainDaemon.rpc_pass,
|
|
104
106
|
bitcoind_rpc_port: args.chain_rpc_port,
|
package/lnd/spawn_lnd_docker.js
CHANGED
|
@@ -23,6 +23,7 @@ const tlsCertPath = '/root/.lnd/tls.cert';
|
|
|
23
23
|
bitcoind_rpc_user: <Bitcoin Core RPC Username String>
|
|
24
24
|
bitcoind_zmq_block_port: <Bitcoin Core ZMQ Block Port Number>
|
|
25
25
|
bitcoind_zmq_tx_port: <Bitcoin Core ZMQ Transaction Port Number>
|
|
26
|
+
[configuration]: [<LND Configuration Argument String>]
|
|
26
27
|
p2p_port: <LND Peer to Peer Listen Port Number>
|
|
27
28
|
rpc_port: <LND RPC Port Number>
|
|
28
29
|
}
|
|
@@ -78,30 +79,32 @@ module.exports = (args, cbk) => {
|
|
|
78
79
|
const zmqBlockPort = args.bitcoind_zmq_block_port;
|
|
79
80
|
const zmqTxPort = args.bitcoind_zmq_tx_port;
|
|
80
81
|
|
|
82
|
+
const arguments = [
|
|
83
|
+
'--accept-keysend',
|
|
84
|
+
'--allow-circular-route',
|
|
85
|
+
'--autopilot.heuristic=externalscore:0.5',
|
|
86
|
+
'--autopilot.heuristic=preferential:0.5',
|
|
87
|
+
'--bitcoin.active',
|
|
88
|
+
'--bitcoin.minhtlc=1000',
|
|
89
|
+
'--bitcoin.node=bitcoind',
|
|
90
|
+
'--bitcoin.regtest',
|
|
91
|
+
`--bitcoind.rpchost=${chainHost}:18443`,
|
|
92
|
+
`--bitcoind.rpcpass=${args.bitcoind_rpc_pass}`,
|
|
93
|
+
`--bitcoind.rpcuser=${args.bitcoind_rpc_user}`,
|
|
94
|
+
`--bitcoind.zmqpubrawblock=tcp://${chainHost}:${zmqBlockPort}`,
|
|
95
|
+
`--bitcoind.zmqpubrawtx=tcp://${chainHost}:${zmqTxPort}`,
|
|
96
|
+
'--debuglevel=trace',
|
|
97
|
+
`--externalip=127.0.0.1:9735`,
|
|
98
|
+
'--historicalsyncinterval=1s',
|
|
99
|
+
`--listen=0.0.0.0:9735`,
|
|
100
|
+
'--nobootstrap',
|
|
101
|
+
`--rpclisten=0.0.0.0:10009`,
|
|
102
|
+
'--trickledelay=1',
|
|
103
|
+
'--unsafe-disconnect',
|
|
104
|
+
];
|
|
105
|
+
|
|
81
106
|
return spawnDockerImage({
|
|
82
|
-
arguments: [
|
|
83
|
-
'--accept-keysend',
|
|
84
|
-
'--allow-circular-route',
|
|
85
|
-
'--autopilot.heuristic=externalscore:0.5',
|
|
86
|
-
'--autopilot.heuristic=preferential:0.5',
|
|
87
|
-
'--bitcoin.active',
|
|
88
|
-
'--bitcoin.minhtlc=1000',
|
|
89
|
-
'--bitcoin.node=bitcoind',
|
|
90
|
-
'--bitcoin.regtest',
|
|
91
|
-
`--bitcoind.rpchost=${chainHost}:18443`,
|
|
92
|
-
`--bitcoind.rpcpass=${args.bitcoind_rpc_pass}`,
|
|
93
|
-
`--bitcoind.rpcuser=${args.bitcoind_rpc_user}`,
|
|
94
|
-
`--bitcoind.zmqpubrawblock=tcp://${chainHost}:${zmqBlockPort}`,
|
|
95
|
-
`--bitcoind.zmqpubrawtx=tcp://${chainHost}:${zmqTxPort}`,
|
|
96
|
-
'--debuglevel=trace',
|
|
97
|
-
`--externalip=127.0.0.1:9735`,
|
|
98
|
-
'--historicalsyncinterval=1s',
|
|
99
|
-
`--listen=0.0.0.0:9735`,
|
|
100
|
-
'--nobootstrap',
|
|
101
|
-
`--rpclisten=0.0.0.0:10009`,
|
|
102
|
-
'--trickledelay=1',
|
|
103
|
-
'--unsafe-disconnect',
|
|
104
|
-
],
|
|
107
|
+
arguments: arguments.concat(args.configuration || []),
|
|
105
108
|
image: imageName(process.env.DOCKER_LND_VERSION),
|
|
106
109
|
ports: {
|
|
107
110
|
'9735/tcp': args.p2p_port,
|
|
@@ -136,40 +139,28 @@ module.exports = (args, cbk) => {
|
|
|
136
139
|
cipher_seed_mnemonic: res.cipher_seed_mnemonic,
|
|
137
140
|
wallet_password: Buffer.from('password', 'utf8'),
|
|
138
141
|
},
|
|
139
|
-
err => {
|
|
142
|
+
(err, res) => {
|
|
140
143
|
if (!!err) {
|
|
141
144
|
return cbk([503, 'UnexpectedErrorInitializingWallet', {err}]);
|
|
142
145
|
}
|
|
143
146
|
|
|
144
|
-
return cbk();
|
|
147
|
+
return cbk(null, res.admin_macaroon);
|
|
145
148
|
});
|
|
146
149
|
});
|
|
147
150
|
},
|
|
148
151
|
cbk);
|
|
149
152
|
}],
|
|
150
153
|
|
|
151
|
-
// Get the macaroon out of the docker image
|
|
152
|
-
getMacaroon: [
|
|
153
|
-
'createWallet',
|
|
154
|
-
'spawnDocker',
|
|
155
|
-
({createWallet, spawnDocker}, cbk) =>
|
|
156
|
-
{
|
|
157
|
-
return asyncRetry({interval, times}, cbk => {
|
|
158
|
-
return spawnDocker.getFile({path: macaroonPath}, cbk);
|
|
159
|
-
},
|
|
160
|
-
cbk);
|
|
161
|
-
}],
|
|
162
|
-
|
|
163
154
|
// Wait for gRPC to respond
|
|
164
155
|
waitForRpc: [
|
|
156
|
+
'createWallet',
|
|
165
157
|
'getCertificate',
|
|
166
|
-
'getMacaroon',
|
|
167
158
|
'spawnDocker',
|
|
168
|
-
({
|
|
159
|
+
({createWallet, getCertificate, spawnDocker}, cbk) =>
|
|
169
160
|
{
|
|
170
161
|
const {lnd} = authenticatedLndGrpc({
|
|
171
162
|
cert: getCertificate.file.toString('hex'),
|
|
172
|
-
macaroon:
|
|
163
|
+
macaroon: createWallet.toString('hex'),
|
|
173
164
|
socket: `localhost:${args.rpc_port}`,
|
|
174
165
|
});
|
|
175
166
|
|
|
@@ -181,17 +172,17 @@ module.exports = (args, cbk) => {
|
|
|
181
172
|
|
|
182
173
|
// LND fully spawned
|
|
183
174
|
spawned: [
|
|
175
|
+
'createWallet',
|
|
184
176
|
'getCertificate',
|
|
185
|
-
'getMacaroon',
|
|
186
177
|
'spawnDocker',
|
|
187
178
|
'waitForRpc',
|
|
188
|
-
({
|
|
179
|
+
({createWallet, getCertificate, spawnDocker, waitForRpc}, cbk) =>
|
|
189
180
|
{
|
|
190
181
|
return cbk(null, {
|
|
191
182
|
cert: getCertificate.file.toString('base64'),
|
|
192
183
|
host: spawnDocker.host,
|
|
193
184
|
kill: spawnDocker.kill,
|
|
194
|
-
macaroon:
|
|
185
|
+
macaroon: createWallet.toString('hex'),
|
|
195
186
|
public_key: waitForRpc.public_key,
|
|
196
187
|
socket: `localhost:${args.rpc_port}`,
|
|
197
188
|
});
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"asyncjs-util": "1.2.8",
|
|
13
13
|
"dockerode": "3.3.1",
|
|
14
14
|
"find-free-ports": "3.0.0",
|
|
15
|
-
"lightning": "5.
|
|
15
|
+
"lightning": "5.5.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.2.3"
|
|
39
39
|
}
|