@@ -140,7 +140,7 @@ wait_for_lightningd() {
140
140
141
141
clnrest_status () {
142
142
logfile=" $1 "
143
- active_str=" plugin-clnrest: REST Server is starting "
143
+ active_str=" plugin-clnrest: REST server running "
144
144
disabled_str=" plugin-clnrest: Killing plugin: disabled itself"
145
145
146
146
if grep -q " $active_str " " $logfile " ; then
@@ -152,6 +152,11 @@ clnrest_status() {
152
152
fi
153
153
}
154
154
155
+ has_clnrest () {
156
+ test -x " $LIGHTNING_BIN /plugins/clnrest"
157
+ return $?
158
+ }
159
+
155
160
start_nodes () {
156
161
if [ -z " $1 " ]; then
157
162
node_count=2
@@ -203,7 +208,7 @@ funder-lease-requests-only=false
203
208
EOF
204
209
205
210
# If clnrest loads, add the port so it will run
206
- if [ -n " $ACTIVATE_CLNREST " ] ; then
211
+ if has_clnrest ; then
207
212
echo " clnrest-port=$(( 3109 + i)) " >> " $LIGHTNING_DIR /l$i /config"
208
213
fi
209
214
@@ -260,16 +265,12 @@ start_ln() {
260
265
else
261
266
nodes=" $1 "
262
267
fi
263
- # Are the clnrest dependencies installed?
264
- if timeout 2 python3 plugins/clnrest/clnrest > /dev/null 2>&1 ; then
265
- ACTIVATE_CLNREST=1
266
- fi
267
268
start_nodes " $nodes " regtest
268
269
echo " bt-cli, stop_ln, fund_nodes"
269
270
270
271
wait_for_lightningd " $nodes "
271
272
active_status=$( clnrest_status " $LIGHTNING_DIR /l1/log" )
272
- if [ -n " $ACTIVATE_CLNREST " ] && [ " $active_status " = " active" ] ; then
273
+ if has_clnrest && [ " $active_status " = " active" ] ; then
273
274
node_info regtest
274
275
elif [ " $active_status " = " disabled" ]; then
275
276
echo " clnrest is disabled."
0 commit comments