Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install lz4 in Docker image #7

Merged
merged 6 commits into from
Nov 7, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FROM debian:bookworm AS base
ENV PATH=/root/.zetacored/cosmovisor/current/bin/:${PATH}

RUN apt update && \
apt install -y ca-certificates curl jq && \
apt install -y ca-certificates curl jq lz4 && \
rm -rf /var/lib/apt/lists/*

COPY --from=base-build /go/bin/cosmovisor /go/bin/go-getter /go/bin/dl-pipe /usr/local/bin
Expand All @@ -23,9 +23,9 @@ FROM base AS snapshotter
ARG TARGETARCH

RUN apt update && \
apt install -y rclone procps && \
apt install -y rclone procps lz4 && \
rm -rf /var/lib/apt/lists/*

RUN ARCH=$( [ "$TARGETARCH" = "amd64" ] && echo "x86_64" || echo "$TARGETARCH" ) && \
curl -L https://github.com/zeta-chain/cosmprund/releases/download/v0.2.0-zeta/cosmprund_Linux_${ARCH}.tar.gz | tar xz -C /usr/local/bin/ cosmprund &&\
chmod +x /usr/local/bin/cosmprund
chmod +x /usr/local/bin/cosmprund
10 changes: 5 additions & 5 deletions init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ elif [[ "$ZETACHAIN_NETWORK" == "testnet" || "$ZETACHAIN_NETWORK" == "athens3" ]
ZETACHAIN_INIT_API_URL=${ZETACHAIN_INIT_API_URL:-"https://zetachain-athens.g.allthatnode.com/archive/rest"}
ZETACHAIN_SNAPSHOT_METADATA_URL=${ZETACHAIN_SNAPSHOT_METADATA_URL:-"https://snapshots.rpc.zetachain.com/testnet/${ZETACHAIN_SNAPSHOT_TYPE}/latest.json"}
ZETACHAIN_NETWORK_CONFIG_URL_BASE=${ZETACHAIN_NETWORK_CONFIG_URL_BASE:-"https://raw.githubusercontent.com/zeta-chain/network-config/main/athens3"}
else
else
echo "Invalid network"
exit 1
fi
Expand Down Expand Up @@ -81,7 +81,7 @@ install_genesis_zetacored() {
.proposals[] |
select(.status == "PROPOSAL_STATUS_PASSED") |
.messages[] |
select(."@type" == "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade" and (.plan.height |
select(."@type" == "/cosmos.upgrade.v1beta1.MsgSoftwareUpgrade" and (.plan.height |
tonumber < $max_height))' | jq -s '.[0]' | tee /tmp/init-upgrade-plan.json

ZETACORED_BINARY_URL=$(jq -r '.plan.info' /tmp/init-upgrade-plan.json | jq -r ".binaries[\"linux/$GOARCH\"]")
Expand All @@ -100,7 +100,7 @@ restore_snapshot() {
snapshot_md5=$(echo "$snapshot" | jq -r '.checksums.md5')
echo "Restoring snapshot from ${snapshot_link}"
# https://github.com/zeta-chain/dl-pipe
dl-pipe -hash "md5:${snapshot_md5}" "$snapshot_link" | tar x -C $HOME/.zetacored
dl-pipe -hash "md5:${snapshot_md5}" "$snapshot_link" | tar -I lz4 -x -C $HOME/.zetacored
julianrubino marked this conversation as resolved.
Show resolved Hide resolved
}

cd $HOME
Expand All @@ -117,9 +117,9 @@ if [[ ! -f /root/init_completed ]]; then
install_genesis_zetacored
restore_snapshot
touch /root/init_completed
else
else
echo "Initialization already completed"
fi

# always set IP address as it may change after restart
sed -i -e "s/^external_address = .*/external_address = \"${MY_IP}:26656\"/" .zetacored/config/config.toml
sed -i -e "s/^external_address = .*/external_address = \"${MY_IP}:26656\"/" .zetacored/config/config.toml