testnet-ops/l2-setup
2024-09-05 13:16:52 +05:30
..
templates Copy artifact files if contracts are already deployed 2024-09-05 13:16:52 +05:30
README.md Copy artifact files if contracts are already deployed 2024-09-05 13:16:52 +05:30
run-optimism.yml Copy artifact files if contracts are already deployed 2024-09-05 13:16:52 +05:30
vars.yml Copy artifact files if contracts are already deployed 2024-09-05 13:16:52 +05:30

l2-setup

Setup Ansible

To get started, follow the 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 and fill in the following values

    # L1 Chain ID
    CERC_L1_CHAIN_ID=
    
    # L1 RPC endpoint
    CERC_L1_RPC=
    
    # L1 RPC endpoint host or IP address
    CERC_L1_HOST=
    
    # L1 RPC endpoint port number
    CERC_L1_PORT=
    
    # L1 Beacon endpoint
    CERC_L1_BEACON=
    
    # 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=
    
    # Funding amount for Optimism Proposer account on L1 (default: 0.2 ether)
    CERC_PROPOSER_AMOUNT=
    
    # Amount to send the batcher on L2 (default: 0.1 ether)
    CERC_BATCHER_AMOUNT=
    
  • 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 file.

    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:

      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
      
  • To run using existing contracts deployment

    • Update the vars.yml with paths to required artifacts

    • Run the ansible playbook with "existing_l1_deployment": true in the --extra-vars parameter:

      LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-optimism.yml --extra-vars='{"target_host" : "localhost", "existing_l1_deployment":  true}' -kK --user $USER