Add instructions to setup and run testnet L2 and Nitro deployments #26

Merged
nabarun merged 22 commits from sk-l2-setup into main 2024-09-12 13:31:18 +00:00
3 changed files with 123 additions and 8 deletions
Showing only changes of commit ed0b13ce31 - Show all commits

View File

@ -15,3 +15,7 @@ Stacks to run a node for laconic testnet
## Join LORO testnet ## Join LORO testnet
Follow steps in [testnet-onboarding-validator.md](./testnet-onboarding-validator.md) to onboard your participant and join as a validator on the LORO testnet Follow steps in [testnet-onboarding-validator.md](./testnet-onboarding-validator.md) to onboard your participant and join as a validator on the LORO testnet
## Run Testnet Nitro Node
Follow steps in [testnet-nitro-node.md](./testnet-nitro-node.md) to run you Nitro node for the testnet

View File

@ -10,6 +10,20 @@
cd /srv cd /srv
``` ```
### Prerequisites
* laconic-so: see [installation](https://git.vdb.to/cerc-io/stack-orchestrator#install)
* Ansible: see [installation](https://git.vdb.to/cerc-io/testnet-ops#installation)
* Check versions to verify installation:
```bash
laconic-so version
ansible --version
```
<details open> <details open>
<summary>L2 Optimism</summary> <summary>L2 Optimism</summary>
@ -35,17 +49,12 @@
sudo rm -rf optimism-deployment sudo rm -rf optimism-deployment
``` ```
### Prerequisites
* laconic-so: see [installation](https://git.vdb.to/cerc-io/stack-orchestrator#install)
* Ansible: see [installation](https://git.vdb.to/cerc-io/testnet-ops#installation)
### Setup ### Setup
* Clone the `cerc-io/testnet-ops` repository: * Clone the `cerc-io/testnet-ops` repository:
```bash ```bash
cd /srv
git clone git@git.vdb.to:cerc-io/testnet-ops.git git clone git@git.vdb.to:cerc-io/testnet-ops.git
cd testnet-ops/l2-setup cd testnet-ops/l2-setup
@ -54,7 +63,7 @@
* Edit `templates/configs/l2-config.env` and fill in the following values: * Edit `templates/configs/l2-config.env` and fill in the following values:
```bash ```bash
# Chain ID of the L1 chain (Sepolia: 11155111) # L1 chain ID (Sepolia: 11155111)
CERC_L1_CHAIN_ID=11155111 CERC_L1_CHAIN_ID=11155111
# L1 RPC endpoint # L1 RPC endpoint
@ -66,6 +75,9 @@
# L1 RPC endpoint port number # L1 RPC endpoint port number
CERC_L1_PORT= CERC_L1_PORT=
# L1 Beacon endpoint
CERC_L1_BEACON=
# Account credentials for the Admin account # Account credentials for the Admin account
# Used for Optimism contracts deployment and funding other generated accounts # Used for Optimism contracts deployment and funding other generated accounts
CERC_L1_ADDRESS= CERC_L1_ADDRESS=
@ -102,6 +114,105 @@
</details> </details>
<details open>
<summary>Nitro Bridge</summary>
## Nitro Bridge
* Stack: <https://git.vdb.to/cerc-io/nitro-stack>
* Source repos: <https://github.com/cerc-io/go-nitro>
* Target dir: `/srv/bridge/bridge-deployment`
* Cleanup an existing deployment if required:
```bash
cd /srv/bridge
# Stop the deployment
laconic-so deployment --dir bridge-deployment stop --delete-volumes
# Remove the deployment dir
sudo rm -rf bridge-deployment
```
### Setup
* Clone the `cerc-io/testnet-ops` repository:
```bash
cd /srv
# Can be skipped if repo already exists
git clone git@git.vdb.to:cerc-io/testnet-ops.git
cd testnet-ops/nitro-bridge-setup
```
* Create the required vars file:
```bash
cp bridge-vars-example.yml bridge-vars.yml
```
* Edit `bridge-vars.yml` and fill in the following values:
```bash
# L1 WS endpoint
l1_nitro_chain_url: ""
# L2 WS endpoint
l2_nitro_chain_url: ''
# Private key for your Nitro address
nitro_sc_pk: ""
# Private key for a funded account on L1
# This account should have Laconic tokens for funding Nitro channels
nitro_chain_pk: ""
# L1 chain ID (Sepolia: 11155111)
geth_chain_id: "11155111"
# L1 RPC endpoint
geth_url: ""
# L2 RPC endpoint
optimism_url: ""
# Private key for a funded account on L1 to use for contracts deployment on L1
geth_deployer_pk: ''
# Private key for a funded account on L2 to use for contracts deployment on L2
# Use the same account for L1 and L2 deployments
optimism_deployer_pk: ''
```
* Update the target dir in `setup-vars.yml`:
```bash
sed -i 's|^nitro_directory:.*|nitro_directory: /srv/bridge|' vars.yml
# Will create deployment at /srv/bridge/bridge-deployment
```
### Run
* Setup and run L2 by executing the `run-nitro-bridge.yml` Ansible playbook:
```bash
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-bridge.yml --extra-vars='{ "target_host": "localhost"}' --user $USER
```
* For skipping container build, run with `"skip_container_build" : true`:
```bash
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-bridge.yml --extra-vars='{"target_host" : "localhost", "skip_container_build": true}' -kK --user $USER
```
</details>
<details open> <details open>
<summary>stage0 laconicd</summary> <summary>stage0 laconicd</summary>

View File

@ -35,7 +35,7 @@
* Edit `nitro-vars.yml` and fill in the following values: * Edit `nitro-vars.yml` and fill in the following values:
```bash ```bash
# L1 RPC endpoint # L1 WS endpoint
l1_nitro_chain_url: "" l1_nitro_chain_url: ""
# Private key for your Nitro address # Private key for your Nitro address