2019-07-11 11:17:02 +03:00
|
|
|
---
|
2019-05-08 14:51:56 +03:00
|
|
|
- name: Get blocks
|
2019-07-11 11:17:02 +03:00
|
|
|
become_user: "{{ compose_service_user }}"
|
2020-02-04 00:48:28 +03:00
|
|
|
shell: docker-compose run --rm --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_affirmation
|
2019-05-08 14:51:56 +03:00
|
|
|
args:
|
2019-05-31 15:54:32 +03:00
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
2019-05-08 14:51:56 +03:00
|
|
|
register: BLOCKS
|
2019-11-15 23:31:13 +03:00
|
|
|
when: (ORACLE_HOME_START_BLOCK is not defined) or (ORACLE_FOREIGN_START_BLOCK is not defined)
|
2019-05-08 14:51:56 +03:00
|
|
|
|
|
|
|
- name: Write blocks
|
|
|
|
blockinfile:
|
2019-05-31 15:54:32 +03:00
|
|
|
path: "{{ bridge_path }}/oracle/.env"
|
2019-05-08 14:51:56 +03:00
|
|
|
marker: "## {mark} Calculated by scripts/getValidatorStartBlocks.js"
|
|
|
|
block: |
|
2019-11-15 23:31:13 +03:00
|
|
|
ORACLE_HOME_START_BLOCK={{ (BLOCKS.stdout | from_json).homeStartBlock }}
|
|
|
|
ORACLE_FOREIGN_START_BLOCK={{ (BLOCKS.stdout | from_json).foreignStartBlock }}
|
|
|
|
when: (ORACLE_HOME_START_BLOCK is not defined) or (ORACLE_FOREIGN_START_BLOCK is not defined)
|
2019-05-08 14:51:56 +03:00
|
|
|
|
|
|
|
- name: Get validator address
|
2019-07-11 11:17:02 +03:00
|
|
|
become_user: "{{ compose_service_user }}"
|
2020-02-04 00:48:28 +03:00
|
|
|
shell: docker-compose run --rm -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
|
2019-05-08 14:51:56 +03:00
|
|
|
args:
|
2019-05-31 15:54:32 +03:00
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
2019-05-08 14:51:56 +03:00
|
|
|
register: VADDRESS
|
|
|
|
|
2019-09-13 10:11:38 +03:00
|
|
|
- name: Set ORACLE_VALIDATOR_ADDRESS variable
|
2019-05-08 14:51:56 +03:00
|
|
|
set_fact:
|
2019-09-13 10:11:38 +03:00
|
|
|
ORACLE_VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}"
|
2019-05-08 14:51:56 +03:00
|
|
|
|
2019-11-29 15:28:50 +03:00
|
|
|
- name: Extend docker compose file for erc to native
|
2021-05-08 18:50:46 +03:00
|
|
|
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
2019-11-29 15:28:50 +03:00
|
|
|
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE"
|
2019-10-29 17:55:47 +03:00
|
|
|
|
2021-05-09 16:34:19 +03:00
|
|
|
- name: Extend docker compose file for amb
|
|
|
|
set_fact: composefileoverride="-f docker-compose-amb.yml"
|
|
|
|
when: ORACLE_BRIDGE_MODE == "ARBITRARY_MESSAGE"
|
|
|
|
|
2019-05-08 14:51:56 +03:00
|
|
|
- name: Install .key config
|
|
|
|
template:
|
|
|
|
src: key.j2
|
|
|
|
dest: "/root/.key"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|