Skip to content

Commit

Permalink
Merge pull request #36 from cardano-foundation/feat/is-44-set-up-osmo…
Browse files Browse the repository at this point in the history
…sis-dex-contract

feat: IS-44 set up osmosis and dex contract
  • Loading branch information
dale-smartosc committed May 7, 2024
2 parents 37e34f9 + f2c85ad commit 9ed88b9
Show file tree
Hide file tree
Showing 70 changed files with 8,441 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,14 @@


cardano/gateway/deployment
chains/osmosis/osmosis
chains/osmosis/configuration/cosmwasm/artifacts
chains/osmosis/configuration/cosmwasm/target
chains/osmosis/configuration/.osmosis-local/data
chains/osmosis/configuration/.osmosis-local/keyring-test
chains/osmosis/configuration/.osmosis-local/config/gentx
chains/osmosis/configuration/.osmosis-local/config/client.toml
chains/osmosis/configuration/.osmosis-local/config/node_key.json
chains/osmosis/configuration/.osmosis-local/config/priv_validator_key.json
chains/osmosis/configuration/.osmosis-local/wasm/wasm/cache
chains/osmosis/configuration/.osmosis-local/wasm/wasm/state/wasm
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "chains/osmosis/osmosis"]
path = chains/osmosis/osmosis
url = git@github.com:osmosis-labs/osmosis.git
75 changes: 75 additions & 0 deletions chains/osmosis/configuration/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# syntax=docker/dockerfile:1

ARG GO_VERSION="1.21"
ARG RUNNER_IMAGE="gcr.io/distroless/static-debian11"
ARG BUILD_TAGS="netgo,ledger,muslc"

# --------------------------------------------------------
# Builder
# --------------------------------------------------------

FROM golang:${GO_VERSION}-alpine3.18 as builder

ARG GIT_VERSION
ARG GIT_COMMIT
ARG BUILD_TAGS

RUN apk add --no-cache \
ca-certificates \
build-base \
linux-headers

# Download go dependencies
WORKDIR /osmosis
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
go mod download

# Cosmwasm - Download correct libwasmvm version
RUN ARCH=$(uname -m) && WASMVM_VERSION=$(go list -m github.com/CosmWasm/wasmvm | sed 's/.* //') && \
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/libwasmvm_muslc.$ARCH.a \
-O /lib/libwasmvm_muslc.a && \
# verify checksum
wget https://github.com/CosmWasm/wasmvm/releases/download/$WASMVM_VERSION/checksums.txt -O /tmp/checksums.txt && \
sha256sum /lib/libwasmvm_muslc.a | grep $(cat /tmp/checksums.txt | grep libwasmvm_muslc.$ARCH | cut -d ' ' -f 1)

# Copy the remaining files
COPY . .

# Build osmosisd binary
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/root/go/pkg/mod \
GOWORK=off go build \
-mod=readonly \
-tags ${BUILD_TAGS} \
-ldflags \
"-X github.com/cosmos/cosmos-sdk/version.Name="osmosis" \
-X github.com/cosmos/cosmos-sdk/version.AppName="osmosisd" \
-X github.com/cosmos/cosmos-sdk/version.Version=${GIT_VERSION} \
-X github.com/cosmos/cosmos-sdk/version.Commit=${GIT_COMMIT} \
-X github.com/cosmos/cosmos-sdk/version.BuildTags=${BUILD_TAGS} \
-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \
-trimpath \
-o /osmosis/build/osmosisd \
/osmosis/cmd/osmosisd/main.go

# --------------------------------------------------------
# Runner
# --------------------------------------------------------

FROM ${RUNNER_IMAGE}

COPY --from=builder /osmosis/build/osmosisd /bin/osmosisd

ENV HOME /osmosis
WORKDIR $HOME

EXPOSE 26656
EXPOSE 26658
EXPOSE 1318
# Note: uncomment the line below if you need pprof in localosmosis
# We disable it by default in out main Dockerfile for security reasons
# EXPOSE 6060

ENTRYPOINT ["osmosisd"]

0 comments on commit 9ed88b9

Please sign in to comment.