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
2 changed files with 49 additions and 14 deletions
Showing only changes of commit cdf26a0014 - Show all commits

View File

@ -230,6 +230,8 @@
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 L1_ASSET_ADDRESS=$(laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"$GETH_CHAIN_ID\"[0].contracts.Token.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
@ -246,6 +248,7 @@
na_address: "$NA_ADDRESS"
ca_address: "$CA_ADDRESS"
vpa_address: "$VPA_ADDRESS"
l1_asset_address: "${L1_ASSET_ADDRESS}"
bridge_contract_address: "$BRIDGE_CONTRACT_ADDRESS"
bridge_nitro_address: "$BRIDGE_NITRO_ADDRESS"
nitro_l1_bridge_multiaddr: "$L1_BRIDGE_MULTIADDR"

View File

@ -178,8 +178,8 @@
# AssetAddress: '<l1-asset-address>',
# Me: '<your-nitro-address>',
# Them: '<bridge-nitro-address>',
# MyBalance: 1000000n,
# TheirBalance: 1000000n
# MyBalance: <ledger-amount>n,
# TheirBalance: <ledger-amount>n
# },
# ChannelMode: 'Open'
# }
@ -191,18 +191,20 @@
laconic-so deployment --dir l2-nitro-deployment exec nitro-rpc-client "nitro-rpc-client get-all-ledger-channels -p 4005 -h nitro-node"
# Expected output:
# {
# ID: '0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179',
# Status: 'Open',
# Balance: {
# AssetAddress: '<l2-asset-address>',
# Me: '<your-nitro-address>',
# Them: '<bridge-nitro-address>',
# MyBalance: 1000000n,
# TheirBalance: 1000000n
# },
# ChannelMode: 'Open'
# }
# [
# {
# "ID": "0x6a9f5ccf1fa802525d794f4a899897f947615f6acc7141e61e056a8bfca29179",
# "Status": "Open",
# "Balance": {
# "AssetAddress": "<l2-asset-address>",
# "Me": "<your-nitro-address>",
# "Them": "<bridge-nitro-address>",
# "MyBalance": <ledger-amount>n,
# "TheirBalance": <ledger-amount>n
# },
# "ChannelMode": "Open"
# }
# ]
```
## Clean up
@ -230,3 +232,33 @@
sudo rm -r l1-nitro-deployment
sudo rm -r l2-nitro-deployment
```
## Troubleshooting
* Stop (`Ctrl+C`) the direct-fund command if it is stuck
* Restart the L1 Nitro node:
* Stop the deployment:
```bash
cd $DEPLOYMENTS_DIR
laconic-so deployment --dir l1-nitro-deployment stop
```
* Reset the node's durable store:
```bash
sudo rm -rf l1-nitro-deployment/data/nitro_node_data
mkdir l1-nitro-deployment/data/nitro_node_data
```
* Restart the deployment:
```bash
laconic-so deployment --dir l1-nitro-deployment start
```
* Retry the ledger channel creation command