Merge pull request #5 from michael1011/update-images

* update Docker images
* add Eclair node
This commit is contained in:
dni ⚡ 2023-01-25 10:15:28 +01:00 committed by GitHub
commit f87a05df03
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 72 additions and 9 deletions

27
data/eclair/eclair.conf Normal file
View file

@ -0,0 +1,27 @@
eclair {
chain = "regtest"
api {
enabled = true
port = 8080
password = "lnbits"
}
bitcoind {
host = "bitcoind"
rpcport = 18443
rpcuser = "lnbits"
rpcpassword = "lnbits"
zmqblock = "tcp://bitcoind:29001"
zmqtx = "tcp://bitcoind:29000"
}
channel {
max-funding-satoshis = 10000000000
}
features {
option_support_large_channel = mandatory
}
}

View file

@ -41,7 +41,7 @@ services:
bitcoind:
hostname: bitcoind
image: boltz/bitcoin-core:23.0
image: boltz/bitcoin-core:24.0.1
command: "-regtest -fallbackfee=0.00000253 -zmqpubrawtx=tcp://0.0.0.0:29000 -zmqpubrawblock=tcp://0.0.0.0:29001 -txindex -rpcallowip=0.0.0.0/0 -rpcbind=0.0.0.0 -rpcuser=lnbits -rpcpassword=lnbits"
expose:
- 29000
@ -53,7 +53,7 @@ services:
hostname: clightning-1
depends_on:
- bitcoind
image: boltz/c-lightning:0.11.2
image: boltz/c-lightning:22.11.1
entrypoint: "sh -c 'sleep 15 && lightningd --large-channels --network regtest --bind-addr=0.0.0.0:9735 --bitcoin-rpcconnect=bitcoind --bitcoin-rpcport=18443 --bitcoin-rpcuser=lnbits --bitcoin-rpcpassword=lnbits'"
expose:
- 9735
@ -64,7 +64,7 @@ services:
hostname: clightning-2
depends_on:
- bitcoind
image: boltz/c-lightning:0.11.2
image: boltz/c-lightning:22.11.1
entrypoint: "sh -c 'sleep 15 && lightningd --large-channels --network regtest --bind-addr=0.0.0.0:9735 --bitcoin-rpcconnect=bitcoind --bitcoin-rpcport=18443 --bitcoin-rpcuser=lnbits --bitcoin-rpcpassword=lnbits'"
expose:
- 9735
@ -75,7 +75,7 @@ services:
hostname: lnd-1
depends_on:
- bitcoind
image: boltz/lnd:0.15.2-beta
image: boltz/lnd:0.15.5-beta
restart: on-failure
entrypoint: "sh -c 'sleep 20; lnd --listen=lnd-1:9735 --rpclisten=lnd-1:10009 --restlisten=lnd-1:8081 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=bitcoind --bitcoind.zmqpubrawtx=bitcoind:29000 --bitcoind.zmqpubrawblock=bitcoind:29001 --bitcoind.rpcuser=lnbits --bitcoind.rpcpass=lnbits --noseedbackup --protocol.wumbo-channels'"
ports:
@ -92,7 +92,7 @@ services:
hostname: lnd-2
depends_on:
- bitcoind
image: boltz/lnd:0.15.2-beta
image: boltz/lnd:0.15.5-beta
restart: on-failure
entrypoint: "sh -c 'sleep 20; lnd --listen=lnd-2:9735 --rpclisten=lnd-2:10009 --restlisten=lnd-2:8081 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=bitcoind --bitcoind.zmqpubrawtx=bitcoind:29000 --bitcoind.zmqpubrawblock=bitcoind:29001 --bitcoind.rpcuser=lnbits --bitcoind.rpcpass=lnbits --noseedbackup --protocol.wumbo-channels'"
expose:
@ -106,7 +106,7 @@ services:
hostname: lnd-3
depends_on:
- bitcoind
image: boltz/lnd:0.15.2-beta
image: boltz/lnd:0.15.5-beta
restart: on-failure
entrypoint: "sh -c 'sleep 20; lnd --listen=lnd-3:9735 --rpclisten=lnd-3:10009 --restlisten=lnd-3:8081 --bitcoin.active --bitcoin.regtest --bitcoin.node=bitcoind --bitcoind.rpchost=bitcoind --bitcoind.zmqpubrawtx=bitcoind:29000 --bitcoind.zmqpubrawblock=bitcoind:29001 --bitcoind.rpcuser=lnbits --bitcoind.rpcpass=lnbits --noseedbackup --protocol.wumbo-channels'"
expose:
@ -116,6 +116,19 @@ services:
volumes:
- ./data/lnd-3:/root/.lnd/
eclair:
hostname: eclair
depends_on:
- bitcoind
image: boltz/eclair:0.8.0
restart: on-failure
entrypoint: "sh -c 'sleep 20; /eclair-node/bin/eclair-node.sh -Declair.datadir=/root/eclair -Declair.printToConsole'"
expose:
- 9735
- 8080
volumes:
- ./data/eclair:/root/eclair
electrs:
depends_on:
- bitcoind

View file

@ -19,6 +19,18 @@ lncli-sim() {
docker exec lnbits-legend-lnd-$i-1 lncli --network regtest --rpcserver=lnd-$i:10009 $@
}
get-eclair-pubkey() {
while true; do
pubkey=$(docker exec -it lnbits-legend-eclair-1 curl http://localhost:8080/getinfo -X POST -u :lnbits 2> /dev/null | jq -r .nodeId 2> /dev/null)
pubkeyPrefix=$(echo $pubkey | cut -c1,2)
if [[ "$pubkeyPrefix" == "02" || "$pubkeyPrefix" == "03" ]]; then
echo $pubkey
break
fi
sleep 1
done
}
# args(i)
fund_clightning_node() {
address=$(lightning-cli-sim $1 newaddr | jq -r .bech32)
@ -54,7 +66,7 @@ lnbits-regtest-start-log(){
lnbits-regtest-stop(){
docker compose down --volumes
# clean up lightning node data
sudo rm -rf ./data/clightning-1 ./data/clightning-2 ./data/lnd-1 ./data/lnd-2 ./data/lnd-3 ./data/boltz/boltz.db
sudo rm -rf ./data/clightning-1 ./data/clightning-2 ./data/lnd-1 ./data/lnd-2 ./data/lnd-3 ./data/boltz/boltz.db ./data/eclair/regtest
# recreate lightning node data folders preventing permission errors
mkdir ./data/clightning-1 ./data/clightning-2 ./data/lnd-1 ./data/lnd-2 ./data/lnd-3
}
@ -157,6 +169,13 @@ lnbits-lightning-init(){
echo "open channel from cln-1 to cln-2"
lightning-cli-sim 1 fundchannel -k id=$peerid amount=$channel_size push_msat=$balance_size_msat > /dev/null
# lnd-1 -> eclair-1
lncli-sim 1 connect $(get-eclair-pubkey)@lnbits-legend-eclair-1 > /dev/null
echo "open channel from lnd-1 to eclair-1"
lncli-sim 1 openchannel $(get-eclair-pubkey) $channel_size $balance_size > /dev/null
bitcoin-cli-sim -generate 10 > /dev/null
wait-for-lnd-channel 1
bitcoin-cli-sim -generate 10 > /dev/null
wait-for-clightning-channel 1

8
tests
View file

@ -20,7 +20,7 @@ run(){
}
failed="false"
blockheight=230
blockheight=240
utxos=5
channel_size=24000000 # 0.024 btc
balance_size=12000000 # 0.012 btc
@ -36,7 +36,9 @@ for i in 1 2 3; do
run "lnd-$i .synced_to_chain" "true" $(lncli-sim $i getinfo | jq -r ".synced_to_chain")
run "lnd-$i utxo count" $utxos $(lncli-sim $i listunspent | jq -r ".utxos | length")
run "lnd-$i .block_height" $blockheight $(lncli-sim $i getinfo | jq -r ".block_height")
if [[ "$i" == "2" ]]; then
if [[ "$i" == "1" ]]; then
channel_count=4
elif [[ "$i" == "2" ]]; then
channel_count=2
else
channel_count=3
@ -55,6 +57,8 @@ for i in 1 2; do
run "cln-$i channel[0].channel_sat" $balance_size $(lightning-cli-sim $i listfunds | jq -r ".channels[0].channel_sat")
done
run "eclair-1 openchannels" 1 $(docker exec -it lnbits-legend-eclair-1 curl http://localhost:8080/channels -X POST -u :lnbits | jq '. | length')
run "boltz service status" "200" $(curl -s -o /dev/null --head -w "%{http_code}" "http://localhost:9001/version")
run "mempool service status" "200" $(curl -s -o /dev/null --head -w "%{http_code}" "http://localhost:8080/")
run "lnbits service status" "200" $(curl -s -o /dev/null -w "%{http_code}" "http://localhost:5001/")