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 }}"
|
2019-05-08 14:51:56 +03:00
|
|
|
shell: docker-compose run --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_affirmation
|
|
|
|
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 }}"
|
2019-09-13 10:11:38 +03:00
|
|
|
shell: docker-compose run -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-10-29 17:55:47 +03:00
|
|
|
- name: Get foreign erc type
|
|
|
|
become_user: "{{ compose_service_user }}"
|
|
|
|
shell: docker-compose run --entrypoint "node scripts/initialChecks.js" bridge_affirmation
|
|
|
|
args:
|
|
|
|
chdir: "{{ bridge_path }}/oracle"
|
|
|
|
register: ERCTYPE
|
|
|
|
|
|
|
|
- name: Set FOREIGN_ERC_TYPE variable
|
|
|
|
set_fact:
|
|
|
|
FOREIGN_ERC_TYPE: "{{ (ERCTYPE.stdout).foreignERC | default('') }}"
|
|
|
|
|
|
|
|
- name: Extend docker compose file
|
|
|
|
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
|
|
|
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE" or ( ORACLE_BRIDGE_MODE == "ERC_TO_ERC" and FOREIGN_ERC_TYPE != "ERC677")
|
|
|
|
|
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
|