2024-09-03 09:17:18 +00:00
|
|
|
# testnet-nitro-node
|
|
|
|
|
|
|
|
## 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
|
|
|
|
```
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
* Clone the `cerc-io/testnet-ops` repository:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
git clone git@git.vdb.to:cerc-io/testnet-ops.git
|
|
|
|
|
|
|
|
cd testnet-ops/nitro-node-setup
|
|
|
|
```
|
|
|
|
|
|
|
|
* Fetch the required Nitro node config:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
wget -O nitro-vars.yml https://git.vdb.to/cerc-io/testnet-laconicd-stack/raw/branch/main/ops/stage2/nitro-node-config.yml
|
2024-09-05 07:06:41 +00:00
|
|
|
|
|
|
|
# Expected variables in the fetched config file:
|
|
|
|
|
|
|
|
# nitro_l1_chain_url: ""
|
|
|
|
# nitro_l2_chain_url: ""
|
|
|
|
# na_address: ""
|
|
|
|
# vpa_address: ""
|
|
|
|
# ca_address: ""
|
|
|
|
# bridge_contract_address: ""
|
|
|
|
# bridge_nitro_address: ""
|
|
|
|
# nitro_l1_bridge_multiaddr: ""
|
|
|
|
# nitro_l2_bridge_multiaddr: ""
|
2024-09-03 09:17:18 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* TODO: Get Laconic tokens on your address
|
|
|
|
|
2024-09-05 07:06:41 +00:00
|
|
|
* Edit `nitro-vars.yml` and add the following variables:
|
2024-09-03 09:17:18 +00:00
|
|
|
|
|
|
|
```bash
|
|
|
|
# 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 your Nitro channels
|
|
|
|
nitro_chain_pk: ""
|
|
|
|
|
2024-09-05 07:06:41 +00:00
|
|
|
# Multiaddr with publically accessible IP address / DNS for your L1 nitro node
|
|
|
|
# Use port 3007
|
|
|
|
# Example: "/ip4/192.168.x.y/tcp/3007"
|
|
|
|
# Example: "/dns4/example.com/tcp/3007"
|
|
|
|
nitro_l1_ext_multiaddr: ""
|
|
|
|
|
|
|
|
# Multiaddr with publically accessible IP address / DNS for your L2 nitro node
|
|
|
|
# Use port 3009
|
2024-09-03 09:17:18 +00:00
|
|
|
# Example: "/ip4/192.168.x.y/tcp/3009"
|
|
|
|
# Example: "/dns4/example.com/tcp/3009"
|
2024-09-05 07:06:41 +00:00
|
|
|
nitro_l2_ext_multiaddr: ""
|
2024-09-03 09:17:18 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
* Update the target dir in `setup-vars.yml`:
|
|
|
|
|
|
|
|
```bash
|
2024-09-03 10:10:29 +00:00
|
|
|
# Set path to desired deployments dir
|
2024-09-03 09:17:18 +00:00
|
|
|
DEPLOYMENTS_DIR=<path-to-deployments-dir>
|
2024-09-03 10:10:29 +00:00
|
|
|
|
2024-09-03 09:17:18 +00:00
|
|
|
sed -i "s|^nitro_directory:.*|nitro_directory: $DEPLOYMENTS_DIR/nitro-node|" setup-vars.yml
|
|
|
|
|
|
|
|
# Will create deployments at $DEPLOYMENTS_DIR/nitro-node/l1-nitro-deployment and $DEPLOYMENTS_DIR/nitro-node/l2-nitro-deployment
|
|
|
|
```
|
|
|
|
|
|
|
|
## Run
|
|
|
|
|
|
|
|
* Setup and run a Nitro node (L1+L2) by executing the `run-nitro-node.yml` Ansible playbook:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-node.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-node.yml --extra-vars='{ "target_host": "localhost", "skip_container_build": true }' --user $USER
|
|
|
|
```
|
|
|
|
|
|
|
|
### Clean up
|
|
|
|
|
|
|
|
* Switch to deployments dir:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
cd $DEPLOYMENTS_DIR/nitro-node
|
|
|
|
```
|
|
|
|
|
|
|
|
* Stop all Nitro services running in the background:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so deployment --dir l1-nitro-deployment stop
|
|
|
|
laconic-so deployment --dir l2-nitro-deployment stop
|
|
|
|
```
|
|
|
|
|
|
|
|
* To stop all services and also delete data:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
laconic-so deployment --dir l1-nitro-deployment stop --delete-volumes
|
|
|
|
laconic-so deployment --dir l2-nitro-deployment stop --delete-volumes
|
|
|
|
|
|
|
|
# Remove deployment directories (deployments will have to be recreated for a re-run)
|
|
|
|
sudo rm -r l1-nitro-deployment
|
|
|
|
sudo rm -r l2-nitro-deployment
|
|
|
|
```
|