2019-07-11 10:17:02 +02:00
|
|
|
---
|
2019-05-08 13:51:56 +02:00
|
|
|
- name: Get blocks
|
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"
|
2019-05-08 13:51:56 +02:00
|
|
|
register: BLOCKS
|
2019-11-15 17:31:13 -03:00
|
|
|
when: (ORACLE_HOME_START_BLOCK is not defined) or (ORACLE_FOREIGN_START_BLOCK is not defined)
|
2019-05-08 13:51:56 +02:00
|
|
|
|
|
|
|
- name: Write blocks
|
|
|
|
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: |
|
2019-11-15 17: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 13:51:56 +02:00
|
|
|
|
|
|
|
- name: Get validator address
|
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 -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ 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"
|
2019-05-08 13:51:56 +02:00
|
|
|
register: VADDRESS
|
|
|
|
|
2019-09-13 09:11:38 +02:00
|
|
|
- name: Set ORACLE_VALIDATOR_ADDRESS variable
|
2019-05-08 13:51:56 +02:00
|
|
|
set_fact:
|
2019-09-13 09:11:38 +02:00
|
|
|
ORACLE_VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}"
|
2019-05-08 13:51:56 +02:00
|
|
|
|
2019-11-29 09:28:50 -03:00
|
|
|
- name: Extend docker compose file for erc to native
|
2021-05-08 09:50:46 -06:00
|
|
|
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
2019-11-29 09:28:50 -03:00
|
|
|
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE"
|
2019-10-29 11: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 13:51:56 +02:00
|
|
|
- name: Install .key config
|
|
|
|
template:
|
|
|
|
src: key.j2
|
|
|
|
dest: "/root/.key"
|
|
|
|
owner: root
|
|
|
|
group: root
|
|
|
|
mode: 0600
|