Add steps to create the required config for Nitro nodes

This commit is contained in:
Prathamesh Musale 2024-09-05 13:12:09 +05:30
parent 2c7077d2f7
commit 776f91468e

View File

@ -154,10 +154,10 @@
```bash
# L1 WS endpoint
nitro_l1_chain_url: ""
nitro_l1_chain_url: "wss://sepolia.laconic.com"
# L2 WS endpoint
nitro_l2_chain_url: ""
nitro_l2_chain_url: "wss://optimism.laconic.com"
# Private key for bridge Nitro address
nitro_sc_pk: ""
@ -170,10 +170,10 @@
geth_chain_id: "11155111"
# L1 RPC endpoint
geth_url: ""
geth_url: "https://sepolia.laconic.com"
# L2 RPC endpoint
optimism_url: ""
optimism_url: "https://optimism.laconic.com"
# Private key for a funded account for L1 contracts deployment
geth_deployer_pk: ""
@ -188,7 +188,7 @@
```bash
sed -i 's|^nitro_directory:.*|nitro_directory: /srv/bridge|' vars.yml
# Will create deployment at /srv/bridge/bridge-deployment
# Will create deployment at /srv/bridge/nitro-contracts-deployment and /srv/bridge/bridge-deployment
```
### Run
@ -205,6 +205,54 @@
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
```
* Check status:
```bash
cd /srv/bridge
# Check the l2 nitro contract deployments
laconic-so deployment --dir bridge-deployment logs l2-nitro-contracts -f
# Check bridge logs, ensure that the node is running
laconic-so deployment --dir bridge-deployment logs nitro-bridge -f
```
* Create Nitro node config for users:
```bash
cd /srv/bridge
# Create required variables
GETH_CHAIN_ID="11155111"
OPTIMISM_CHAIN_ID="42069"
export NA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json")
export CA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json")
export VPA_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json")
export BRIDGE_CONTRACT_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-bridge "jq -r '.\"$OPTIMISM_CHAIN_ID\"[0].contracts.Bridge.address' /app/deployment/nitro-addresses.json")
# TODO
export BRIDGE_NITRO_ADDRESS=
export L1_BRIDGE_MULTIADDR=
export L2_BRIDGE_MULTIADDR=
# Create the required config file:
cat <<EOF > nitro-node-config.yml
nitro_l1_chain_url: "wss://sepolia.laconic.com"
nitro_l2_chain_url: "wss://optimism.laconic.com"
na_address: "$NA_ADDRESS"
ca_address: "$CA_ADDRESS"
vpa_address: "$VPA_ADDRESS"
bridge_contract_address: "$BRIDGE_CONTRACT_ADDRESS"
bridge_nitro_address: "$BRIDGE_NITRO_ADDRESS"
nitro_l1_bridge_multiaddr: "$L1_BRIDGE_MULTIADDR"
nitro_l2_bridge_multiaddr: "$L2_BRIDGE_MULTIADDR"
EOF
```
The required config file should be generated at `/srv/bridge/nitro-node-config.yml`
</details>
<details open>