Merge pull request #837 from cdecker/cl-fix

Update the c-lightning installation instructions and make things a bit more stable
pull/842/head
Andreas M. Antonopoulos 3 years ago committed by GitHub
commit f545977c68
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -493,7 +493,7 @@ Next, we will copy the latest version of c-lightning from the source code reposi
[source,bash]
----
$ git clone https://github.com/ElementsProject/lightning.git
$ git clone --recurse https://github.com/ElementsProject/lightning.git
Cloning into 'lightning'...
remote: Enumerating objects: 24, done.
remote: Counting objects: 100% (24/24), done.
@ -596,12 +596,12 @@ In order to verify that the +lightningd+ and +lightning-cli+ commands have been
[source,bash]
----
$ lightningd --version
v0.8.1rc2
v0.10.1-34-gfe86c11
$ lightning-cli --version
v0.8.1rc2
v0.10.1-34-gfe86c11
----
You may see a different version from that shown above as the software continues to evolve long after this book is published. However, no matter what version you see, the fact that the commands execute and respond with version information means that you have succeeded in building the c-lightning software.
The version consists of the latest release version (v0.10.1) followed by the number of changes since the release (34) and finally a hash identifying exactly which revision (fe86c11). You may see a different version from that shown above as the software continues to evolve long after this book is published. However, no matter what version you see, the fact that the commands execute and respond with version information means that you have succeeded in building the c-lightning software.
=== The Lightning Network Daemon (LND) node project

@ -3,7 +3,7 @@ set -Eeuo pipefail
echo Starting bitcoind...
bitcoind -datadir=/bitcoind -daemon
until bitcoin-cli -datadir=/bitcoind getblockchaininfo > /dev/null 2>&1
until bitcoin-cli -datadir=/bitcoind -rpcwait getblockchaininfo > /dev/null 2>&1
do
sleep 1
done
@ -15,8 +15,10 @@ echo "Importing demo private key"
echo "Bitcoin address: " ${address}
echo "Private key: " ${privkey}
echo "================================================"
bitcoin-cli -datadir=/bitcoind createwallet regtest
bitcoin-cli -datadir=/bitcoind importprivkey $privkey
# If restarting the wallet already exists, so don't fail if it does,
# just load the existing wallet:
bitcoin-cli -datadir=/bitcoind createwallet regtest || bitcoin-cli -datadir=/bitcoind loadwallet regtest
bitcoin-cli -datadir=/bitcoind importprivkey $privkey || true
# Executing CMD
echo "$@"

@ -1,14 +1,29 @@
FROM lnbook/bitcoind AS c-lightning-base
# Install software-properties-common to add apt repositories
RUN apt update && apt install -yqq \
software-properties-common
RUN apt-get update -qq && apt-get install -yqq \
wget gpg xz-utils libpq5 libsodium23
# c-lightning
ENV C_LIGHTNING_VER 0.9.3~20210120202101201901~ubuntu20.04.1
RUN add-apt-repository -u ppa:lightningnetwork/ppa
RUN apt-get install -yqq \
lightningd=${C_LIGHTNING_VER}
ENV C_LIGHTNING_VER 0.10.1
RUN cd /tmp && \
wget -q https://github.com/ElementsProject/lightning/releases/download/v${C_LIGHTNING_VER}/clightning-v${C_LIGHTNING_VER}-Ubuntu-20.04.tar.xz
# Verify developer signatures. The `gpg --verify` command will print a
# couple of warnings about the key not being trusted. That's ok. The
# important part is that it doesn't error and reports "Good
# signature".
ADD devkeys.pem /tmp/devkeys.pem
RUN gpg --import /tmp/devkeys.pem
ADD https://github.com/ElementsProject/lightning/releases/download/v0.10.1/SHA256SUMS /tmp/SHA256SUMS
ADD https://github.com/ElementsProject/lightning/releases/download/v0.10.1/SHA256SUMS.asc /tmp/SHA256SUMS.asc
RUN cd /tmp && \
gpg -q --verify SHA256SUMS.asc SHA256SUMS && \
cat SHA256SUMS && \
sha256sum --ignore-missing -c SHA256SUMS
RUN tar -xvf /tmp/clightning-v${C_LIGHTNING_VER}-Ubuntu-20.04.tar.xz -C /
ADD https://raw.githubusercontent.com/ElementsProject/lightning/master/contrib/lightning-cli.bash-completion /usr/share/bash-completion/completions/lightning-cli

File diff suppressed because it is too large Load Diff

@ -2,21 +2,12 @@
set -Eeuo pipefail
# Generate a new receiving address for c-lightning wallet
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq .address)
address=$(lightning-cli --lightning-dir=/lightningd --network regtest newaddr | jq '.bech32' -r)
# Ask Bitcoin Core to send 10 BTC to the address, using JSON-RPC call
curl --user regtest:regtest \
-H 'content-type: text/plain;' \
http://bitcoind:18443/ \
--data-binary @- <<EOF
{
"jsonrpc": "1.0",
"id": "c-lightning-container",
"method": "sendtoaddress",
"params": [
${address},
10,
"funding c-lightning"
]
}
EOF
bitcoin-cli \
--rpcuser=regtest \
--rpcpassword=regtest \
--rpcconnect=bitcoind \
--regtest \
sendtoaddress ${address} 10 "funding c-lightning"

Loading…
Cancel
Save