mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-08-31 08:02:25 +02:00
scripts+bw-compatibility-test: run and update Dave with sqlite
This commit is contained in:
@@ -3,6 +3,7 @@ services:
|
|||||||
build:
|
build:
|
||||||
context: ../../
|
context: ../../
|
||||||
dockerfile: dev.Dockerfile
|
dockerfile: dev.Dockerfile
|
||||||
|
image: lnd-dev:backward-compat-test-build
|
||||||
container_name: bob-pr
|
container_name: bob-pr
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
@@ -40,4 +41,47 @@ services:
|
|||||||
--protocol.option-scid-alias
|
--protocol.option-scid-alias
|
||||||
--protocol.zero-conf
|
--protocol.zero-conf
|
||||||
--protocol.simple-taproot-chans
|
--protocol.simple-taproot-chans
|
||||||
--trickledelay=50
|
--trickledelay=50
|
||||||
|
|
||||||
|
dave-pr:
|
||||||
|
image: lnd-dev:backward-compat-test-build
|
||||||
|
container_name: dave-pr
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- 10014:10009
|
||||||
|
- 9744:9735
|
||||||
|
- 8094:8080
|
||||||
|
networks:
|
||||||
|
regtest:
|
||||||
|
aliases:
|
||||||
|
- dave
|
||||||
|
volumes:
|
||||||
|
- "dave:/root/.lnd"
|
||||||
|
depends_on:
|
||||||
|
- bitcoind
|
||||||
|
command: >
|
||||||
|
lnd
|
||||||
|
--logdir=/root/.lnd
|
||||||
|
--alias=dave
|
||||||
|
--rpclisten=0.0.0.0:10009
|
||||||
|
--restlisten=0.0.0.0:8080
|
||||||
|
--color=#cccccc
|
||||||
|
--noseedbackup
|
||||||
|
--bitcoin.active
|
||||||
|
--bitcoin.regtest
|
||||||
|
--bitcoin.node=bitcoind
|
||||||
|
--bitcoind.rpchost=bitcoind
|
||||||
|
--bitcoind.rpcuser=lightning
|
||||||
|
--bitcoind.rpcpass=lightning
|
||||||
|
--bitcoind.zmqpubrawblock=tcp://bitcoind:28332
|
||||||
|
--bitcoind.zmqpubrawtx=tcp://bitcoind:28333
|
||||||
|
--debuglevel=debug
|
||||||
|
--externalip=dave
|
||||||
|
--tlsextradomain=dave
|
||||||
|
--accept-keysend
|
||||||
|
--protocol.option-scid-alias
|
||||||
|
--protocol.zero-conf
|
||||||
|
--protocol.simple-taproot-chans
|
||||||
|
--trickledelay=50
|
||||||
|
--db.backend=sqlite
|
||||||
|
--db.use-native-sql
|
||||||
|
@@ -185,6 +185,8 @@ services:
|
|||||||
- "--tlsextradomain=dave"
|
- "--tlsextradomain=dave"
|
||||||
- "--accept-keysend"
|
- "--accept-keysend"
|
||||||
- "--trickledelay=50"
|
- "--trickledelay=50"
|
||||||
|
- "--db.backend=sqlite"
|
||||||
|
- "--db.use-native-sql"
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
regtest:
|
regtest:
|
||||||
|
@@ -5,28 +5,35 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
|
|
||||||
source "$DIR/.env"
|
source "$DIR/.env"
|
||||||
|
|
||||||
# Global variable to keep track of which Bob container to use.
|
# Global variables to keep track of which Bob and Dave container
|
||||||
# Once Bob is upgraded to the PR version, this variable must
|
# to use. Once Bob and Dave is upgraded to the PR version, this
|
||||||
# be updated to 'bob-pr'.
|
# variable must be updated to 'bob-pr' and 'dave-pr` respectively.
|
||||||
BOB=bob
|
BOB=bob
|
||||||
|
DAVE=dave
|
||||||
|
|
||||||
# upgrade_bob shuts down the stable Bob container, upgrades the
|
# upgrade_node shuts down the stable container for a node (currently
|
||||||
# compose variables to use the PR version of Bob, rebuilds the
|
# Bob or Dave), upgrades the compose variables, rebuilds the PR version,
|
||||||
# Bob container, and starts the PR version of Bob.
|
# and starts it.
|
||||||
function upgrade_bob() {
|
function upgrade_node() {
|
||||||
# Shutdown Bob.
|
local node="$1"
|
||||||
compose_stop bob
|
local pr="${node}-pr"
|
||||||
|
local var_name="$(echo "$node" | tr '[:lower:]' '[:upper:]')"
|
||||||
|
|
||||||
# Upgrade the compose variables so that the Bob configuration
|
# Shutdown the stable node.
|
||||||
|
compose_stop "$node"
|
||||||
|
|
||||||
|
# Upgrade the compose variables so that the node configuration
|
||||||
# is swapped out for the PR version.
|
# is swapped out for the PR version.
|
||||||
compose_upgrade
|
compose_upgrade
|
||||||
export BOB=bob-pr
|
|
||||||
|
|
||||||
# Force the rebuild of the Bob container.
|
# Export the PR version of the node.
|
||||||
compose_rebuild bob-pr
|
export "$var_name"="$pr"
|
||||||
|
|
||||||
# This should now start with the new version of Bob.
|
# Force the rebuild of the PR version of the container.
|
||||||
compose_start bob-pr
|
compose_rebuild "$pr"
|
||||||
|
|
||||||
|
# This should now start the PR version of the node.
|
||||||
|
compose_start "$pr"
|
||||||
}
|
}
|
||||||
|
|
||||||
# wait_for_nodes waits for all the nodes in the argument list to
|
# wait_for_nodes waits for all the nodes in the argument list to
|
||||||
@@ -333,5 +340,10 @@ function charlie() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function dave() {
|
function dave() {
|
||||||
docker exec -i dave lncli --network regtest "$@"
|
docker exec -i "$DAVE" lncli --network regtest "$@"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function dave-pr() {
|
||||||
|
docker exec -i dave-pr lncli --network regtest "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -36,7 +36,7 @@ send_payment alice dave
|
|||||||
|
|
||||||
# Upgrade the compose variables so that the Bob configuration
|
# Upgrade the compose variables so that the Bob configuration
|
||||||
# is swapped out for the PR version.
|
# is swapped out for the PR version.
|
||||||
upgrade_bob
|
upgrade_node bob
|
||||||
|
|
||||||
# Wait for Bob to start.
|
# Wait for Bob to start.
|
||||||
wait_for_node bob
|
wait_for_node bob
|
||||||
@@ -50,4 +50,19 @@ send_payment bob dave
|
|||||||
send_payment dave bob
|
send_payment dave bob
|
||||||
send_payment alice dave
|
send_payment alice dave
|
||||||
|
|
||||||
|
# Upgrade the compose variables so that the Dave configuration
|
||||||
|
# is swapped out for the PR version.
|
||||||
|
upgrade_node dave
|
||||||
|
|
||||||
|
wait_for_node dave
|
||||||
|
wait_for_active_chans dave 1
|
||||||
|
|
||||||
|
# Show that Dave is now running the current branch.
|
||||||
|
do_for print_version dave
|
||||||
|
|
||||||
|
# Repeat the basic tests (after potential migraton).
|
||||||
|
send_payment bob dave
|
||||||
|
send_payment dave bob
|
||||||
|
send_payment alice dave
|
||||||
|
|
||||||
echo "🛡️⚔️🫡 Backwards compatibility test passed! 🫡⚔️🛡️"
|
echo "🛡️⚔️🫡 Backwards compatibility test passed! 🫡⚔️🛡️"
|
||||||
|
Reference in New Issue
Block a user