2019-07-11 10:17:02 +02:00
|
|
|
---
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Get blocks for TokenBridge
|
2019-07-11 10:17:02 +02:00
|
|
|
become_user: "{{ compose_service_user }}"
|
2020-02-03 18:48:28 -03:00
|
|
|
shell: docker-compose run --rm --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_affirmation
|
2019-05-08 13:51:56 +02:00
|
|
|
args:
|
2019-05-31 14:54:32 +02:00
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
2022-02-22 22:29:40 +03:00
|
|
|
register: TBBLOCKS
|
|
|
|
when: (TB_HOME_START_BLOCK is not defined) or (TB_FOREIGN_START_BLOCK is not defined)
|
2019-05-08 13:51:56 +02:00
|
|
|
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Get blocks for AMB
|
|
|
|
become_user: "{{ compose_service_user }}"
|
|
|
|
shell: docker-compose run --rm --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_amb_affirmation
|
|
|
|
args:
|
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
|
|
|
register: AMBBLOCKS
|
|
|
|
when: (AMB_HOME_START_BLOCK is not defined) or (AMB_FOREIGN_START_BLOCK is not defined)
|
|
|
|
|
|
|
|
- name: Write blocks for TokenBridge
|
2019-05-08 13:51:56 +02:00
|
|
|
blockinfile:
|
2019-05-31 14:54:32 +02:00
|
|
|
path: "{{ bridge_path }}/oracle/.env"
|
2019-05-08 13:51:56 +02:00
|
|
|
marker: "## {mark} Calculated by scripts/getValidatorStartBlocks.js"
|
|
|
|
block: |
|
2022-02-22 22:29:40 +03:00
|
|
|
TB_HOME_START_BLOCK={{ (TBBLOCKS.stdout | from_json).homeStartBlock }}
|
|
|
|
TB_FOREIGN_START_BLOCK={{ (TBBLOCKS.stdout | from_json).foreignStartBlock }}
|
|
|
|
when: (TB_HOME_START_BLOCK is not defined) or (TB_FOREIGN_START_BLOCK is not defined)
|
2019-05-08 13:51:56 +02:00
|
|
|
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Write blocks for AMB
|
|
|
|
blockinfile:
|
|
|
|
path: "{{ bridge_path }}/oracle/.env"
|
|
|
|
marker: "## {mark} Calculated by scripts/getValidatorStartBlocks.js"
|
|
|
|
block: |
|
|
|
|
AMB_HOME_START_BLOCK={{ (AMBBLOCKS.stdout | from_json).homeStartBlock }}
|
|
|
|
AMB_FOREIGN_START_BLOCK={{ (AMBBLOCKS.stdout | from_json).foreignStartBlock }}
|
|
|
|
when: (AMB_HOME_START_BLOCK is not defined) or (AMB_FOREIGN_START_BLOCK is not defined)
|
|
|
|
|
|
|
|
- name: Get validator address for TokenBridge
|
2019-07-11 10:17:02 +02:00
|
|
|
become_user: "{{ compose_service_user }}"
|
2022-02-22 22:29:40 +03:00
|
|
|
shell: docker-compose run --rm -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ TB_ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
|
2019-05-08 13:51:56 +02:00
|
|
|
args:
|
2019-05-31 14:54:32 +02:00
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
2022-02-22 22:29:40 +03:00
|
|
|
register: TBVADDRESS
|
2019-05-08 13:51:56 +02:00
|
|
|
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Set TB_ORACLE_VALIDATOR_ADDRESS variable
|
2019-05-08 13:51:56 +02:00
|
|
|
set_fact:
|
2022-02-22 22:29:40 +03:00
|
|
|
TB_ORACLE_VALIDATOR_ADDRESS: "{{ TBVADDRESS.stdout }}"
|
2019-05-08 13:51:56 +02:00
|
|
|
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Get validator address for AMB
|
|
|
|
become_user: "{{ compose_service_user }}"
|
|
|
|
shell: docker-compose run --rm -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ AMB_ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
|
|
|
|
args:
|
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
|
|
|
register: AMBVADDRESS
|
2019-10-29 11:55:47 -03:00
|
|
|
|
2022-02-22 22:29:40 +03:00
|
|
|
- name: Set AMB_ORACLE_VALIDATOR_ADDRESS variable
|
|
|
|
set_fact:
|
|
|
|
AMB_ORACLE_VALIDATOR_ADDRESS: "{{ AMBVADDRESS.stdout }}"
|
2021-05-09 16:34:19 +03:00
|
|
|
|
2019-05-08 13:51:56 +02:00
|
|
|
- name: Install .key config
|
|
|
|
template:
|
|
|
|
src: key.j2
|
|
|
|
dest: "/root/.key"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|