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: add da input arg and connect celestia da package #126

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ENV GOPATH /usr/local/go
ENV PATH $GOPATH/bin:$PATH

# Install Rollkit dependencies
RUN curl -sSL https://rollkit.dev/install.sh | sh -s v0.13.5
RUN curl -sSL https://rollkit.dev/install.sh | sh -s v0.13.7

# Install GM rollup
RUN bash -c "$(curl -sSL https://rollkit.dev/install-gm-rollup.sh)"
Expand Down
98 changes: 80 additions & 18 deletions main.star
Original file line number Diff line number Diff line change
@@ -1,31 +1,62 @@
# This Kurtosis package spins up a minimal GM 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]")
# DA Types
celestia = "celestia"
avail = "avail"
local_da = "local-da"

def run(plan):
##########
# DA
##########

da_address = da_node.run(
plan,
)
plan.print("connecting to da layer via {0}".format(da_address))
def run(
plan,
da=local_da,
da_namespace="00000000000000000000000000000000000000000008e5f679bf7116cb",
):
# Define vars
da_rpc_address = None
da_auth_token = None
da_wallet_address = None
da_height = None

# Start up the DA node
plan.print("Starting up GM rollup with DA: {0}".format(da))
if da == local_da:
plan.print("Using local-da")
da_node = import_module("github.com/rollkit/local-da/[email protected]")
da_rpc_address = da_node.run(
plan,
)
elif da == celestia:
# Uses arabica by default
# TODO: add inputs to target mocha
plan.print("Using celestia for DA")
da_node = import_module(
"github.com/rollkit/kurtosis-celestia-da-node/main.star"
)
da_rpc_address, da_auth_token, da_wallet_address, da_height = da_node.run(
plan,
)
else:
fail("Unknown DA: {0}".format(da))

plan.print("connecting to da layer via {0}".format(da_rpc_address))
#####
# GM
#####

plan.print("Adding GM service")
plan.print("NOTE: This can take a few minutes to start up...")
gm_start_cmd = [
"rollkit",
"start",
"--rollkit.aggregator",
"--rollkit.da_address {0}".format(da_address),
]

# Generate start command
gm_start_cmd = rollkitCMD(
da,
da_address=da_rpc_address,
da_auth_token=da_auth_token,
da_namespace=da_namespace,
da_start_height=da_height,
)
plan.print("GM start command: {0}".format(gm_start_cmd))

# Build GM Service Spec
gm_port_number = 26657
gm_port_spec = PortSpec(
number=gm_port_number, transport_protocol="TCP", application_protocol="http"
Expand All @@ -41,7 +72,11 @@ def run(plan):
name="gm",
config=ServiceConfig(
# Using rollkit version v0.13.5
image="ghcr.io/rollkit/gm:05bd40e",
# image="ghcr.io/rollkit/gm:05bd40e",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Split out into new PR

image=ImageBuildSpec(
image_name="gm_temp",
build_context_dir=".",
),
cmd=["/bin/sh", "-c", " ".join(gm_start_cmd)],
ports=gm_ports,
public_ports=gm_ports,
Expand Down Expand Up @@ -82,3 +117,30 @@ def run(plan):
public_ports=frontend_ports,
),
)


def rollkitCMD(
da, da_address=None, da_auth_token=None, da_namespace=None, da_start_height=None
):
if da == celestia:
return [
"rollkit",
"start",
"--rollkit.aggregator",
"--rollkit.da_address {0}".format(da_address),
"--rollkit.da_auth_token {0}".format(da_auth_token),
"--rollkit.da_namespace {0}".format(da_namespace),
"--rollkit.da_start_height {0}".format(da_start_height),
"--minimum-gas-prices=0.025stake",
]
elif da == avail:
fail("Avail DA is not yet supported")
elif da == local_da:
return [
"rollkit",
"start",
"--rollkit.aggregator",
"--rollkit.da_address {0}".format(da_address),
]
else:
fail("Unknown DA: {0}".format(da))
Loading