diff --git a/README.md b/README.md index 818c82a..191b165 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ * cln-2: used for clightning-REST * eclair-1: for locally testing your current lnbits -# Installing regtest +# Installing regtest get the regtest enviroment ready ```sh # Install docker https://docs.docker.com/engine/install/ @@ -18,7 +18,7 @@ get the regtest enviroment ready sudo apt install jq git clone https://github.com/lnbits/lnbits.git cd lnbits -docker build -t lnbitsdocker/lnbits . +docker build -t lnbits/lnbits . mkdir docker git clone https://github.com/lnbits/legend-regtest-enviroment.git docker cd docker @@ -35,12 +35,12 @@ DEBUG=true # LND LNBITS_BACKEND_WALLET_CLASS="LndRestWallet" LND_REST_ENDPOINT=https://127.0.0.1:8081/ -LND_REST_CERT=/home/user/repos/lnbits-legend/docker/data/lnd-1/tls.cert -LND_REST_MACAROON=/home/user/repos/lnbits-legend/docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon +LND_REST_CERT=/home/user/repos/lnbits/docker/data/lnd-1/tls.cert +LND_REST_MACAROON=/home/user/repos/lnbits/docker/data/lnd-1/data/chain/bitcoin/regtest/admin.macaroon # CLN LNBITS_BACKEND_WALLET_CLASS="CoreLightningWallet" -CORELIGHTNING_RPC=./docker/data/clightning-1/regtest/lightning-rpc +CORELIGHTNING_RPC=./docker/data/clightning-1/regtest/lightning-rpc # Run LNbits @@ -83,8 +83,8 @@ lncli-sim 2 listpeers # debugging docker logs ```sh -docker logs lnbits-legend-lnbits-1 -f -docker logs lnbits-legend-boltz-1 -f -docker logs lnbits-legend-clightning-1-1 -f -docker logs lnbits-legend-lnd-2-1 -f +docker logs lnbits-lnbits-1 -f +docker logs lnbits-boltz-1 -f +docker logs lnbits-clightning-1-1 -f +docker logs lnbits-lnd-2-1 -f ``` diff --git a/docker-compose.yml b/docker-compose.yml index f854fdb..cd15f32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,7 @@ services: hostname: lnbits depends_on: - lnd-3 - image: lnbitsdocker/lnbits-legend + image: lnbits/lnbits restart: on-failure user: "0:0" entrypoint: "sh -c 'sleep 30; poetry run lnbits'" diff --git a/docker-scripts.sh b/docker-scripts.sh index 5d8c3c9..d65adac 100644 --- a/docker-scripts.sh +++ b/docker-scripts.sh @@ -1,27 +1,27 @@ #!/bin/sh -export COMPOSE_PROJECT_NAME=lnbits-legend +export COMPOSE_PROJECT_NAME=lnbits bitcoin-cli-sim() { - docker exec lnbits-legend-bitcoind-1 bitcoin-cli -rpcuser=lnbits -rpcpassword=lnbits -regtest "$@" + docker exec lnbits-bitcoind-1 bitcoin-cli -rpcuser=lnbits -rpcpassword=lnbits -regtest "$@" } # args(i, cmd) lightning-cli-sim() { i=$1 shift # shift first argument so we can use $@ - docker exec lnbits-legend-clightning-$i-1 lightning-cli --network regtest "$@" + docker exec lnbits-clightning-$i-1 lightning-cli --network regtest "$@" } # args(i, cmd) lncli-sim() { i=$1 shift # shift first argument so we can use $@ - docker exec lnbits-legend-lnd-$i-1 lncli --network regtest --rpcserver=lnd-$i:10009 "$@" + docker exec lnbits-lnd-$i-1 lncli --network regtest --rpcserver=lnd-$i:10009 "$@" } get-eclair-pubkey() { while true; do - pubkey=$(docker exec lnbits-legend-eclair-1 curl http://localhost:8080/getinfo -X POST -s -u :lnbits | jq -r .nodeId 2> /dev/null) + pubkey=$(docker exec lnbits-eclair-1 curl http://localhost:8080/getinfo -X POST -s -u :lnbits | jq -r .nodeId 2> /dev/null) pubkeyPrefix=$(echo $pubkey | cut -c1,2) if [[ "$pubkeyPrefix" == "02" || "$pubkeyPrefix" == "03" ]]; then echo $pubkey @@ -33,8 +33,8 @@ get-eclair-pubkey() { wait-for-eclair-channel() { while true; do - state=$(docker exec lnbits-legend-eclair-1 curl http://localhost:8080/channels -X POST -s -u :lnbits | jq -r ".[0].state") - pending=$(docker exec lnbits-legend-eclair-1 curl -s http://localhost:8080/channels -X POST -u :lnbits| jq '. | length') + state=$(docker exec lnbits-eclair-1 curl http://localhost:8080/channels -X POST -s -u :lnbits | jq -r ".[0].state") + pending=$(docker exec lnbits-eclair-1 curl -s http://localhost:8080/channels -X POST -u :lnbits| jq '. | length') echo "eclair-1 pendingchannels: $pending, current state: $state" if [[ "$state" == "NORMAL" ]]; then break @@ -61,7 +61,7 @@ fund_lnd_node() { # args(i, j) connect_clightning_node() { pubkey=$(lightning-cli-sim $2 getinfo | jq -r '.id') - lightning-cli-sim $1 connect $pubkey@lnbits-legend-clightning-$2-1:9735 | jq -r '.id' + lightning-cli-sim $1 connect $pubkey@lnbits-clightning-$2-1:9735 | jq -r '.id' } lnbits-regtest-start(){ @@ -149,70 +149,70 @@ lnbits-lightning-init(){ balance_size_msat=12000000000 # 0.12 btc # lnd-1 -> lnd-2 - lncli-sim 1 connect $(lncli-sim 2 getinfo | jq -r '.identity_pubkey')@lnbits-legend-lnd-2-1 > /dev/null + lncli-sim 1 connect $(lncli-sim 2 getinfo | jq -r '.identity_pubkey')@lnbits-lnd-2-1 > /dev/null echo "open channel from lnd-1 to lnd-2" lncli-sim 1 openchannel $(lncli-sim 2 getinfo | jq -r '.identity_pubkey') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-1 -> lnd-3 - lncli-sim 1 connect $(lncli-sim 3 getinfo | jq -r '.identity_pubkey')@lnbits-legend-lnd-3-1 > /dev/null + lncli-sim 1 connect $(lncli-sim 3 getinfo | jq -r '.identity_pubkey')@lnbits-lnd-3-1 > /dev/null echo "open channel from lnd-1 to lnd-3" lncli-sim 1 openchannel $(lncli-sim 3 getinfo | jq -r '.identity_pubkey') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-1 -> cln-1 - lncli-sim 1 connect $(lightning-cli-sim 1 getinfo | jq -r '.id')@lnbits-legend-clightning-1-1 > /dev/null + lncli-sim 1 connect $(lightning-cli-sim 1 getinfo | jq -r '.id')@lnbits-clightning-1-1 > /dev/null echo "open channel from lnd-1 to cln-1" lncli-sim 1 openchannel $(lightning-cli-sim 1 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-1 -> cln-2 - lncli-sim 1 connect $(lightning-cli-sim 2 getinfo | jq -r '.id')@lnbits-legend-clightning-2-1 > /dev/null + lncli-sim 1 connect $(lightning-cli-sim 2 getinfo | jq -r '.id')@lnbits-clightning-2-1 > /dev/null echo "open channel from lnd-1 to cln-2" lncli-sim 1 openchannel $(lightning-cli-sim 2 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-1 -> cln-3 - lncli-sim 1 connect $(lightning-cli-sim 3 getinfo | jq -r '.id')@lnbits-legend-clightning-3-1 > /dev/null + lncli-sim 1 connect $(lightning-cli-sim 3 getinfo | jq -r '.id')@lnbits-clightning-3-1 > /dev/null echo "open channel from lnd-1 to cln-3" lncli-sim 1 openchannel $(lightning-cli-sim 3 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-2 -> cln-2 - lncli-sim 2 connect $(lightning-cli-sim 2 getinfo | jq -r '.id')@lnbits-legend-clightning-2-1 > /dev/null + lncli-sim 2 connect $(lightning-cli-sim 2 getinfo | jq -r '.id')@lnbits-clightning-2-1 > /dev/null echo "open channel from lnd-2 to cln-2" lncli-sim 2 openchannel $(lightning-cli-sim 2 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 2 # lnd-3 -> cln-3 - lncli-sim 3 connect $(lightning-cli-sim 3 getinfo | jq -r '.id')@lnbits-legend-clightning-3-1 > /dev/null + lncli-sim 3 connect $(lightning-cli-sim 3 getinfo | jq -r '.id')@lnbits-clightning-3-1 > /dev/null echo "open channel from lnd-3 to cln-1" lncli-sim 3 openchannel $(lightning-cli-sim 3 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 3 # lnd-3 -> cln-1 - lncli-sim 3 connect $(lightning-cli-sim 1 getinfo | jq -r '.id')@lnbits-legend-clightning-1-1 > /dev/null + lncli-sim 3 connect $(lightning-cli-sim 1 getinfo | jq -r '.id')@lnbits-clightning-1-1 > /dev/null echo "open channel from lnd-3 to cln-1" lncli-sim 3 openchannel $(lightning-cli-sim 1 getinfo | jq -r '.id') $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 3 # lnd-1 -> eclair-1 - lncli-sim 1 connect $(get-eclair-pubkey)@lnbits-legend-eclair-1 > /dev/null + lncli-sim 1 connect $(get-eclair-pubkey)@lnbits-eclair-1 > /dev/null echo "open channel from lnd-2 to eclair-1" lncli-sim 1 openchannel $(get-eclair-pubkey) $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null wait-for-lnd-channel 1 # lnd-2 -> eclair-1 - lncli-sim 2 connect $(get-eclair-pubkey)@lnbits-legend-eclair-1 > /dev/null + lncli-sim 2 connect $(get-eclair-pubkey)@lnbits-eclair-1 > /dev/null echo "open channel from lnd-2 to eclair-1" lncli-sim 2 openchannel $(get-eclair-pubkey) $channel_size $balance_size > /dev/null bitcoin-cli-sim -generate $channel_confirms > /dev/null