Skip to content

Commit 716b468

Browse files
authored
Merge pull request #2778 from input-output-hk/djo/2679/ci/test-client-check-fast-bootstrap-after-lmdb-conversion
ci(test-client): check fast bootstrap after lmdb conversion
2 parents b9f2466 + 87e278d commit 716b468

File tree

2 files changed

+224
-176
lines changed

2 files changed

+224
-176
lines changed

.github/workflows/scripts/verify-cardano-db-restoration.sh

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ if [[ ! -f "$1" ]]; then
1414
exit 1
1515
fi
1616

17-
CLIENT_CMD_OUTPUT=$(cat "$1")
18-
INCLUDE_ANCILLARY="$2"
17+
CLIENT_CMD_OUTPUT=$(cat "$1"); shift
18+
INCLUDE_ANCILLARY="false"
19+
LEDGER_BACKEND="in-memory"
20+
21+
while [[ "$#" -gt 0 ]]; do
22+
case $1 in
23+
--include-ancillary) INCLUDE_ANCILLARY="true" ;;
24+
--ledger-backend) LEDGER_BACKEND="$2"; shift ;;
25+
esac
26+
shift
27+
done
1928

2029
DOCKER_CMD=$(echo "$CLIENT_CMD_OUTPUT" | grep -E '^\s*docker run')
2130
if [[ -z "$DOCKER_CMD" ]]; then
@@ -26,6 +35,11 @@ fi
2635
echo "Extracted Docker command:"
2736
echo "$DOCKER_CMD"
2837

38+
# Note: ledger conversion to lmdb can only be executed if ancillary files are included
39+
if [[ ${LEDGER_BACKEND,,} == "lmdb" && "$INCLUDE_ANCILLARY" == "true" ]]; then
40+
DOCKER_CMD="${DOCKER_CMD/ ghcr/" -e CARDANO_CONFIG_JSON_MERGE='{\"LedgerDB\":{\"Backend\":\"V1LMDB\"}}' ghcr"}"
41+
fi
42+
2943
DOCKER_CMD_DETACHED="${DOCKER_CMD/docker run/docker run -d}"
3044
echo "Running Docker command in detached mode:"
3145
echo "$DOCKER_CMD_DETACHED"
@@ -58,7 +72,7 @@ else
5872
exit 1
5973
fi
6074

61-
if [[ "$INCLUDE_ANCILLARY" == "--include-ancillary" ]]; then
75+
if [[ "$INCLUDE_ANCILLARY" == "true" ]]; then
6276
echo "Parameter '--include-ancillary' is set."
6377
if wait_for_log "$CONTAINER_ID" 30 "Chain extended, new tip"; then
6478
echo "✅ The Cardano node started successfully from the Mithril snapshot with the ancillary files."

0 commit comments

Comments
 (0)