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

feat(v0.52): SDK v0.52 + gordian integration #192

Draft
wants to merge 10 commits into
base: wip-release/v0.52
Choose a base branch
from

Conversation

Reecepbcups
Copy link
Member

@Reecepbcups Reecepbcups commented Aug 2, 2024

https://github.com/rollchains/gordian/pull/6

Gordian Simapp Dockerfile

# spawn new chain, with gordian, then:

FROM golang:1.22-alpine AS go-builder

# cp -r /home/reece/Desktop/Programming/Go/gordian/gcosmos/_cosmosvendor/cosmos-sdk .
# cp -r /home/reece/Desktop/Programming/Go/gordian .
# docker build . -t myproject:local

SHELL ["/bin/sh", "-ecuxo", "pipefail"]

RUN apk add --no-cache ca-certificates build-base git

WORKDIR /code

RUN mkdir -p /home/reece/Desktop/Programming/Go/gordian/gcosmos/_cosmosvendor/cosmos-sdk
COPY gordian /home/reece/Desktop/Programming/Go/gordian
COPY cosmos-sdk /home/reece/Desktop/Programming/Go/gordian/gcosmos/_cosmosvendor/cosmos-sdk

ADD go.mod go.sum ./
RUN set -eux; \
    export ARCH=$(uname -m); \
    WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true); \
    if [ ! -z "${WASM_VERSION}" ]; then \
      WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}');\
      WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}');\
      wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
    fi; \
    go mod download;

# Copy over code
COPY . /code



# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/appd
# then ensure static linking
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
  && file /code/build/appd \
  && echo "Ensuring binary is statically linked ..." \
  && (file /code/build/appd | grep "statically linked")

# --------------------------------------------------------
FROM alpine:3.16

COPY --from=go-builder /code/build/appd /usr/bin/appd

# Install dependencies used for Starship
RUN apk add --no-cache curl make bash jq sed

WORKDIR /opt

# rest server, tendermint p2p, tendermint rpc
EXPOSE 1317 26656 26657

CMD ["/usr/bin/appd", "version"]

Comment on lines 56 to 74
cmd = NewRootCmdWithServer(func(cc client.Context) serverv2.ServerComponent[transaction.Tx] {
dc := server.NewDefaultContext()

var ctx context.Context = context.Background()
ctx = context.WithValue(ctx, client.ClientContextKey, client.Context{
ChainID: "gcosmos",
HomeDir: "/home/reece/.simappv2",
})
// ctx = context.WithValue(ctx, server.ServerContextKey, server.NewDefaultContext())

log := slog.New(slog.NewJSONHandler(os.Stdout, nil))

codec := gtx.NewTxDecoder(cc.TxConfig)
c, err := gserver.NewComponent(ctx, dc, log, codec, cc.Codec)
if err != nil {
panic(err)
}
return c
})
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ref

* old simapp file movement

* simapp v2 -> simapp

* base v2 copy paste over

* archive

* proper embeding and namespace

* remote ict in cfg

* rm ignite

* misc

* working: just get a standard namespace to launch with gordian

* working with gordian / cometbft selector

* simplify selectors into priv methods

* helper

* embed *.*

* todo

* fix: latest gordian changes
@Reecepbcups Reecepbcups changed the title feat(v0.52): gordian integration feat(v0.52): SDK v0.52 + gordian integration Aug 9, 2024
@Reecepbcups
Copy link
Member Author

Reecepbcups commented Aug 14, 2024

built off Gordian 4e8efad6985ed80402d0cd807d286c80d8d2f91e for now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant