testnet-ops/l2-setup/README.md
2024-09-05 13:16:52 +05:30

53 lines
1.6 KiB
Markdown

# l2-setup
## Setup Ansible
To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine
## Setup and Run Optimism
The following commands have to be executed in [`l2-setup`](./) directory
- Edit [`l2-config.env`](./templates/configs/l2-config.env) and fill in the following values
```bash
# Chain ID of the L1 chain
CERC_L1_CHAIN_ID=
# L1 RPC endpoint
CERC_L1_RPC=
# Amount to send the proposer on L2 (default: 0.2 ether)
CERC_L2_PROPOSER_AMOUNT=
# Amount to send the batcher on L2 (default: 0.1 ether)
CERC_L2_BATCHER_AMOUNT=
# L1 RPC endpoint host or IP address
CERC_L1_HOST=
# L1 RPC endpoint port number
CERC_L1_PORT=
# Address of the funded account on L1
# Used for optimism contracts deployment
CERC_L1_ADDRESS=
# Private key of the funded account on L1
CERC_L1_PRIV_KEY=
```
- To setup and run L2, execute the `run-optimism.yml` Ansible playbook by running the following command.
NOTE: By default, deployments are created in the `l2-setup/out` directory. To change this location, update the `l2_directory` variable in the [vars.yml](./vars.yml) file.
```bash
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-optimism.yml --extra-vars='{ "target_host": "localhost"}' --user $USER
```
- For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter:
```bash
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-optimism.yml --extra-vars='{"target_host" : "localhost", "skip_container_build": true}' -kK --user $USER
```