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: deploy default permissionless node in cdk environment #14

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all 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
20 changes: 20 additions & 0 deletions cdk/main.star
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ethereum_package = import_module(
"github.com/kurtosis-tech/ethereum-package/[email protected]"
)
zkevm_permissionless_node_package = import_module(
"github.com/0xPolygon/kurtosis-cdk/permissionless-node/main.star"
)

CONTRACTS_IMAGE = "node:20-bookworm"
CONTRACTS_BRANCH = "develop"
Expand Down Expand Up @@ -164,6 +167,11 @@ def run(plan, args):
name="zkevm",
description="These are the files needed to start various node services",
)
genesis_artifact = plan.store_service_files(
service_name="contracts" + args["deployment_suffix"],
src="/opt/zkevm/genesis.json",
name="genesis",
)

# Start databases
prover_db_init_script = plan.upload_files(
Expand Down Expand Up @@ -525,6 +533,18 @@ def run(plan, args):
),
)

# Start permissionless node.
permissionless_args = args
permissionless_args["deployment_suffix"] = "-pless-001"
permissionless_args["trusted_sequencer_node_uri"] = "zkevm-node-sequencer-001:6900"
permissionless_args["zkevm_aggregator_host"] = "zkevm-node-aggregator-001"
permissionless_args["genesis_artifact"] = genesis_artifact
permissionless_args["zkevm_executor_image"] = args["zkevm_prover_image"]
permissionless_args["zkevm_db_executor_hostname"] = args["zkevm_db_prover_hostname"]
permissionless_args["zkevm_db_executor_user"] = args["zkevm_db_prover_user"]
permissionless_args["zkevm_db_executor_password"] = args["zkevm_db_prover_password"]
zkevm_permissionless_node_package.run(plan, args)


def start_node_databases(plan, args, prover_db_init_script, event_db_init_script):
postgres_port = args["zkevm_db_postgres_port"]
Expand Down
16 changes: 0 additions & 16 deletions cdk/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ zkevm_db_prover_hostname: "prover-db"
zkevm_db_prover_user: "prover_user"
zkevm_db_prover_password: "SR5xq2KZPgvQkPDranCRhvkv6pnqfo77"

zkevm_permissionless_db_prover_hostname: "permissionless-prover-db"
zkevm_permissionless_db_prover_user: "permissionless_prover_user"
zkevm_permissionless_db_prover_password: "fJc3BNTnURMNtie4w3HUhtQbe7omWn23"

## Pool db
# Note: Do not change the name of the db
# https://github.com/0xPolygonHermez/zkevm-node/blob/develop/db/db.go#L19
Expand All @@ -73,21 +69,13 @@ zkevm_db_pool_hostname: "pool-db"
zkevm_db_pool_user: "pool_user"
zkevm_db_pool_password: "Qso5wMcLAN3oF7EfaawzgWKUUKWM3Vov"

zkevm_permissionless_db_pool_hostname: "permissionless-pool-db"
zkevm_permissionless_db_pool_user: "permissionless_pool_user"
zkevm_permissionless_db_pool_password: "hkqvUnE65RvFjxaurXxNTDf4j6ozkejn"

## Event db
zkevm_db_event_name: "event_db"

zkevm_db_event_hostname: "event-db"
zkevm_db_event_user: "event_user"
zkevm_db_event_password: "rJXJN6iUAczh4oz8HRKYbVM8yC7tPeZm"

zkevm_permissionless_db_event_hostname: "permissionless-event-db"
zkevm_permissionless_db_event_user: "permissionless_event_user"
zkevm_permissionless_db_event_password: "d3GSJ8dkWxtMpNbP7w4Za7dF3Gh23XwM"

## State db
# Note: Do not change the name of the db
# https://github.com/0xPolygonHermez/zkevm-node/blob/develop/db/db.go#L17
Expand All @@ -97,10 +85,6 @@ zkevm_db_state_hostname: "state-db"
zkevm_db_state_user: "state_user"
zkevm_db_state_password: "rHTX7EpajF8zYDPatN32rH3B2pn89dmq"

zkevm_permissionless_db_state_hostname: "permissionless-state-db"
zkevm_permissionless_db_state_user: "permissionless_state_user"
zkevm_permissionless_db_state_password: "BXeRf7Y4QgkB4Z6c7w6mtXzkdptvwixR"

## Bridge db
zkevm_db_bridge_name: "bridge_db"

Expand Down
13 changes: 9 additions & 4 deletions permissionless-node/main.star
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,15 @@ def run(plan, args):
start_databases(plan, args)
start_executor(plan, args, cpu_arch)

genesis_file = read_file(src=args["genesis_file"])
genesis_artifact = plan.render_templates(
name="genesis", config={"genesis.json": struct(template=genesis_file, data={})}
)
genesis_artifact = ""
if "genesis_artifact" in args:
genesis_artifact = args["genesis_artifact"]
else:
genesis_file = read_file(src=args["genesis_file"])
genesis_artifact = plan.render_templates(
name="genesis",
config={"genesis.json": struct(template=genesis_file, data={})},
)

node_config_template = read_file(src="./templates/node-config.toml")
node_config_artifact = plan.render_templates(
Expand Down
2 changes: 1 addition & 1 deletion permissionless-node/params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Deployment suffix that will be appended to all the resources deployed by the permissionless package.
# WARNING: When deploying both the CDK and permissionless package, ensure the permissionless package's
# deployment suffix differs from the CDK environment's suffix to prevent naming clashes.
deployment_suffix: "-pless-001"
deployment_suffix: "-pless-002"

# Components to connect to
l1_rpc_url: "http://el-1-geth-lighthouse:8545"
Expand Down
Loading