Skip to content

Commit

Permalink
Reth version check uses stack-local volume (#1810)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorickdowne authored Apr 29, 2024
1 parent 8dc3152 commit f4d67ee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ethd
Original file line number Diff line number Diff line change
Expand Up @@ -695,12 +695,12 @@ delete_reth() {
return 0
fi

if [ -z "$(dodocker volume ls -q -f "name=reth-el-data")" ]; then # No Reth volume
if [ -z "$(dodocker volume ls -q -f "name=$(basename "$(realpath .)")[_-]reth-el-data")" ]; then # No Reth volume
return 0
fi

# Check Reth db version
__db_version="$(dodocker run --rm -v "$(dodocker volume ls -q -f "name=reth-el-data")":"/var/lib/reth" \
__db_version="$(dodocker run --rm -v "$(dodocker volume ls -q -f "name=$(basename "$(realpath .)")[_-]reth-el-data")":"/var/lib/reth" \
alpine:3 cat /var/lib/reth/db/database.version)"
if [ "${__db_version}" -ne "1" ]; then
return 0
Expand All @@ -720,7 +720,7 @@ delete_reth() {

echo "Stopping Reth container"
docompose stop execution && docompose rm -f execution
dodocker volume rm "$(dodocker volume ls -q -f "name=reth-el-data")"
dodocker volume rm "$(dodocker volume ls -q -f "name=$(basename "$(realpath .)")[_-]reth-el-data")"
echo
echo "Reth stopped and database deleted."
echo
Expand Down

0 comments on commit f4d67ee

Please sign in to comment.