Skip to content

Commit

Permalink
added wasm to cosmovisor upgrade image (#1158)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampocs authored Mar 21, 2024
1 parent f2f54aa commit c4eb187
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions dockernet/upgrades/Dockerfile.cosmovisor
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c4eb187

Please sign in to comment.