-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update agglayer implementation (#262)
* chore: move `deploy_agglayer` param * chore: remove duplicate key * chore: move agglayer deployment to main.star * fix: last issues * fix * fix: issues * chore: remove zkevm in front of agglayer * fix: typo * chore: nit * chore: nit * fix: ugly * fix * fix * docs: nit * fix: lint * chore: remove config diff script
- Loading branch information
Showing
30 changed files
with
177 additions
and
2,076 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
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
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,78 @@ | ||
service_package = import_module("./lib/service.star") | ||
databases = import_module("./databases.star") | ||
|
||
|
||
def run(plan, args): | ||
contract_setup_addresses = service_package.get_contract_setup_addresses(plan, args) | ||
db_configs = databases.get_db_configs( | ||
args["deployment_suffix"], args["sequencer_type"] | ||
) | ||
agglayer_config_artifact = create_agglayer_config_artifact( | ||
plan, args, contract_setup_addresses, db_configs | ||
) | ||
|
||
agglayer_keystore_artifact = plan.store_service_files( | ||
name="agglayer-keystore", | ||
service_name="contracts" + args["deployment_suffix"], | ||
src="/opt/zkevm/agglayer.keystore", | ||
) | ||
|
||
plan.add_service( | ||
name="agglayer", | ||
config=ServiceConfig( | ||
image=args["agglayer_image"], | ||
ports={ | ||
"agglayer": PortSpec( | ||
args["agglayer_port"], application_protocol="http" | ||
), | ||
"prometheus": PortSpec( | ||
args["prometheus_port"], application_protocol="http" | ||
), | ||
}, | ||
files={ | ||
"/etc/zkevm": Directory( | ||
artifact_names=[ | ||
agglayer_config_artifact, | ||
agglayer_keystore_artifact, | ||
] | ||
), | ||
}, | ||
entrypoint=[ | ||
"/usr/local/bin/agglayer", | ||
], | ||
cmd=["run", "--cfg", "/etc/zkevm/agglayer-config.toml"], | ||
), | ||
) | ||
|
||
|
||
def create_agglayer_config_artifact(plan, args, contract_setup_addresses, db_configs): | ||
agglayer_config_template = read_file( | ||
src="./templates/bridge-infra/agglayer-config.toml" | ||
) | ||
return plan.render_templates( | ||
name="agglayer-config-artifact", | ||
config={ | ||
"agglayer-config.toml": struct( | ||
template=agglayer_config_template, | ||
# TODO: Organize those args. | ||
data={ | ||
"deployment_suffix": args["deployment_suffix"], | ||
"global_log_level": args["global_log_level"], | ||
"l1_chain_id": args["l1_chain_id"], | ||
"l1_rpc_url": args["l1_rpc_url"], | ||
"zkevm_l2_keystore_password": args["zkevm_l2_keystore_password"], | ||
"zkevm_l2_proofsigner_address": args[ | ||
"zkevm_l2_proofsigner_address" | ||
], | ||
"zkevm_l2_sequencer_address": args["zkevm_l2_sequencer_address"], | ||
# ports | ||
"zkevm_rpc_http_port": args["zkevm_rpc_http_port"], | ||
"agglayer_port": args["agglayer_port"], | ||
"prometheus_port": args["prometheus_port"], | ||
"l2_rpc_name": args["l2_rpc_name"], | ||
} | ||
| contract_setup_addresses | ||
| db_configs, | ||
) | ||
}, | ||
) |
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
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
Oops, something went wrong.