Skip to content

Commit a427a87

Browse files
committed
scripts+bw-compatibility-test: run and update Dave with sqlite
1 parent be2bab9 commit a427a87

File tree

4 files changed

+91
-18
lines changed

4 files changed

+91
-18
lines changed

scripts/bw-compatibility-test/docker-compose.override.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ services:
33
build:
44
context: ../../
55
dockerfile: dev.Dockerfile
6+
image: lnd-dev:backward-compat-test-build
67
container_name: bob-pr
78
restart: unless-stopped
89
ports:
@@ -40,4 +41,47 @@ services:
4041
--protocol.option-scid-alias
4142
--protocol.zero-conf
4243
--protocol.simple-taproot-chans
43-
--trickledelay=50
44+
--trickledelay=50
45+
46+
dave-pr:
47+
image: lnd-dev:backward-compat-test-build
48+
container_name: dave-pr
49+
restart: unless-stopped
50+
ports:
51+
- 10014:10009
52+
- 9744:9735
53+
- 8094:8080
54+
networks:
55+
regtest:
56+
aliases:
57+
- dave
58+
volumes:
59+
- "dave:/root/.lnd"
60+
depends_on:
61+
- bitcoind
62+
command: >
63+
lnd
64+
--logdir=/root/.lnd
65+
--alias=dave
66+
--rpclisten=0.0.0.0:10009
67+
--restlisten=0.0.0.0:8080
68+
--color=#cccccc
69+
--noseedbackup
70+
--bitcoin.active
71+
--bitcoin.regtest
72+
--bitcoin.node=bitcoind
73+
--bitcoind.rpchost=bitcoind
74+
--bitcoind.rpcuser=lightning
75+
--bitcoind.rpcpass=lightning
76+
--bitcoind.zmqpubrawblock=tcp://bitcoind:28332
77+
--bitcoind.zmqpubrawtx=tcp://bitcoind:28333
78+
--debuglevel=debug
79+
--externalip=dave
80+
--tlsextradomain=dave
81+
--accept-keysend
82+
--protocol.option-scid-alias
83+
--protocol.zero-conf
84+
--protocol.simple-taproot-chans
85+
--trickledelay=50
86+
--db.backend=sqlite
87+
--db.use-native-sql

scripts/bw-compatibility-test/docker-compose.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@ services:
185185
- "--tlsextradomain=dave"
186186
- "--accept-keysend"
187187
- "--trickledelay=50"
188+
- "--db.backend=sqlite"
189+
- "--db.use-native-sql"
188190

189191
networks:
190192
regtest:

scripts/bw-compatibility-test/network.sh

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,35 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
55

66
source "$DIR/.env"
77

8-
# Global variable to keep track of which Bob container to use.
9-
# Once Bob is upgraded to the PR version, this variable must
10-
# be updated to 'bob-pr'.
8+
# Global variables to keep track of which Bob and Dave container
9+
# to use. Once Bob and Dave is upgraded to the PR version, this
10+
# variable must be updated to 'bob-pr' and 'dave-pr` respectively.
1111
BOB=bob
12+
DAVE=dave
1213

13-
# upgrade_bob shuts down the stable Bob container, upgrades the
14-
# compose variables to use the PR version of Bob, rebuilds the
15-
# Bob container, and starts the PR version of Bob.
16-
function upgrade_bob() {
17-
# Shutdown Bob.
18-
compose_stop bob
14+
# upgrade_node shuts down the stable container for a node (currently
15+
# Bob or Dave), upgrades the compose variables, rebuilds the PR version,
16+
# and starts it.
17+
function upgrade_node() {
18+
local node="$1"
19+
local pr="${node}-pr"
20+
local var_name="$(echo "$node" | tr '[:lower:]' '[:upper:]')"
21+
22+
# Shutdown the stable node.
23+
compose_stop "$node"
1924

20-
# Upgrade the compose variables so that the Bob configuration
25+
# Upgrade the compose variables so that the node configuration
2126
# is swapped out for the PR version.
2227
compose_upgrade
23-
export BOB=bob-pr
2428

25-
# Force the rebuild of the Bob container.
26-
compose_rebuild bob-pr
29+
# Export the PR version of the node.
30+
export "$var_name"="$pr"
31+
32+
# Force the rebuild of the PR version of the container.
33+
compose_rebuild "$pr"
2734

28-
# This should now start with the new version of Bob.
29-
compose_start bob-pr
35+
# This should now start the PR version of the node.
36+
compose_start "$pr"
3037
}
3138

3239
# wait_for_nodes waits for all the nodes in the argument list to
@@ -333,5 +340,10 @@ function charlie() {
333340
}
334341

335342
function dave() {
336-
docker exec -i dave lncli --network regtest "$@"
343+
docker exec -i "$DAVE" lncli --network regtest "$@"
337344
}
345+
346+
function dave-pr() {
347+
docker exec -i dave-pr lncli --network regtest "$@"
348+
}
349+

scripts/bw-compatibility-test/test.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ send_payment alice dave
3636

3737
# Upgrade the compose variables so that the Bob configuration
3838
# is swapped out for the PR version.
39-
upgrade_bob
39+
upgrade_node bob
4040

4141
# Wait for Bob to start.
4242
wait_for_node bob
@@ -50,4 +50,19 @@ send_payment bob dave
5050
send_payment dave bob
5151
send_payment alice dave
5252

53+
# Upgrade the compose variables so that the Dave configuration
54+
# is swapped out for the PR version.
55+
upgrade_node dave
56+
57+
wait_for_node dave
58+
wait_for_active_chans dave 1
59+
60+
# Show that Dave is now running the current branch.
61+
do_for print_version dave
62+
63+
# Repeat the basic tests (after potential migraton).
64+
send_payment bob dave
65+
send_payment dave bob
66+
send_payment alice dave
67+
5368
echo "🛡️⚔️🫡 Backwards compatibility test passed! 🫡⚔️🛡️"

0 commit comments

Comments
 (0)