Add ansible playbook to setup and run Nitro bridge #4

Merged
nabarun merged 11 commits from deep-stack/testnet-ops:ag-run-bridge into main 2024-09-09 06:11:31 +00:00
4 changed files with 7 additions and 13 deletions
Showing only changes of commit 69bdb67fb1 - Show all commits

View File

@ -2,7 +2,7 @@ nitro_l1_chain_url: ""
nitro_l2_chain_url: "" nitro_l2_chain_url: ""
nitro_chain_pk: "" nitro_chain_pk: ""
nitro_sc_pk: "" nitro_sc_pk: ""
geth_chain_id: "" optimism_chain_id: ""
geth_url: "" geth_url: ""
optimism_url: "" optimism_url: ""
optimism_deployer_pk: "" optimism_deployer_pk: ""

View File

@ -64,7 +64,7 @@
timeout: 60 timeout: 60
- name: Export NA_ADDRESS - name: Export NA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json" shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.NitroAdjudicator.address' /app/deployment/nitro-addresses.json"
args: args:
chdir: "{{ nitro_directory }}" chdir: "{{ nitro_directory }}"
register: na_address register: na_address
@ -72,7 +72,7 @@
msg: "NA_ADDRESS: {{ na_address.stdout }}" msg: "NA_ADDRESS: {{ na_address.stdout }}"
- name: Export CA_ADDRESS - name: Export CA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json" shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.ConsensusApp.address' /app/deployment/nitro-addresses.json"
args: args:
chdir: "{{ nitro_directory }}" chdir: "{{ nitro_directory }}"
register: ca_address register: ca_address
@ -80,7 +80,7 @@
msg: "CA_ADDRESS: {{ ca_address.stdout }}" msg: "CA_ADDRESS: {{ ca_address.stdout }}"
- name: Export VPA_ADDRESS - name: Export VPA_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json" shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.VirtualPaymentApp.address' /app/deployment/nitro-addresses.json"
args: args:
chdir: "{{ nitro_directory }}" chdir: "{{ nitro_directory }}"
register: vpa_address register: vpa_address
@ -88,16 +88,9 @@
msg: "VPA_ADDRESS: {{ vpa_address.stdout }}" msg: "VPA_ADDRESS: {{ vpa_address.stdout }}"
- name: Export L1_ASSET_ADDRESS - name: Export L1_ASSET_ADDRESS
shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"1212\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json" shell: laconic-so deployment --dir nitro-contracts-deployment exec nitro-contracts "jq -r '.\"{{ geth_chain_id }}\"[0].contracts.Token.address' /app/deployment/nitro-addresses.json"
args: args:
chdir: "{{ nitro_directory }}" chdir: "{{ nitro_directory }}"
register: l1_asset_address register: l1_asset_address
- debug: - debug:
msg: "L1_ASSET_ADDRESS: {{ l1_asset_address.stdout }}" msg: "L1_ASSET_ADDRESS: {{ l1_asset_address.stdout }}"
- name: Set contract addresses
set_fact:
na_address: "{{ na_address.stdout }}"
ca_address: "{{ ca_address.stdout }}"
vpa_address: "{{ vpa_address.stdout }}"
l1_asset_address: "{{ l1_asset_address.stdout }}"

View File

@ -65,7 +65,7 @@
timeout: 60 timeout: 60
- name: Print BRIDGE_ADDRESS - name: Print BRIDGE_ADDRESS
shell: laconic-so deployment --dir bridge-deployment exec nitro-bridge "jq -r '.\"42069\"[0].contracts.Bridge.address' /app/deployment/nitro-addresses.json" shell: laconic-so deployment --dir bridge-deployment exec nitro-bridge "jq -r '.\"{{ optimism_chain_id }}\"[0].contracts.Bridge.address' /app/deployment/nitro-addresses.json"
args: args:
chdir: "{{ nitro_directory }}" chdir: "{{ nitro_directory }}"
register: bridge_address register: bridge_address

View File

@ -6,6 +6,7 @@ config:
NITRO_CHAIN_PK: {{ nitro_chain_pk }} NITRO_CHAIN_PK: {{ nitro_chain_pk }}
NITRO_SC_PK: {{ nitro_sc_pk }} NITRO_SC_PK: {{ nitro_sc_pk }}
GETH_URL: {{ geth_url }} GETH_URL: {{ geth_url }}
OPTIMISM_CHAIN_ID: {{ optimism_chain_id }}
OPTIMISM_URL: {{ optimism_url }} OPTIMISM_URL: {{ optimism_url }}
OPTIMISM_DEPLOYER_PK: {{ optimism_deployer_pk }} OPTIMISM_DEPLOYER_PK: {{ optimism_deployer_pk }}
TOKEN_NAME: {{ token_name }} TOKEN_NAME: {{ token_name }}