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

Provide CDK-Erigon node version as a configuration parameter #1

Closed
leovct opened this issue Mar 5, 2024 · 0 comments · Fixed by #2
Closed

Provide CDK-Erigon node version as a configuration parameter #1

leovct opened this issue Mar 5, 2024 · 0 comments · Fixed by #2
Labels
enhancement New feature or request

Comments

@leovct
Copy link
Owner

leovct commented Mar 5, 2024

We would like to be able to test different versions of the CDK-Erigon node easily. We could achieve this by adding a new cdk_erigon_version parameter once Dockerfile build-time variables are supported in Kurtosis ImageBuildSpec. By default, we would build the node from the most recent commit.

Implementation

def run(
     ...,
     cdk_erigon_node_version="zkevm",
     go_version="1.19"
):
    config = create_cdk_erigon_node_config(...)
    start_cdk_erigon_node(plan, cdk_erigon_node_version, go_version, config)

def start_cdk_erigon_node(plan, cdk_erigon_node_version, go_version, config):
    plan.add_service(
        name="cdk-erigon-node",
        config=ServiceConfig(
            image=ImageBuildSpec(
                image_name="cdk-erigon",
                build_context_dir=".",
                build_args={
                        "CDK_ERIGON_NODE_VERSION": cdk_erigon_node_version,
                        "GO_VERSION": go_version,
                }
            ),
            files={"/etc/cdk-erigon": config},
            ports={"http_rpc": PortSpec(8545, application_protocol="http")},
            cmd=["--config=/etc/cdk-erigon/config.yaml", "--maxpeers=0"],
        ),
    )
 
# https://github.com/0xPolygonHermez/cdk-erigon/blob/zkevm/go.mod#L3
ARG GO_VERSION=1.19
FROM golang:${GO_VERSION} as builder
...

# https://github.com/0xPolygonHermez/cdk-erigon/releases
ARG CDK_ERIGON_NODE_VERSION=zkevm
RUN git clone --branch ${CDK_ERIGON_NODE_VERSION} https://github.com/0xPolygonHermez/cdk-erigon . \
  && make cdk-erigon

...
@leovct leovct added the enhancement New feature or request label Mar 5, 2024
@leovct leovct closed this as completed in #2 Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant