-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from rollkit/kurtosis
feat: initialize kurtosis package
- Loading branch information
Showing
5 changed files
with
120 additions
and
4 deletions.
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 |
---|---|---|
|
@@ -18,6 +18,6 @@ jobs: | |
- uses: rollkit/.github/.github/actions/[email protected] | ||
|
||
dockerfile-lint: | ||
uses: rollkit/.github/.github/workflows/reuseable_dockerfile_lint[email protected] | ||
uses: rollkit/.github/.github/workflows/reusable_dockerfile_lint[email protected] | ||
with: | ||
failure-threshold: "error" |
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 |
---|---|---|
|
@@ -14,8 +14,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ | |
bash \ | ||
curl \ | ||
jq \ | ||
ranger \ | ||
vim \ | ||
libc6 \ | ||
ca-certificates \ | ||
&& apt-get clean \ | ||
|
@@ -50,6 +48,35 @@ RUN sed -i '/wasmd start/s/^/#/' init.sh | |
|
||
RUN bash init.sh | ||
Check failure on line 49 in Dockerfile GitHub Actions / lint / dockerfile-lint / hadolint
|
||
|
||
# Stage 2: Create a minimal runtime image | ||
FROM debian:bookworm-slim | ||
|
||
# Install only the necessary runtime dependencies | ||
RUN apt-get update && apt-get install -y --no-install-recommends \ | ||
Check failure on line 55 in Dockerfile GitHub Actions / lint / dockerfile-lint / hadolint
|
||
bash \ | ||
curl \ | ||
ranger \ | ||
jq \ | ||
vim \ | ||
ca-certificates \ | ||
libc6 \ | ||
&& apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /root | ||
|
||
# Copy the wasmd binary from the build stage | ||
COPY --from=build-env /go/bin/wasmd /usr/bin/wasmd | ||
|
||
# Ensure the wasmd binary is executable | ||
RUN chmod +x /usr/bin/wasmd | ||
|
||
# Copy the .wasmd directory from the build stage | ||
COPY --from=build-env /root/.wasmd /root/.wasmd | ||
|
||
# Copy over wasmd depenendencies | ||
RUN mkdir -p /go/pkg/mod/github.com/!cosm!wasm/[email protected] | ||
COPY --from=build-env /go/pkg/mod/github.com/!cosm!wasm/[email protected]/ /go/pkg/mod/github.com/!cosm!wasm/[email protected]/ | ||
|
||
EXPOSE 36657 36656 9290 | ||
|
||
# Keep the container running | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name: github.com/rollkit/cosmwasm | ||
description: |- | ||
Kurtosis package for a Rollkit CosmWasm rollup | ||
replace: {} |
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,85 @@ | ||
# This Kurtosis package spins up a minimal CosmWasm rollup that connects to a DA node | ||
# | ||
# NOTE: currently this is only connecting to a local DA node | ||
|
||
da_node = import_module("github.com/rollkit/local-da/[email protected]") | ||
|
||
|
||
def run(plan): | ||
########## | ||
# DA | ||
########## | ||
|
||
da_address = da_node.run( | ||
plan, | ||
) | ||
plan.print("connecting to da layer via {0}".format(da_address)) | ||
|
||
################# | ||
# CosmWasm Rollup | ||
################# | ||
plan.print("Adding CosmWasm service") | ||
rpc_port_number = 36657 | ||
grpc_port_number = 9290 | ||
p2p_port_number = 36656 | ||
wasmd_start_cmd = [ | ||
"wasmd", | ||
"start", | ||
"--rollkit.aggregator", | ||
"--rollkit.da_address {0}".format(da_address), | ||
"--rpc.laddr tcp://0.0.0.0:{0}".format(rpc_port_number), | ||
"--grpc.address 0.0.0.0:{0}".format(grpc_port_number), | ||
"--p2p.laddr 0.0.0.0:{0}".format(p2p_port_number), | ||
"--minimum-gas-prices='0.025uwasm'", | ||
] | ||
wasmd_ports = { | ||
"rpc-laddr": defaultPortSpec(rpc_port_number), | ||
"grpc-addr": defaultPortSpec(grpc_port_number), | ||
"p2p-laddr": defaultPortSpec(p2p_port_number), | ||
} | ||
wasm = plan.add_service( | ||
name="wasm", | ||
config=ServiceConfig( | ||
# Using CosmWasm version v0.1.0 | ||
image="ghcr.io/rollkit/cosmwasm:3b5a25b", | ||
# Use ImageBuildSpec when testing changes to Dockerfile | ||
# image = ImageBuildSpec( | ||
# image_name="cosmwasm", | ||
# build_context_dir=".", | ||
# ), | ||
cmd=["/bin/sh", "-c", " ".join(wasmd_start_cmd)], | ||
ports=wasmd_ports, | ||
public_ports=wasmd_ports, | ||
ready_conditions=ReadyCondition( | ||
recipe=ExecRecipe( | ||
command=[ | ||
"wasmd", | ||
"status", | ||
"-n", | ||
"tcp://127.0.0.1:{0}".format(rpc_port_number), | ||
], | ||
extract={ | ||
"output": "fromjson | .node_info.network", | ||
}, | ||
), | ||
field="extract.output", | ||
assertion="==", | ||
target_value="localwasm", | ||
interval="1s", | ||
timeout="10s", | ||
), | ||
), | ||
) | ||
|
||
wasm_address = "http://{0}:{1}".format( | ||
wasm.ip_address, wasm.ports["rpc-laddr"].number | ||
) | ||
plan.print("CosmWasm service is available at {0}".format(wasm_address)) | ||
|
||
|
||
def defaultPortSpec(port_number): | ||
return PortSpec( | ||
number=port_number, | ||
transport_protocol="TCP", | ||
application_protocol="http", | ||
) |