-
Notifications
You must be signed in to change notification settings - Fork 32
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
Tung/add wasm client wasmvm v2.0.0 #168
Merged
hoank101
merged 8 commits into
eve-network:main
from
tungleanh0902:tung/add_wasm_client_wasmvm_v2.0.0
Mar 14, 2024
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d3b8623
feat/add_wasm_light_client
tungleanh0902 0152819
feat/add wasm light client
tungleanh0902 0057a9c
feat: add wasm client without interchain security
tungleanh0902 9860790
fix duplicate wasmvm
tungleanh0902 5d4287f
fix: replace remote package
tungleanh0902 677f258
fix: lint
tungleanh0902 663104b
fix: update sdk version
tungleanh0902 0e5e963
fix: replace wasmvm version
tungleanh0902 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
FROM golang:1.21-alpine3.18 as builder | ||
|
||
ARG LIBWASM_VERSION | ||
ARG LIBWASM_CHECKSUM | ||
|
||
RUN test -n "${LIBWASM_VERSION}" | ||
RUN test -n "${LIBWASM_CHECKSUM}" | ||
|
||
RUN set -eux; apk add --no-cache git libusb-dev linux-headers gcc musl-dev make; | ||
|
||
ENV GOPATH="" | ||
|
||
# Grab the static library and copy it to location that will be found by the linker flag `-lwasmvm_muslc`. | ||
ADD https://github.com/CosmWasm/wasmvm/releases/download/${LIBWASM_VERSION}/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.x86_64.a | ||
RUN sha256sum /lib/libwasmvm_muslc.x86_64.a | grep ${LIBWASM_CHECKSUM} | ||
RUN cp /lib/libwasmvm_muslc.x86_64.a /lib/libwasmvm_muslc.a | ||
|
||
# Copy relevant files before go mod download. Replace directives to local paths break if local | ||
# files are not copied before go mod download. | ||
ADD internal internal | ||
ADD testing testing | ||
ADD modules modules | ||
ADD LICENSE LICENSE | ||
|
||
COPY go.mod . | ||
COPY go.sum . | ||
|
||
WORKDIR /go/modules/light-clients/08-wasm | ||
|
||
RUN go mod download | ||
|
||
RUN GOOS=linux GOARCH=amd64 go build -mod=readonly -tags "netgo ledger muslc" -ldflags '-X github.com/cosmos/cosmos-sdk/version.Name=sim -X github.com/cosmos/cosmos-sdk/version.AppName=simd -X github.com/cosmos/cosmos-sdk/version.Version= -X github.com/cosmos/cosmos-sdk/version.Commit= -X "github.com/cosmos/cosmos-sdk/version.BuildTags=netgo ledger muslc," -w -s -linkmode=external -extldflags "-Wl,-z,muldefs -static"' -trimpath -o /go/build/ ./... | ||
|
||
FROM alpine:3.18 | ||
|
||
COPY --from=builder /go/build/simd /bin/simd | ||
|
||
ENTRYPOINT ["simd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Downloading and verifying the
libwasmvm_muslc.x86_64.a
library directly from GitHub ensures that the specific version of wasmvm is used. This is a secure practice as it uses checksum verification. However, consider handling potential download failures or checksum mismatches more gracefully.