Skip to content

Commit

Permalink
Upgrade mithril client version (#4890)
Browse files Browse the repository at this point in the history
Version 2445.0 is not compatible anymore with the certificates which
leads to steps failure when trying to restore a DB.
  • Loading branch information
abailly authored Dec 19, 2024
2 parents 5256d98 + b0d264b commit 20d7bb5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 24 deletions.
38 changes: 16 additions & 22 deletions run/common/nix/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ NODE_SOCKET_PATH=${NODE_SOCKET_DIR}/${NODE_SOCKET_NAME}
LOCAL_NODE_CONFIGS=./configs
NODE_CONFIGS=${NODE_CONFIGS:=$LOCAL_NODE_CONFIGS}


# Define the node logs file
LOCAL_NODE_LOGS_FILE=./node.log
NODE_LOGS_FILE="${NODE_LOGS_FILE:=$LOCAL_NODE_LOGS_FILE}"
Expand All @@ -78,34 +77,33 @@ cleanup() {
mithril() {
# shellcheck disable=SC2048
# shellcheck disable=SC2086
nix shell "github:input-output-hk/mithril?ref=2445.0" -c $*
nix shell "github:input-output-hk/mithril?ref=2450.0" -c $*
}

# Trap the cleanup function on exit
trap cleanup ERR INT EXIT
if [[ -z ${NO_NODE-} ]]; then

if [[ -n "${USE_MITHRIL-}" ]];
then
if [ "$NETWORK" != "mainnet" ]; then
echo "Error: This option is only available for the mainnet network"
exit 1
fi
echo "Starting the mithril service..."
rm -rf "${NODE_DB:?}"/*
export AGGREGATOR_ENDPOINT
export GENESIS_VERIFICATION_KEY
mithril echo "mithril is available" || exit 44
digest=$(mithril mithril-client cdb snapshot list --json | jq -r .[0].digest)
(cd "${NODE_DB}" && mithril mithril-client cdb download "$digest")
(cd "${NODE_DB}" && mv db/* . && rmdir db)
if [[ -n "${USE_MITHRIL-}" ]]; then
if [ "$NETWORK" != "mainnet" ]; then
echo "Error: This option is only available for the mainnet network"
exit 1
fi
echo "Starting the mithril service..."
rm -rf "${NODE_DB:?}"/*
export AGGREGATOR_ENDPOINT
export GENESIS_VERIFICATION_KEY
mithril echo "mithril is available" || exit 44
digest=$(mithril mithril-client cdb snapshot list --json | jq -r .[0].digest)
(cd "${NODE_DB}" && mithril mithril-client cdb download "$digest")
(cd "${NODE_DB}" && mv db/* . && rmdir db)
fi

# Start the node with logs redirected to a file if NODE_LOGS_FILE is set
# shellcheck disable=SC2086
cardano-node run \
--topology "${NODE_CONFIGS}"/topology.json \
--database-path "${NODE_DB}"\
--database-path "${NODE_DB}" \
--socket-path "${NODE_SOCKET_PATH}" \
--config "${NODE_CONFIGS}"/config.json \
+RTS -N -A16m -qg -qb -RTS 1>$NODE_LOGS_FILE 2>$NODE_LOGS_FILE &
Expand All @@ -115,13 +113,10 @@ if [[ -z ${NO_NODE-} ]]; then

sleep 10



else
echo "Skipping node service..."
fi


if [[ -z ${NO_WALLET-} ]]; then
echo "Starting the wallet service..."

Expand All @@ -147,7 +142,7 @@ if [[ -z ${NO_WALLET-} ]]; then
--database "${WALLET_DB}" \
--node-socket "${NODE_SOCKET_PATH}" \
--mainnet \
--listen-address 0.0.0.0 >$WALLET_LOGS_FILE 2>&1 &
--listen-address 0.0.0.0 >$WALLET_LOGS_FILE 2>&1 &
WALLET_ID=$!
else
# shellcheck disable=SC2086
Expand All @@ -173,7 +168,6 @@ else
echo "Skipping wallet service..."
fi


# Case statement to handle different command-line arguments
case "$1" in
sync)
Expand Down
2 changes: 1 addition & 1 deletion run/mainnet/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ services:
mithril:
env_file:
- .env
image: ghcr.io/input-output-hk/mithril-client:test-csd-44dc188
image: ghcr.io/input-output-hk/mithril-client:2450.0-c6c7eba
user: ${USER_ID}:${GROUP_ID}
volumes:
- ${NODE_DB}:/app/db
Expand Down
2 changes: 1 addition & 1 deletion scripts/buildkite/admin/refresh-preprod-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export GENESIS_VERIFICATION_KEY=5b3132372c37332c3132342c3136312c362c3133372c3133
mithril() {
# shellcheck disable=SC2048
# shellcheck disable=SC2086
nix shell "github:input-output-hk/mithril?ref=2445.0" -c $*
nix shell "github:input-output-hk/mithril?ref=2450.0" -c $*
}

mithril echo "mithril is available" || exit 44
Expand Down

0 comments on commit 20d7bb5

Please sign in to comment.