diff --git a/l2-setup/README.md b/l2-setup/README.md index be8b0c0..29080d7 100644 --- a/l2-setup/README.md +++ b/l2-setup/README.md @@ -67,27 +67,27 @@ The following commands have to be executed in [`l2-setup`](./) directory l1_priv_key: "" ``` -To setup and run L2, execute the `run-optimism.yml` Ansible playbook by running one of the following commands: +- To setup and run L2, execute the `run-optimism.yml` Ansible playbook by running one of the following commands: -- For local deployment, specify the `"target_host": localhost` in the `--extra-vars` parameter: + - For local deployment, specify the `"target_host": localhost` in the `--extra-vars` parameter: - ```bash - LANG=en_US.utf8 ansible-playbook run-optimism.yml --extra-vars='{ "target_host": "localhost"}' -kK --user $USER - ``` + ```bash + LANG=en_US.utf8 ansible-playbook run-optimism.yml --extra-vars='{ "target_host": "localhost"}' -kK --user $USER + ``` -- For remote deployment, provide an inventory and specify the `"target_host": nitro_host` in the `--extra-vars` parameter: + - For remote deployment, provide an inventory and specify the `"target_host": nitro_host` in the `--extra-vars` parameter: - ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{ "target_host": "nitro_host"}' -kK - ``` + ```bash + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{ "target_host": "nitro_host"}' -kK + ``` - NOTE: By default, deployments are created in a `out` directory. To change this location, update the `l2_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. + NOTE: By default, deployments are created in a `out` directory. To change this location, update the `l2_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. -- For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter: + - For skipping container build, set `"skip_container_build" : true` in the `--extra-vars` parameter: - ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{"target_host" : "nitro_host", "skip_container_build": true}' -kK - ``` + ```bash + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-optimism.yml --extra-vars='{"target_host" : "nitro_host", "skip_container_build": true}' -kK + ``` - To run using existing contracts deployment diff --git a/nitro-bridge-setup/README.md b/nitro-bridge-setup/README.md index b3deae9..127eb22 100644 --- a/nitro-bridge-setup/README.md +++ b/nitro-bridge-setup/README.md @@ -60,7 +60,7 @@ To get started, follow the [installation](../README.md#installation) guide to se - For remote deployment, provide an inventory and specify the `"target_host": nitro_host` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "localhost"}' --user $USER -kK + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "nitro_host"}' --user $USER -kK ``` NOTE: By default, deployments are created in the `out` directory. To change this location, update the `nitro_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. @@ -68,7 +68,7 @@ To get started, follow the [installation](../README.md#installation) guide to se - For skipping container build, run with `"skip_container_build" : true` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "localhost", "skip_container_build": true }' --user $USER -kK + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-bridge.yml --extra-vars='{ "target_host": "nitro_host", "skip_container_build": true }' --user $USER -kK ``` ## Check Deployment Status diff --git a/nitro-bridge-setup/setup-vars.yml b/nitro-bridge-setup/setup-vars.yml index ec984ed..d1d497f 100644 --- a/nitro-bridge-setup/setup-vars.yml +++ b/nitro-bridge-setup/setup-vars.yml @@ -1,3 +1,3 @@ target_host: "localhost" -nitro_directory: nitro-depp +nitro_directory: out skip_container_build: false diff --git a/nitro-nodes-setup/.gitignore b/nitro-nodes-setup/.gitignore index f91659b..8ad0f7d 100644 --- a/nitro-nodes-setup/.gitignore +++ b/nitro-nodes-setup/.gitignore @@ -1,2 +1,3 @@ nitro-vars.yml out +hosts.ini diff --git a/nitro-nodes-setup/README.md b/nitro-nodes-setup/README.md index 256487e..2be1fd2 100644 --- a/nitro-nodes-setup/README.md +++ b/nitro-nodes-setup/README.md @@ -4,6 +4,33 @@ To get started, follow the [installation](../README.md#installation) guide to setup ansible on your machine +## Setup Remote Hosts + +- To run the playbooks on a remote machine, follow these steps: + + - In the [`nitro-nodes-setup`](./) directory, create a new file named hosts.ini: + + ```bash + cp ../example-hosts.ini hosts.ini + ``` + + - Edit the [`hosts.ini`](./hosts.ini) file to run the playbook on a remote machine + + ```bash + [nitro_host] + hostname ansible_host= ansible_user= ansible_ssh_common_args='-o ForwardAgent=yes' + ``` + + - Replace `host_name` with the alias of your choice. + - Replace `` with the IP address or hostname of the target machine. + - Replace `` 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 + ``` + ## Run a nitro node The following commands have to be executed in [`nitro-nodes-setup`](./) directory @@ -58,16 +85,24 @@ The following commands have to be executed in [`nitro-nodes-setup`](./) director - To run a nitro node, execute the `run-nitro-nodes.yml` Ansible playbook by running the following command. - NOTE: By default, deployments are created in the `nitro-nodes-setup/out` directory. To change this location, update the `nitro_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. + - For local deployment, specify the `"target_host": localhost` in the `--extra-vars` parameter: - ```bash - LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-nodes.yml --extra-vars='{ "target_host": "localhost"}' -kK --user $USER - ``` + ```bash + LANG=en_US.utf8 ansible-playbook run-nitro-nodes.yml --extra-vars='{ "target_host": "localhost"}' -kK --user $USER + ``` + + - For remote deployment, provide an inventory and specify the `"target_host": nitro_host` in the `--extra-vars` parameter: + + ```bash + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-nodes.yml --extra-vars='{ "target_host": "nitro_host"}' -kK --user $USER + ``` + + NOTE: By default, deployments are created in a `out` directory. To change this location, update the `nitro_directory` variable in the [setup-vars.yml](./setup-vars.yml) file. - For skipping container build, run with `"skip_container_build" : true` in the `--extra-vars` parameter: ```bash - LANG=en_US.utf8 ansible-playbook -i localhost, --connection=local run-nitro-nodes.yml --extra-vars='{ "target_host": "localhost", "skip_container_build": true }' -kK --user $USER + LANG=en_US.utf8 ansible-playbook -i ./hosts.ini run-nitro-nodes.yml --extra-vars='{ "target_host": "nitro_host", "skip_container_build": true }' -kK --user $USER ``` ## Check Deployment Status diff --git a/nitro-nodes-setup/setup-vars.yml b/nitro-nodes-setup/setup-vars.yml index 7762444..d1d497f 100644 --- a/nitro-nodes-setup/setup-vars.yml +++ b/nitro-nodes-setup/setup-vars.yml @@ -1,3 +1,3 @@ target_host: "localhost" -nitro_directory: ./out +nitro_directory: out skip_container_build: false