Compare commits

..
Author SHA1 Message Date
Neeraj 8ca78a91bf Get network name by extracting it from deployment.yml 2024-09-12 11:11:49 +05:30
Neeraj c493363214 Remove skip container build instruction 2024-09-12 10:54:02 +05:30
Neeraj 32b0b9ee52 Add comments for values in bridge-vars file 2024-09-12 09:20:36 +05:30
Neeraj 98c502a882 Update steps to modify output directory in setup-vars file 2024-09-11 12:12:52 +05:30
Neeraj 5c79a71851 Add steps to make optimism deployment on remote host 2024-09-11 11:26:25 +05:30
Neeraj edc4f743d6 Add steps to make nitro contract and bridge deployment on remote host 2024-09-11 11:01:37 +05:30
prathamesh 3b6dd2b2c6 Update prerequisites and port mappings 2024-09-11 10:16:50 +05:30
Neeraj 5649d8fd6d Fetch and use peer id and state channel address 2024-09-11 09:27:10 +05:30
Neeraj d71a481db3 Add steps to deploy l1 nitro contracts 2024-09-11 09:27:10 +05:30
prathamesh db67b2fe3b Add details for users Nitro account 2024-09-10 16:20:51 +05:30
prathamesh 7067208d2a Add instructions to bridge funds on L2 2024-09-09 12:19:29 +05:30
prathamesh cdf26a0014 Add troubleshooting steps 2024-09-05 17:47:39 +05:30
prathamesh 2039ad645d Add instructions for users to create ledger channel 2024-09-05 17:08:25 +05:30
prathamesh 776f91468e Add steps to create the required config for Nitro nodes 2024-09-05 13:12:09 +05:30
prathamesh 2c7077d2f7 Fill in values for L2 deployment config 2024-09-05 12:36:41 +05:30
prathamesh 1bf0066234 Update instructions L2 and bridge setup 2024-09-05 09:10:54 +05:30
prathamesh ed0b13ce31 Add instructions to setup and run Nitro bridge deployment 2024-09-03 19:34:08 +05:30
prathamesh 5ad781d258 Fix L2 config file path in instructions 2024-09-03 15:40:29 +05:30
prathamesh 21bafbfd4b Add instructions for running a testnet Nitro node 2024-09-03 14:57:22 +05:30
Neeraj aa656e828d Add README to run nitro node 2024-09-03 11:57:57 +05:30
Shreerang Kale a6cfdf5325 Add instructions to setup and run L2 deployment from scratch 2024-09-03 11:12:06 +05:30
5 changed files with 58 additions and 123 deletions
+1 -1
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
+39 -46
View File
@@ -2,7 +2,7 @@
## Login
* Log in as `dev` user on the deployments machine
* Log in as `dev` user on the deployments VM
* All the deployments are placed in the `/srv` directory:
@@ -22,7 +22,7 @@
* Ansible: see [installation](https://git.vdb.to/cerc-io/testnet-ops#installation)
* On deployments machine(s):
* On deployments VM(s):
* laconic-so: see [installation](https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/stack-orchestrator-setup/README.md)
@@ -39,7 +39,7 @@
* Target dir: `/srv/op-sepolia/optimism-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment on VM if required:
```bash
cd /srv/op-sepolia
@@ -59,10 +59,10 @@
cd testnet-ops/l2-setup
```
* Copy the `l2-vars.example.yml` vars file:
* Copy the `l2-vars-example.yml` vars file:
```bash
cp l2-vars.example.yml l2-vars.yml
cp l2-vars-example.yml l2-vars.yml
```
* Edit `l2-vars.yml` with required values:
@@ -110,14 +110,13 @@
* Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
```ini
[<deployment_host>]
[l2_host]
<host_name> ansible_host=<target_ip> ansible_user=<ssh_user> ansible_ssh_common_args='-o ForwardAgent=yes'
```
* Replace `<deployment_host>` with `l2_host`
* 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)
- 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:
@@ -142,13 +141,13 @@
* Bridge funds on L2:
* On the deployment machine, set the following variables:
* On the deployment VM, set the following variables:
```bash
cd /srv/op-sepolia
L1_RPC=http://localhost:8545
L2_RPC=http://op-geth:8545
L1_RPC=http://host.docker.internal:8545
L2_RPC=http://host.docker.internal:9545
NETWORK=$(grep 'cluster-id' optimism-deployment/deployment.yml | sed 's/cluster-id: //')_default
@@ -176,7 +175,7 @@
* Use cast to send ETH to the bridge contract:
```bash
docker run --rm --network host cerc/optimism-contracts:local "cast send --from $ACCOUNT --value 1ether $BRIDGE --rpc-url $L1_RPC --private-key $ACCOUNT_PK"
docker run --rm cerc/optimism-contracts:local "cast send --from $ACCOUNT --value 1ether $BRIDGE --rpc-url $L1_RPC --private-key $ACCOUNT_PK"
```
* Allow a couple minutes for the bridge to complete
@@ -202,7 +201,7 @@
* Target dir: `/srv/bridge/nitro-contracts-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment on VM if required:
```bash
cd /srv/bridge
@@ -236,9 +235,7 @@
# L1 chain ID (Sepolia: 11155111)
geth_chain_id: "11155111"
# 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
# Private key for a funded account on L1 to use for contracts deployment on L1
geth_deployer_pk: ""
# Custom L1 token to be deployed
@@ -268,14 +265,13 @@
* Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
```ini
[deployment_host]
[nitro_host]
<host_name> ansible_host=<target_ip> ansible_user=<ssh_user> ansible_ssh_common_args='-o ForwardAgent=yes'
```
* Replace `<deployment_host>` with `nitro_host`
* 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)
- 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:
@@ -298,7 +294,7 @@
LANG=en_US.utf8 ansible-playbook -i hosts.ini deploy-contracts.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
```
* Check logs for deployment on the remote machine:
* Check logs for deployment on the virtual machine:
```bash
cd /srv/bridge
@@ -320,7 +316,7 @@
* Target dir: `/srv/bridge/bridge-deployment`
* Cleanup an existing deployment if required:
* Cleanup an existing deployment on VM if required:
```bash
cd /srv/bridge
@@ -334,7 +330,7 @@
### Setup
* Execute the following command on deployment machine to get the deployed L1 Nitro contract addresses along with the L1 asset address:
* Execute the command on the deployment VM to get the deployed L1 Nitro contract addresses along with the L1 asset address:
```bash
cd /srv/bridge
@@ -390,8 +386,8 @@
# Private key for bridge Nitro address
nitro_sc_pk: ""
# 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
# Private key for a funded account on L1
# This account should have L1 tokens for funding Nitro channels
nitro_chain_pk: ""
# L2 chain ID (Optimism: 42069)
@@ -400,6 +396,10 @@
# 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: ""
@@ -435,14 +435,13 @@
* Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine:
```ini
[deployment_host]
[nitro_host]
<host_name> ansible_host=<target_ip> ansible_user=<ssh_user> ansible_ssh_common_args='-o ForwardAgent=yes'
```
* Replace `<deployment_host>` with `nitro_host`
* 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)
- 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:
@@ -465,7 +464,7 @@
LANG=en_US.utf8 ansible-playbook -i hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK
```
* Check logs for deployments on the remote machine:
* Check logs for deployments on the virtual machine:
```bash
cd /srv/bridge
@@ -494,12 +493,12 @@
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")
export BRIDGE_NITRO_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.SCAddress')
export BRIDGE_NITRO_ADDRESS=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4006 -h nitro-bridge" | jq -r '.SCAddress')
export BRIDGE_PEER_ID=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4005 -h nitro-bridge" | jq -r '.MessageServicePeerId')
export BRIDGE_PEER_ID=$(laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-node-info -p 4006 -h nitro-bridge" | jq -r '.MessageServicePeerId')
export L1_BRIDGE_MULTIADDR="/dns4/l1.bridge.laconic.com/tcp/3005/p2p/$BRIDGE_PEER_ID"
export L2_BRIDGE_MULTIADDR="/dns4/l2.bridge.laconic.com/tcp/3006/p2p/$BRIDGE_PEER_ID"
export L1_BRIDGE_MULTIADDR="/dns4/bridge.laconic.com/tcp/3005/p2p/$BRIDGE_PEER_ID"
export L2_BRIDGE_MULTIADDR="/dns4/bridge.laconic.com/tcp/3006/p2p/$BRIDGE_PEER_ID"
# Create the required config file
cat <<EOF > nitro-node-config.yml
@@ -516,15 +515,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 generated file at location `ops/stage2/nitro-node-config.yml` within this repository
* List down L2 channels created by the bridge:
```bash
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge"
```
Check in the file at location `ops/stage2/nitro-node-config.yml`
</details>
-10
View File
@@ -1,10 +0,0 @@
nitro_l1_chain_url: "wss://sepolia.laconic.com"
nitro_l2_chain_url: "wss://optimism.laconic.com"
na_address: "0xfD5276DDfE0E7738Af5F3dA0dE58D36560BbE544"
ca_address: "0xC71F47d58d521aE24FDf5e324969aCD6f83b6Ff8"
vpa_address: "0xEA55dEab3718CF4d084a94Fe4C0D750a80Eb1F2C"
l1_asset_address: "0xa4351114dAE1aBEb2d552d441C9733c72682a45D"
bridge_contract_address: "0x0fCC47652bd8Fa5ED4192DD6238B4d523B34D724"
bridge_nitro_address: "0xf0E6a85C6D23AcA9ff1b83477D426ed26F218185"
nitro_l1_bridge_multiaddr: "/dns4/l1.bridge.laconic.com/tcp/3005/p2p/16Uiu2HAky2PYTfBNHpytybz4ADY9n7boiLgK5btJpTrGVbWC3diZ"
nitro_l2_bridge_multiaddr: "/dns4/l2.bridge.laconic.com/tcp/3006/p2p/16Uiu2HAky2PYTfBNHpytybz4ADY9n7boiLgK5btJpTrGVbWC3diZ"
+16 -64
View File
@@ -2,24 +2,30 @@
## Prerequisites
* Local:
* 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)
* Ansible: see [installation](https://git.vdb.to/cerc-io/testnet-ops#installation)
* yq: see [installation](https://github.com/mikefarah/yq#install)
* yq: see [installation](https://github.com/mikefarah/yq#install)
* On deployment machine:
* Check versions to verify installation:
* laconic-so: see [installation](https://git.vdb.to/cerc-io/testnet-ops/src/branch/main/stack-orchestrator-setup/README.md)
```bash
laconic-so version
ansible --version
yq --version
```
## Setup
* On your local machine, clone the `cerc-io/testnet-ops` repository:
* Clone the `cerc-io/testnet-ops` repository:
```bash
git clone git@git.vdb.to:cerc-io/testnet-ops.git
cd testnet-ops/nitro-nodes-setup
cd testnet-ops/nitro-node-setup
```
* Fetch the required Nitro node config:
@@ -78,11 +84,7 @@
# Will create deployments at $DEPLOYMENTS_DIR/nitro-node/l1-nitro-deployment and $DEPLOYMENTS_DIR/nitro-node/l2-nitro-deployment
```
## Run Nitro Nodes
Nitro nodes can be run using Ansible either locally or on a remote machine; follow corresponding steps for your setup
### On Local Host
## Run
* Setup and run a Nitro node (L1+L2) by executing the `run-nitro-nodes.yml` Ansible playbook:
@@ -90,51 +92,7 @@ Nitro nodes can be run using Ansible either locally or on a remote machine; foll
LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-nodes.yml --extra-vars='{ "target_host": "localhost"}' --user $USER
```
### On Remote Host
* 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
[deployment_host]
<host_name> ansible_host=<target_ip> ansible_user=<ssh_user> ansible_ssh_common_args='-o ForwardAgent=yes'
```
* Replace `<deployment_host>` with `nitro_host`
* 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:
* Check status:
```bash
cd $DEPLOYMENTS_DIR/nitro-node
@@ -142,17 +100,11 @@ Nitro nodes can be run using Ansible either locally or on a remote machine; foll
# Check the logs, ensure that the nodes are running
laconic-so deployment --dir l1-nitro-deployment logs nitro-node -f
laconic-so deployment --dir l2-nitro-deployment logs nitro-node -f
# Let L1 node sync up with the chain
# Expected logs after sync:
# nitro-node-1 | 2:04PM INF Initializing Http RPC transport...
# nitro-node-1 | 2:04PM INF Completed RPC server initialization url=127.0.0.1:4005/api/v1
```
## Create Channels
Create a ledger channel with the bridge on L1 which is mirrored on L2
* Run the following commands from the directory where the deployments are created
* Create a ledger channel with the bridge on L1 that gets mirrored on L2
* Set required variables:
+2 -2
View File
@@ -879,7 +879,7 @@
- Open new terminal, check that no channels exist on L2
```bash
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4005 -h nitro-bridge"
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge"
```
- Set address of bridge and address of custom token on L1 in the current terminal
@@ -952,7 +952,7 @@
- Check status of all L2 mirrored ledger channels
```bash
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4005 -h nitro-bridge"
laconic-so deployment --dir bridge-deployment exec nitro-rpc-client "nitro-rpc-client get-all-l2-channels -p 4006 -h nitro-bridge"
# Expected output:
# {"ID":"0x15dbe6b996e4e46fdd6ea3e2074cbca58014dbb07368e3e7ba286df5c7b9da0d","Status":"Open","Balance":{"AssetAddress":"<Token_address_on_L2>","Me":"0xbbb676f9cff8d242e9eac39d063848807d3d1d94","Them":"0xa8d2d06ace9c7ffc24ee785c2695678aecdfd7a0","MyBalance":1000000,"TheirBalance":1000000},"ChannelMode":"Open"}