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 59 additions and 15 deletions
Showing only changes of commit 4740fcf749 - Show all commits

View File

@ -16,6 +16,6 @@ Stacks to run a node for laconic 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
## 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

@ -235,7 +235,9 @@
# L1 chain ID (Sepolia: 11155111)
geth_chain_id: "11155111"
# Private key for a funded account on L1 to use for contracts deployment on L1
# Private key for a funded L1 account, to be used for contract deployment on L1
# Must also be funded on L2 for deploying contracts
# Required since this private key will be utilized by both L1 and L2 nodes of the bridge
geth_deployer_pk: ""
# Custom L1 token to be deployed
@ -386,8 +388,8 @@
# Private key for bridge Nitro address
nitro_sc_pk: ""
# Private key for a funded account on L1
# This account should have L1 tokens for funding Nitro channels
# Private key should correspond to a funded account on both L1 and L2, and this account must own the Nitro contracts on L1
# It also needs to hold L1 tokens to fund Nitro channels and will be used for deploying contracts on L2
nitro_chain_pk: ""
# L2 chain ID (Optimism: 42069)
@ -396,10 +398,6 @@
# L2 RPC endpoint
optimism_url: "https://optimism.laconic.com"
# Private key for a funded account for L2 contracts deployment
# Use the same account for L1 and L2 deployments
optimism_deployer_pk: ""
# Custom L2 token to be deployed
token_name: ""
token_symbol: ""
@ -515,9 +513,9 @@
EOF
```
The required config file should be generated at `/srv/bridge/nitro-node-config.yml`
* The required config file should be generated at `/srv/bridge/nitro-node-config.yml`
Check in the file at location `ops/stage2/nitro-node-config.yml`
* Check in the generated file at location `ops/stage2/nitro-node-config.yml` within this repository
</details>

View File

@ -2,12 +2,12 @@
## 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)
* yq: see [installation](https://github.com/mikefarah/yq#install)
* laconic-so: see [installation](https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/stack-orchestrator-setup/README.md)
* Check versions to verify installation:
```bash
@ -84,7 +84,9 @@
# Will create deployments at $DEPLOYMENTS_DIR/nitro-node/l1-nitro-deployment and $DEPLOYMENTS_DIR/nitro-node/l2-nitro-deployment
```
## Run
## Run Nitro Nodes
### On Local Host
* Setup and run a Nitro node (L1+L2) by executing the `run-nitro-nodes.yml` Ansible playbook:
@ -92,7 +94,50 @@
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-nodes.yml --extra-vars='{ "target_host": "localhost"}' --user $USER
```
* Check status:
### On Remote Host (optional)
* Create a new `hosts.ini` file:
```bash
cp ../hosts.example.ini hosts.ini
```
* Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
```ini
[nitro_host]
<host_name> ansible_host=<target_ip> ansible_user=<ssh_user> ansible_ssh_common_args='-o ForwardAgent=yes'
```
- Replace `<host_name>` with the alias of your choice
- Replace `<target_ip>` with the IP address or hostname of the target machine
- Replace `<ssh_user>` with the SSH username (e.g., dev, ubuntu)
* Verify that you are able to connect to the host using the following command
```bash
ansible all -m ping -i hosts.ini -k
# Expected output:
# <host_name> | SUCCESS => {
# "ansible_facts": {
# "discovered_interpreter_python": "/usr/bin/python3.10"
# },
# "changed": false,
# "ping": "pong"
# }
```
* Execute the `run-nitro-nodes.yml` Ansible playbook for remote deployment:
```bash
LANG=en_US.utf8 ansible-playbook -i hosts.ini run-nitro-nodes.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
```
### Check Deployment Status
* Run the following command in the directory where the deployments are created:
```bash
cd $DEPLOYMENTS_DIR/nitro-node
@ -103,8 +148,9 @@
```
## Create Channels
Create a ledger channel with the bridge on L1 which is mirrored on L2
* Create a ledger channel with the bridge on L1 that gets mirrored on L2
* Run the following commands from the directory where the deployments are created
* Set required variables: