From 52e1c3e46b262a93526a79a8eadefee0350eb646 Mon Sep 17 00:00:00 2001 From: Shreerang Kale Date: Mon, 2 Sep 2024 18:17:19 +0530 Subject: [PATCH] Add instructions to setup and run L2 deployment from scratch --- ops/deployments-from-scratch.md | 96 +++++++++++++++++++++++++++++++++ scripts/package.json | 3 +- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/ops/deployments-from-scratch.md b/ops/deployments-from-scratch.md index 58dcf12..fdd8dda 100644 --- a/ops/deployments-from-scratch.md +++ b/ops/deployments-from-scratch.md @@ -10,6 +10,102 @@ cd /srv ``` +
+ L2 Optimism + +## L2 Optimism + +* Stack: + +* Source repos: + * + * + +* Target dir: `/srv/l2/optimism-deployment` + +* Cleanup an existing deployment if required: + + ```bash + cd /srv/l2 + + # Stop the deployment + laconic-so deployment --dir optimism-deployment stop --delete-volumes + + # Remove the deployment dir + sudo rm -rf optimism-deployment + ``` + +### Prerequisites + +* Ansible: see [installation](https://git.vdb.to/cerc-io/ops#installation) + +### Setup + +* Clone the `cerc-io/ops` repository (TODO: replace): + + ```bash + git clone git@github.com:deep-stack/ops.git + + cd ops + ``` + +* The following commands have to be executed in `ops/vulcanize/l2-setup` directory (TODO: remove) + + ```bash + cd ./vulcanize/l2-setup + ``` + +* Edit `l2-config.env.j2` and fill in the following values: + + ```bash + # Chain ID of the L1 chain (Sepolia: 11155111) + CERC_L1_CHAIN_ID=11155111 + + # L1 RPC endpoint + CERC_L1_RPC= + + # L1 RPC endpoint host or IP address + CERC_L1_HOST= + + # L1 RPC endpoint port number + CERC_L1_PORT= + + # Account credentials for the Admin account + # Used for Optimism contracts deployment and funding other generated accounts + CERC_L1_ADDRESS= + CERC_L1_PRIV_KEY= + + # Funding amount for Optimism Proposer account on L1 (default: 0.2 ether) + CERC_L2_PROPOSER_AMOUNT= + + # Funding amount for Optimism Batcher account on L1 (default: 0.1 ether) + CERC_L2_BATCHER_AMOUNT= + ``` + +* Update the target dir in `vars.yml`: + + ```bash + sed -i 's|^l2_directory:.*|l2_directory: /srv/l2|' vars.yml + + # Will create deployment at /srv/l2/optimism-deployment + ``` + +### Run + +* Setup and run L2 by executing the `run-optimism.yml` Ansible playbook: + + ```bash + LANG=en_IN.utf8 ansible-playbook -i localhost, --connection=local run-optimism.yml --extra-vars='{ "target_host": "localhost"}' --user $USER + ``` + + * For skipping container build, run with `"skip_container_build" : true`: + + ```bash + LANG=en_IN.utf8 ansible-playbook -i localhost, --connection=local run-optimism.yml --extra-vars='{"target_host" : "localhost", "skip_container_build": true}' -kK --user $USER + ``` + +
+
stage0 laconicd diff --git a/scripts/package.json b/scripts/package.json index fb8c8f1..c9c5d7e 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -22,7 +22,8 @@ }, "scripts": { "build": "tsc", - "map-subscribers-to-participants": "node dist/map-subscribers-to-participants.js" + "map-subscribers-to-participants": "node dist/map-subscribers-to-participants.js", + "participants-with-filtered-validators": "node dist/participants-with-filtered-validators.js" }, "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447" }