robosats/docker/cln/entrypoint.sh
daywalker90 62e6258f0f
Feat: fix CLN and reactivate cln integration tests (#1336)
* update cln holdinvoice plugin

DecodeBolt11 was removed in:
d51fd03390

* update CLN to v24.05 and holdinvoice to v3.0.0

* reactivate CLN integration tests

---------

Co-authored-by: jerryfletcher21 <jerryfletcher@cock.email>
2024-06-17 21:33:49 +00:00

27 lines
910 B
Bash

#!/usr/bin/env bash
: "${EXPOSE_TCP:=false}"
networkdatadir="${LIGHTNINGD_DATA}/${LIGHTNINGD_NETWORK}"
if [ "$EXPOSE_TCP" == "true" ]; then
set -m
lightningd "$@" &
echo "Core-Lightning starting"
while read -r i; do if [ "$i" = "lightning-rpc" ]; then break; fi; done \
< <(inotifywait -e create,open --format '%f' --quiet "${networkdatadir}" --monitor)
echo "Core-Lightning started"
echo "Core-Lightning started, RPC available on port $LIGHTNINGD_RPC_PORT"
socat "TCP4-listen:$LIGHTNINGD_RPC_PORT,fork,reuseaddr" "UNIX-CONNECT:${networkdatadir}/lightning-rpc" &
fg %-
else
# Always copy the holdinvoice plugin into the plugins directory on start up
mkdir -p /root/.lightning/plugins
cp /tmp/holdinvoice /root/.lightning/plugins/holdinvoice
if [ ! -f /root/.lightning/config ]; then
cp /tmp/config /root/.lightning/config
fi
exec "$@"
fi