-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge the develop branch to the master branch, preparation to v1.3.0-rc0
- Loading branch information
Showing
38 changed files
with
342 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+427 KB
audit/quantstamp/POA-Network-Token-bridge-security-assessment-report.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
- import_playbook: ../../../deployment/site.yml | ||
- import_playbook: ./run-checks.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Generate initial data for monitor | ||
hosts: monitor | ||
become: true | ||
tasks: | ||
- name: Run monitor checks | ||
shell: /bin/bash -c 'cd /home/poadocker/bridge/monitor/scripts; ./getBridgeStats.sh >cronWorker.out 2>cronWorker.err' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
## Deploy multiple bridge monitor on the same host | ||
|
||
If you want to deploy a monitor for different bridges, the [monitor variables](../monitor/.env.example) should be configured in `group_vars/<bridge_name>.yml` for each bridge. | ||
|
||
For example, let's say we are going to deploy a monitor for xDai bridge and for WETC bridge. | ||
|
||
#### Setup ansible configuration for xDai Bridge | ||
|
||
First we create `hosts.yml` file to deploy the monitor for xdai bridge | ||
```yaml | ||
--- | ||
xdai: | ||
children: | ||
monitor: | ||
hosts: | ||
<host_ip_A>: | ||
ansible_user: ubuntu | ||
``` | ||
In `group_vars/xdai.yml` | ||
``` | ||
--- | ||
MONITOR_BRIDGE_NAME: "xdai" | ||
MONITOR_PORT: 3003 | ||
|
||
COMMON_HOME_RPC_URL: "https://dai.poa.network" | ||
COMMON_HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6" | ||
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io/v3/INFURA_KEY" | ||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016" | ||
|
||
COMMON_HOME_GAS_PRICE_FALLBACK: 0 | ||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" | ||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" | ||
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 10000000000 | ||
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 | ||
|
||
MONITOR_HOME_START_BLOCK: 759 | ||
MONITOR_FOREIGN_START_BLOCK: 6478417 | ||
MONITOR_VALIDATOR_HOME_TX_LIMIT: 0 | ||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 | ||
MONITOR_TX_NUMBER_THRESHOLD: 100 | ||
``` | ||
Run the playbook to deploy the monitor for xdai bridge | ||
``` | ||
ansible-playbook -i hosts.yml site.yml | ||
``` | ||
This command will deploy the monitor component and enable statistics for xdai bridge. | ||
#### Setup ansible configuration for WETC Bridge | ||
Update `hosts.yml` file to deploy the monitor for WETC Bridge | ||
```yaml | ||
--- | ||
wetc: | ||
children: | ||
monitor: | ||
hosts: | ||
<host_ip_A>: | ||
ansible_user: ubuntu | ||
``` | ||
|
||
In `group_vars/wetc.yml` | ||
``` | ||
--- | ||
MONITOR_BRIDGE_NAME: "wetc" | ||
COMMON_HOME_RPC_URL: "https://ethereumclassic.network" | ||
COMMON_HOME_BRIDGE_ADDRESS: "0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9" | ||
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io/v3/32e8e252699a4ac1b5dd5c1ef53cc301" | ||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040" | ||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice-etc.poa.network/" | ||
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard" | ||
COMMON_HOME_GAS_PRICE_FALLBACK: 15000000000 | ||
COMMON_HOME_GAS_PRICE_FACTOR: 1 | ||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" | ||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" | ||
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 10000000000 | ||
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 | ||
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 | ||
MONITOR_HOME_START_BLOCK: 7703292 | ||
MONITOR_FOREIGN_START_BLOCK: 7412459 | ||
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000 | ||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 | ||
MONITOR_TX_NUMBER_THRESHOLD: 100 | ||
``` | ||
Given that there is a monitor component deployed in the system, the `MONITOR_PORT` variable is not needed. | ||
|
||
Run the playbook to deploy the monitor for WETC Bridge | ||
``` | ||
ansible-playbook -i hosts.yml site.yml | ||
``` | ||
|
||
They playbook will detect that the monitor component is already deployed in the system, so it will only generate the configuration needed to enable the WETC Bridge statistics. | ||
|
||
##### Get Monitor results | ||
The monitor output will be available at `http://host_ip_A:MONITOR_PORT/MONITOR_BRIDGE_NAME`. | ||
|
||
Given that in `xdai.env` the variable `MONITOR_BRIDGE_NAME` is set to `xdai`, the results are in the url `http://host_ip_A:3003/xdai/`. | ||
|
||
Similar to the xdai case, in `wetc.env` the variable `MONITOR_BRIDGE_NAME` is set to `wetc`, so the results are in the url `http://host_ip_A:3003/wetc/`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
--- | ||
- include_tasks: dependencies.yml | ||
- include_tasks: repo.yml | ||
- include_tasks: logging.yml | ||
- name: Check if component is already deployed | ||
shell: "test -f {{ bridge_path }}/{{ component }}/docker-compose.yml && echo 'true'" | ||
ignore_errors: True | ||
register: already_deployed | ||
when: check_deployed is defined | ||
|
||
- name: Set if tasks should be skipped | ||
set_fact: skip_task="{{ already_deployed.stdout | default('false') }}" | ||
|
||
- name: Include dependencies tasks | ||
include_tasks: dependencies.yml | ||
when: skip_task != true | ||
|
||
- name: Include repo tasks | ||
include_tasks: repo.yml | ||
when: skip_task != true | ||
|
||
- name: Include logging tasks | ||
include_tasks: logging.yml | ||
when: skip_task != true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
--- | ||
dependencies: | ||
- role: common | ||
- { role: common, check_deployed: true, component: 'monitor' } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,18 @@ | ||
--- | ||
- include_tasks: pre_config.yml | ||
- include_tasks: logging.yml | ||
- include_tasks: jumpbox.yml | ||
- include_tasks: servinstall.yml | ||
- include_tasks: cron.yml | ||
|
||
- name: Include logging tasks | ||
include_tasks: logging.yml | ||
when: skip_task != true | ||
|
||
- name: Include jumpbox tasks | ||
include_tasks: jumpbox.yml | ||
when: skip_task != true | ||
|
||
- name: Include servinstall tasks | ||
include_tasks: servinstall.yml | ||
when: skip_task != true | ||
|
||
- name: Include cron tasks | ||
include_tasks: cron.yml | ||
when: skip_task != true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1 @@ | ||
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }} | ||
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }} | ||
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }} | ||
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }} | ||
MONITOR_HOME_START_BLOCK={{ MONITOR_HOME_START_BLOCK }} | ||
MONITOR_FOREIGN_START_BLOCK={{ MONITOR_FOREIGN_START_BLOCK }} | ||
MONITOR_VALIDATOR_HOME_TX_LIMIT={{ MONITOR_VALIDATOR_HOME_TX_LIMIT }} | ||
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }} | ||
{% endif %} | ||
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }} | ||
{% endif %} | ||
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }} | ||
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }} | ||
{% endif %} | ||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT={{ MONITOR_VALIDATOR_FOREIGN_TX_LIMIT }} | ||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }} | ||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }} | ||
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }} | ||
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }} | ||
MONITOR_LEFT_TX_THRESHOLD={{ MONITOR_LEFT_TX_THRESHOLD }} | ||
MONITOR_PORT={{ MONITOR_PORT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
MONITOR_BRIDGE_NAME={{ MONITOR_BRIDGE_NAME }} | ||
|
||
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }} | ||
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }} | ||
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }} | ||
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }} | ||
|
||
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }} | ||
{% endif %} | ||
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }} | ||
{% endif %} | ||
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }} | ||
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %} | ||
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }} | ||
{% endif %} | ||
|
||
{% if COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | default('') != '' %} | ||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }} | ||
{% endif %} | ||
{% if COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %} | ||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }} | ||
{% endif %} | ||
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }} | ||
{% if COMMON_FOREIGN_GAS_PRICE_FACTOR | default('') != '' %} | ||
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }} | ||
{% endif %} | ||
|
||
MONITOR_HOME_START_BLOCK={{ MONITOR_HOME_START_BLOCK }} | ||
MONITOR_FOREIGN_START_BLOCK={{ MONITOR_FOREIGN_START_BLOCK }} | ||
MONITOR_VALIDATOR_HOME_TX_LIMIT={{ MONITOR_VALIDATOR_HOME_TX_LIMIT }} | ||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT={{ MONITOR_VALIDATOR_FOREIGN_TX_LIMIT }} | ||
MONITOR_TX_NUMBER_THRESHOLD={{ MONITOR_TX_NUMBER_THRESHOLD }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.