From 13d6ec8cb9b8b2255dc020e274b5c2eb68b30a6c Mon Sep 17 00:00:00 2001 From: sampocs Date: Thu, 21 Mar 2024 11:03:11 -0500 Subject: [PATCH] added wasm to cosmovisor image --- dockernet/upgrades/Dockerfile.cosmovisor | 28 ++++++++++++++---------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/dockernet/upgrades/Dockerfile.cosmovisor b/dockernet/upgrades/Dockerfile.cosmovisor index 89dfedebcd..6b4713a2d0 100644 --- a/dockernet/upgrades/Dockerfile.cosmovisor +++ b/dockernet/upgrades/Dockerfile.cosmovisor @@ -15,14 +15,20 @@ RUN git clone https://github.com/cosmos/cosmos-sdk \ && git checkout cosmovisor/v1.1.0 RUN --mount=type=cache,target=/root/.cache/go-build cd /opt/cosmos-sdk && make cosmovisor -# Build the old binary -RUN git clone https://github.com/Stride-Labs/stride.git \ - && cd stride \ - && git checkout $old_commit_hash \ - && sed -i -E "s|stride1k8c2m5cn322akk5wy8lpt87dd2f4yh9azg7jlh|$stride_admin_address|g" utils/admins.go \ - && env GOOS=linux GOARCH=amd64 go build -mod=readonly -trimpath -o /opt/build/ ./... \ - && mv /opt/build/strided /opt/build/strided1 - -RUN --mount=type=cache,target=/root/.cache/go-build cd /opt/stride && make build - - +# Download stride and checkout the old version +RUN git clone https://github.com/Stride-Labs/stride.git +WORKDIR /opt/stride + +RUN git checkout $old_commit_hash \ + && sed -i -E "s|stride1k8c2m5cn322akk5wy8lpt87dd2f4yh9azg7jlh|$stride_admin_address|g" utils/admins.go + +# Install wasm +RUN WASMVM_VERSION=$(cat go.mod | grep github.com/CosmWasm/wasmvm | awk '{print $2}') \ + && wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$(uname -m).a \ + -O /lib/libwasmvm_muslc.a + +# Build the old stride binary +RUN --mount=type=cache,target=/root/.cache/go-build \ + BUILD_TAGS=muslc LINK_STATICALLY=true make build \ + && mkdir /opt/build \ + && mv /opt/stride/build/strided /opt/build/strided1