Skip to content

Commit

Permalink
fix: zkevm-bridge-ui config (#61)
Browse files Browse the repository at this point in the history
* fix: zkevm rpc url and bridge api url

* chore: lint

* fix: macOS setup

* chore: lint

* chore: nit

* revert: change to make it work on macOS
  • Loading branch information
leovct authored Apr 15, 2024
1 parent 5f6bfdf commit 5b0c69d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
33 changes: 26 additions & 7 deletions cdk_bridge_infra.star
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,33 @@ def run(plan, args):
)

# Start the bridge UI.
zkevm_node_rpc = plan.get_service(name="zkevm-node-rpc" + args["deployment_suffix"])
bridge_service_name = "zkevm-bridge-service" + args["deployment_suffix"]
bridge_service = bridge_infra_services[bridge_service_name]
l1_el_1_service = plan.get_service("el-1-geth-lighthouse")
# Note: We do not rely on args["l1_rpc_url"] because macOS browser can not resolve hostnames.
l1_rpc_url = "http://{}:{}".format(
l1_el_1_service.ip_address, l1_el_1_service.ports["rpc"].number
)

zkevm_node_rpc_service = plan.get_service(
name="zkevm-node-rpc" + args["deployment_suffix"]
)
# Note: Use `.ip_address` instead of `.hostname` to make it work on macOS.
zkevm_rpc_url = "http://{}:{}".format(
zkevm_node_rpc_service.ip_address,
zkevm_node_rpc_service.ports["http-rpc"].number,
)

bridge_service = bridge_infra_services[
"zkevm-bridge-service" + args["deployment_suffix"]
]
# Note: Use `.ip_address` instead of `.hostname` to make it work on macOS.
bridge_api_url = "http://{}:{}".format(
bridge_service.ip_address, bridge_service.ports["bridge-rpc"].number
)

config = struct(
zkevm_rpc_ip_address=zkevm_node_rpc.ip_address,
zkevm_rpc_http_port=zkevm_node_rpc.ports["http-rpc"],
bridge_service_ip_address=bridge_service.ip_address,
bridge_api_http_port=bridge_service.ports["bridge-rpc"],
l1_rpc_url=l1_rpc_url,
zkevm_rpc_url=zkevm_rpc_url,
bridge_api_url=bridge_api_url,
zkevm_bridge_address=contract_setup_addresses["zkevm_bridge_address"],
zkevm_rollup_address=contract_setup_addresses["zkevm_rollup_address"],
zkevm_rollup_manager_address=contract_setup_addresses[
Expand Down
11 changes: 3 additions & 8 deletions lib/zkevm_bridge.star
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,9 @@ def start_bridge_ui(plan, args, config):
),
},
env_vars={
"ETHEREUM_RPC_URL": args["l1_rpc_url"],
"POLYGON_ZK_EVM_RPC_URL": "http://{}:{}".format(
config.zkevm_rpc_ip_address,
config.zkevm_rpc_http_port,
),
"BRIDGE_API_URL": "http://{}:{}".format(
config.bridge_service_ip_address, config.bridge_api_http_port
),
"ETHEREUM_RPC_URL": config.l1_rpc_url,
"POLYGON_ZK_EVM_RPC_URL": config.zkevm_rpc_url,
"BRIDGE_API_URL": config.bridge_api_url,
"ETHEREUM_BRIDGE_CONTRACT_ADDRESS": config.zkevm_bridge_address,
"POLYGON_ZK_EVM_BRIDGE_CONTRACT_ADDRESS": config.zkevm_bridge_address,
"ETHEREUM_FORCE_UPDATE_GLOBAL_EXIT_ROOT": "true",
Expand Down
4 changes: 2 additions & 2 deletions params.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ zkevm_rollup_fork_id: 9
# The consensus contract name of the new rollup.
zkevm_rollup_consensus: PolygonValidiumEtrog

polygon_zkevm_explorer: "https://explorer.private/"
l1_explorer_url: "https://sepolia.etherscan.io/"
polygon_zkevm_explorer: https://explorer.private/
l1_explorer_url: https://sepolia.etherscan.io/

# If this is true, we will automatically deploy an ERC20 contract on
# L1 to be used at the gasTokenAddress
Expand Down

0 comments on commit 5b0c69d

Please sign in to comment.