File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM ghcr.io/evstack/ev-reth:latest
2+
3+ ARG LIBMDBX_REPO=https://github.com/erthink/libmdbx.git
4+ ARG LIBMDBX_REF=master
5+
6+ RUN set -eux; \
7+ apt-get update; \
8+ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
9+ build-essential \
10+ ca-certificates \
11+ cmake \
12+ git \
13+ jq \
14+ ; \
15+ rm -rf /var/lib/apt/lists/*
16+
17+ RUN set -eux; \
18+ git clone --depth 1 --branch "${LIBMDBX_REF}" "${LIBMDBX_REPO}" /tmp/libmdbx; \
19+ cmake -S /tmp/libmdbx -B /tmp/libmdbx/build -DCMAKE_BUILD_TYPE=Release; \
20+ cmake --build /tmp/libmdbx/build --target mdbx_copy mdbx_dump mdbx_chk; \
21+ install -m 0755 /tmp/libmdbx/build/mdbx_copy /usr/local/bin/mdbx_copy; \
22+ install -m 0755 /tmp/libmdbx/build/mdbx_dump /usr/local/bin/mdbx_dump; \
23+ install -m 0755 /tmp/libmdbx/build/mdbx_chk /usr/local/bin/mdbx_chk; \
24+ rm -rf /tmp/libmdbx
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ require_cmd() {
3737 if ! command -v " $1 " > /dev/null 2>&1 ; then
3838 echo " error: required command '$1 ' not found in PATH" >&2
3939 exit 1
40- }
40+ fi
4141}
4242
4343DEST=" "
@@ -123,14 +123,14 @@ if ! docker exec "$CONTAINER" bash -lc "command -v '$MDBX_COPY' >/dev/null 2>&1
123123fi
124124
125125echo " Running mdbx_copy inside container..."
126- docker exec " $CONTAINER " bash -lc " '$MDBX_COPY ' --compact '${DATADIR} /db' '$REMOTE_TMP /db/mdbx.dat'"
126+ docker exec " $CONTAINER " bash -lc " '$MDBX_COPY ' -c '${DATADIR} /db' '$REMOTE_TMP /db/mdbx.dat'"
127127docker exec " $CONTAINER " bash -lc " touch '$REMOTE_TMP /db/mdbx.lck'"
128128
129129echo " Copying static_files..."
130130docker exec " $CONTAINER " bash -lc " if [ -d '${DATADIR} /static_files' ]; then cp -a '${DATADIR} /static_files/.' '$REMOTE_TMP /static_files/' 2>/dev/null || true; fi"
131131
132132echo " Querying StageCheckpoints height..."
133- STAGE_JSON=$( docker exec " $CONTAINER " ev-reth db --datadir " $REMOTE_TMP " list StageCheckpoints --len 20 --json)
133+ STAGE_JSON=$( docker exec " $CONTAINER " ev-reth db --datadir " $REMOTE_TMP " list StageCheckpoints --len 20 --json | sed -n ' /^\[/,$p ' )
134134HEIGHT=$( echo " $STAGE_JSON " | jq -r ' .[] | select(.[0]=="Finish") | .[1].block_number' | tr -d ' \r\n' )
135135
136136if [[ -z " $HEIGHT " || " $HEIGHT " == " null" ]]; then
You can’t perform that action at this time.
0 commit comments