Compare commits

..

37 Commits

Author SHA1 Message Date
Gerardo Nardelli
9d4dea9823 Fix amb subsidized mode e2e test 2019-08-22 17:35:53 -03:00
Gerardo Nardelli
2357d787a6 Fix amb subsidized mode tests in oracle-e2e 2019-08-22 17:22:49 -03:00
Gerardo Nardelli
065956e94e Fix amb subsidized mode hash in oracle-e2e 2019-08-22 17:08:49 -03:00
Gerardo Nardelli
7e651a86c4 Update oracle-e2e tests box contract addresses 2019-08-22 16:53:14 -03:00
Gerardo Nardelli
411c35d873 Fix amb packSignatures method in Oracle 2019-08-22 16:16:54 -03:00
Gerardo Nardelli
3ff096ef55 Lint fixes 2019-08-22 13:37:38 -03:00
Gerardo Nardelli
7f15733ad3 Merge fix 2019-08-22 13:30:07 -03:00
Gerardo Nardelli
d22a3e8bae Merge branch 'master' into amb-oracle
# Conflicts:
#	.prettierrc
#	commons/abis.js
#	commons/package.json
#	e2e-commons/docker-compose.yml
#	monitor/eventsStats.js
#	monitor/utils/events.js
#	oracle/src/services/gasPrice.js
#	oracle/test/gasPrice.test.js
#	yarn.lock
2019-08-22 12:10:49 -03:00
Gerardo Nardelli
43609d739d Pack signatures when processing amb collectedSignatures event in Oracle 2019-08-22 11:06:44 -03:00
Gerardo Nardelli
ab5166b895 Update submodule 2019-08-22 10:39:47 -03:00
Gerardo Nardelli
383e22cb58 Update amb message processing 2019-08-20 15:19:49 -03:00
Gerardo Nardelli
e1f20b8686 Update contract submodule 2019-08-20 15:19:09 -03:00
Gerardo Nardelli
4b59f18d29 Fix amb monitor 2019-07-30 10:05:44 -03:00
Gerardo Nardelli
2d42c236d7 Fix prettier 2019-07-25 15:28:36 -03:00
Gerardo Nardelli
ee4a6c8f5c Fix amb events in monitor 2019-07-25 14:44:05 -03:00
Gerardo Nardelli
55f8443c55 Update contract submodule 2019-07-25 14:43:14 -03:00
Gerardo Nardelli
e5ce665656 Move amb message utils to commons 2019-07-25 12:36:10 -03:00
Gerardo Nardelli
751b885f73 Support amb events info in monitor 2019-07-25 11:30:59 -03:00
Gerardo Nardelli
3d0f68fad9 Support amb balances info in monitor 2019-07-24 11:50:35 -03:00
Gerardo Nardelli
08d2c46a03 Update deployment oracle template 2019-07-23 11:35:54 -03:00
Gerardo Nardelli
48620a8d01 Update submodule to latest amb contract changes 2019-07-18 15:07:29 -03:00
Gerardo Nardelli
35c2e642ee Update amb contract submodule 2019-07-18 10:23:03 -03:00
Gerardo Nardelli
a056a75932 Update amb contract submodule 2019-07-18 09:30:40 -03:00
Gerardo Nardelli
e8a179bc19 Update contract module name 2019-07-18 09:04:10 -03:00
Gerardo Nardelli
aa32f2cc0c Update contract submodule 2019-07-18 08:39:51 -03:00
Gerardo Nardelli
473b6a3e46 Fix commons unit test 2019-07-17 12:09:55 -03:00
Gerardo Nardelli
8cf97aea3c Fix e2e-commons up script 2019-07-17 12:03:29 -03:00
Gerardo Nardelli
ac6775bd6e Lint fix 2019-07-17 11:53:43 -03:00
Gerardo Nardelli
478b30b2ed Add ARBITRARY_MESSAGE bridge mode 2019-07-17 11:49:29 -03:00
Gerardo Nardelli
70d03c1a93 Oracle amb merge fix 2019-07-17 11:47:25 -03:00
Gerardo Nardelli
0694fc24e9 Merge branch 'master' into amb-oracle
# Conflicts:
#	oracle-e2e/deploy.js
#	oracle-e2e/docker-compose.yml
#	oracle-e2e/run-tests.sh
#	oracle/config/base.config.js
#	oracle/src/services/gasPrice.js
#	oracle/src/utils/utils.js
#	oracle/test/gasPrice.test.js
2019-07-17 10:00:10 -03:00
Gerardo Nardelli
80940a0a82 Use compiled amb contracts on oracle 2019-06-04 11:25:53 -03:00
Gerardo Nardelli
a2603701b6 Merge branch 'master' into amb-oracle
# Conflicts:
#	oracle-e2e/run-tests.sh
2019-06-04 10:26:31 -03:00
Gerardo Nardelli
e006443f50 add amb oracle e2e tests 2019-06-03 16:56:53 -03:00
Gerardo Nardelli
0326745684 Update submodule to amb branch 2019-06-03 16:56:13 -03:00
Gerardo Nardelli
95f4a0acc6 use gas price from message on gas estimate for amb events 2019-05-27 16:28:29 -03:00
Gerardo Nardelli
7ca3b0079c add amb base implementation on oracle 2019-05-24 15:42:26 -03:00
246 changed files with 8816 additions and 5945 deletions

View File

@@ -5,16 +5,10 @@ orbs:
commands: commands:
install-chrome: install-chrome:
steps: steps:
- run:
name: Update dpkg
command: |
sudo apt-get clean
sudo apt-get update
sudo apt-get install dpkg
- run: - run:
name: Install Chrome name: Install Chrome
command: | command: |
wget -O chrome.deb https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_77.0.3865.120-1_amd64.deb wget -O chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i chrome.deb sudo dpkg -i chrome.deb
install-node: install-node:
steps: steps:
@@ -24,7 +18,7 @@ orbs:
export NVM_DIR="/opt/circleci/.nvm" export NVM_DIR="/opt/circleci/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install 10.16.3 && nvm alias default 10.16.3 nvm install 11.4.0 && nvm alias default 11.4.0
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
@@ -89,29 +83,29 @@ jobs:
- checkout - checkout
- run: git submodule update --init - run: git submodule update --init
- restore_cache: - restore_cache:
name: Restore Yarn Package Cache name: Restore Yarn Package Cache
keys: keys:
- yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} - yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
- run: git submodule status > submodule.status - run: git submodule status > submodule.status
- restore_cache: - restore_cache:
name: Restore contracts submodule with compiled contracts name: Restore contracts submodule with compiled contracts
keys: keys:
- contracts-{{ checksum "submodule.status" }} - contracts-{{ checksum "submodule.status" }}
- run: yarn install --frozen-lockfile - run: yarn install --frozen-lockfile
- save_cache: - save_cache:
name: Save Yarn Package Cache name: Save Yarn Package Cache
key: yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }} key: yarn-{{ checksum "package.json" }}-{{ checksum "yarn.lock" }}
paths: paths:
- ~/.cache/yarn - ~/.cache/yarn
- run: touch install_deploy.log; test -d contracts/build/contracts || yarn install:deploy &> install_deploy.log - run: touch install_deploy.log; test -d contracts/build/contracts || yarn install:deploy &> install_deploy.log
- store_artifacts: - store_artifacts:
path: install_deploy.log path: install_deploy.log
- run: test -d contracts/build/contracts || yarn compile:contracts - run: test -d contracts/build/contracts || yarn compile:contracts
- save_cache: - save_cache:
name: Save contracts submodule with compiled contracts name: Save contracts submodule with compiled contracts
key: contracts-{{ checksum "submodule.status" }} key: contracts-{{ checksum "submodule.status" }}
paths: paths:
- contracts - contracts
- save_cache: - save_cache:
name: Save initialized project for subsequent jobs name: Save initialized project for subsequent jobs
key: initialize-{{ .Environment.CIRCLE_SHA1 }} key: initialize-{{ .Environment.CIRCLE_SHA1 }}
@@ -143,11 +137,11 @@ jobs:
oracle-e2e: oracle-e2e:
executor: tokenbridge-orb/docker-node executor: tokenbridge-orb/docker-node
steps: steps:
- checkout - checkout
- run: git submodule update --init - run: git submodule update --init
- setup_remote_docker: - setup_remote_docker:
docker_layer_caching: true docker_layer_caching: true
- run: yarn run oracle-e2e - run: yarn run oracle-e2e
ui-e2e: ui-e2e:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
steps: steps:
@@ -161,9 +155,9 @@ jobs:
monitor-e2e: monitor-e2e:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
steps: steps:
- checkout - checkout
- run: git submodule update --init - run: git submodule update --init
- run: ./monitor-e2e/run-tests.sh - run: ./monitor-e2e/run-tests.sh
cover: cover:
executor: tokenbridge-orb/docker-node executor: tokenbridge-orb/docker-node
steps: steps:
@@ -175,50 +169,17 @@ jobs:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
steps: steps:
- checkout - checkout
- run: git submodule update --init - run: deployment/molecule/molecule.sh oracle
- run:
name: Run the scenario
command: deployment-e2e/molecule.sh oracle
no_output_timeout: 40m
deployment-ui: deployment-ui:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
steps: steps:
- checkout - checkout
- run: git submodule update --init - run: deployment/molecule/molecule.sh ui
- run:
name: Run the scenario
command: deployment-e2e/molecule.sh ui
no_output_timeout: 40m
deployment-monitor: deployment-monitor:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
steps: steps:
- checkout - checkout
- run: git submodule update --init - run: deployment/molecule/molecule.sh monitor
- run:
name: Run the scenario
command: deployment-e2e/molecule.sh monitor
no_output_timeout: 40m
deployment-repo:
executor: tokenbridge-orb/machine-with-docker-caching
steps:
- checkout
- run: git submodule update --init
- tokenbridge-orb/install-node
- tokenbridge-orb/install-yarn
- tokenbridge-orb/yarn-install-cached-on-machine
- run:
name: Run the scenario
command: deployment-e2e/molecule.sh repo
no_output_timeout: 40m
deployment-multiple:
executor: tokenbridge-orb/machine-with-docker-caching
steps:
- checkout
- run: git submodule update --init
- run:
name: Run the scenario
command: deployment-e2e/molecule.sh multiple
no_output_timeout: 40m
ultimate: ultimate:
executor: tokenbridge-orb/machine-with-docker-caching executor: tokenbridge-orb/machine-with-docker-caching
parameters: parameters:
@@ -230,11 +191,6 @@ jobs:
type: string type: string
ui-e2e-grep: ui-e2e-grep:
description: "Mocha grep string used to run ui-e2e tests specific to given type of bridge" description: "Mocha grep string used to run ui-e2e tests specific to given type of bridge"
default: ''
type: string
oracle-e2e-script:
description: "Yarn script string used to run oracle-e2e tests specific to given type of bridge"
default: ''
type: string type: string
steps: steps:
- checkout - checkout
@@ -245,24 +201,16 @@ jobs:
- tokenbridge-orb/yarn-install-cached-on-machine - tokenbridge-orb/yarn-install-cached-on-machine
- run: - run:
name: Prepare the infrastructure name: Prepare the infrastructure
command: e2e-commons/up.sh deploy << parameters.scenario-name >> blocks command: e2e-commons/up.sh deploy << parameters.scenario-name >>
no_output_timeout: 50m no_output_timeout: 30m
- tokenbridge-orb/wait-for-oracle: - tokenbridge-orb/wait-for-oracle:
redis-key: << parameters.redis-key >> redis-key: << parameters.redis-key >>
- when: - run:
condition: << parameters.ui-e2e-grep >> name: Run the ui-e2e tests
steps: command: |
- run: nvm use default;
name: Run the ui-e2e tests node ./e2e-commons/scripts/blocks.js &
command: | cd ui-e2e; yarn mocha -g "<< parameters.ui-e2e-grep >>" -b ./test.js
nvm use default;
cd ui-e2e; yarn mocha -g "<< parameters.ui-e2e-grep >>" -b ./test.js
- when:
condition: << parameters.oracle-e2e-script >>
steps:
- run:
name: Run the oracle-e2e tests
command: cd e2e-commons && docker-compose run e2e yarn workspace oracle-e2e run << parameters.oracle-e2e-script >>
workflows: workflows:
tokenbridge: tokenbridge:
jobs: jobs:
@@ -292,8 +240,6 @@ workflows:
- deployment-oracle - deployment-oracle
- deployment-ui - deployment-ui
- deployment-monitor - deployment-monitor
- deployment-repo
- deployment-multiple
- ultimate: - ultimate:
name: "ultimate: native to erc" name: "ultimate: native to erc"
scenario-name: native-to-erc scenario-name: native-to-erc
@@ -309,8 +255,3 @@ workflows:
scenario-name: erc-to-erc scenario-name: erc-to-erc
redis-key: erc-erc-collected-signatures:lastProcessedBlock redis-key: erc-erc-collected-signatures:lastProcessedBlock
ui-e2e-grep: "ERC TO ERC" ui-e2e-grep: "ERC TO ERC"
- ultimate:
name: "ultimate: amb"
scenario-name: amb
redis-key: amb-collected-signatures:lastProcessedBlock
oracle-e2e-script: "amb"

2
.gitmodules vendored
View File

@@ -1,3 +1,3 @@
[submodule "contracts"] [submodule "contracts"]
path = contracts path = contracts
url = https://github.com/poanetwork/tokenbridge-contracts.git url = https://github.com/poanetwork/poa-bridge-contracts.git

2
.nvmrc
View File

@@ -1 +1 @@
10.16 10.15

View File

@@ -1,72 +0,0 @@
# Configuration
## Common configuration
name | description | value
--- | --- | ---
COMMON_HOME_RPC_URL | The HTTPS URL(s) used to communicate to the RPC nodes in the Home network. Several URLs can be specified, delimited by spaces. If the connection to one of these nodes is lost the next URL is used for connection. | URL(s)
COMMON_FOREIGN_RPC_URL | The HTTPS URL(s) used to communicate to the RPC nodes in the Foreign network. Several URLs can be specified, delimited by spaces. If the connection to one of these nodes is lost the next URL is used for connection. | URL(s)
COMMON_HOME_BRIDGE_ADDRESS | The address of the bridge contract address in the Home network. It is used to listen to events from and send validators' transactions to the Home network. | hexidecimal beginning with "0x"
COMMON_FOREIGN_BRIDGE_ADDRESS | The address of the bridge contract address in the Foreign network. It is used to listen to events from and send validators' transactions to the Foreign network. | hexidecimal beginning with "0x"
COMMON_HOME_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Home network. The gas price provided by the oracle is used to send the validator's transactions to the RPC node. Since it is assumed that the Home network has a predefined gas price (e.g. the gas price in the Core of POA.Network is `1 GWei`), the gas price oracle parameter can be omitted for such networks. | URL
COMMON_HOME_GAS_PRICE_SPEED_TYPE | Assuming the gas price oracle responds with the following JSON structure: `{"fast": 20.0, "block_time": 12.834, "health": true, "standard": 6.0, "block_number": 6470469, "instant": 71.0, "slow": 1.889}`, this parameter specifies the desirable transaction speed. The speed type can be omitted when `COMMON_HOME_GAS_PRICE_SUPPLIER_URL` is not used. | `instant` / `fast` / `standard` / `slow`
COMMON_HOME_GAS_PRICE_FALLBACK | The gas price (in Wei) that is used if both the oracle and the fall back gas price specified in the Home Bridge contract are not available. | integer
COMMON_HOME_GAS_PRICE_FACTOR | A value that will multiply the gas price of the oracle to convert it to gwei. If the oracle API returns gas prices in gwei then this can be set to `1`. Also, it could be used to intentionally pay more gas than suggested by the oracle to guarantee the transaction verification. E.g. `1.25` or `1.5`. | integer
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | The URL used to get a JSON response from the gas price prediction oracle for the Foreign network. The provided gas price is used to send the validator's transactions to the RPC node. If the Foreign network is Ethereum Foundation mainnet, the oracle URL can be: https://gasprice.poa.network. Otherwise this parameter can be omitted. | URL
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | Assuming the gas price oracle responds with the following JSON structure: `{"fast": 20.0, "block_time": 12.834, "health": true, "standard": 6.0, "block_number": 6470469, "instant": 71.0, "slow": 1.889}`, this parameter specifies the desirable transaction speed. The speed type can be omitted when `COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL`is not used. | `instant` / `fast` / `standard` / `slow`
COMMON_FOREIGN_GAS_PRICE_FALLBACK | The gas price (in Wei) used if both the oracle and fall back gas price specified in the Foreign Bridge contract are not available. | integer
COMMON_FOREIGN_GAS_PRICE_FACTOR | A value that will multiply the gas price of the oracle to convert it to gwei. If the oracle API returns gas prices in gwei then this can be set to `1`. Also, it could be used to intentionally pay more gas than suggested by the oracle to guarantee the transaction verification. E.g. `1.25` or `1.5`. | integer
## Oracle configuration
name | description | value
--- | --- | ---
ORACLE_BRIDGE_MODE | The bridge mode. The bridge starts listening to a different set of events based on this parameter. | NATIVE_TO_ERC / ERC_TO_ERC / ERC_TO_NATIVE
ORACLE_ALLOW_HTTP_FOR_RPC | **Only use in test environments - must be omitted in production environments.**. If this parameter is specified and set to `yes`, RPC URLs can be specified in form of HTTP links. A warning that the connection is insecure will be written to the logs. | `yes` / `no`
ORACLE_HOME_RPC_POLLING_INTERVAL | The interval in milliseconds used to request the RPC node in the Home network for new blocks. The interval should match the average production time for a new block. | integer
ORACLE_FOREIGN_RPC_POLLING_INTERVAL | The interval in milliseconds used to request the RPC node in the Foreign network for new blocks. The interval should match the average production time for a new block. | integer
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL | An interval in milliseconds used to get the updated gas price value either from the oracle or from the Home Bridge contract. | integer
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL | The interval in milliseconds used to get the updated gas price value either from the oracle or from the Foreign Bridge contract. | integer
ORACLE_QUEUE_URL | RabbitMQ URL used by watchers and senders to communicate to the message queue. Typically set to: `amqp://127.0.0.1`. | local URL
ORACLE_REDIS_URL | Redis DB URL used by watchers and senders to communicate to the database. Typically set to: `redis://127.0.0.1:6379`. | local URL
ORACLE_HOME_START_BLOCK | The block number in the Home network used to start watching for events when the bridge instance is run for the first time. Usually this is the same block where the Home Bridge contract is deployed. If a new validator instance is being deployed for an existing set of validators, the block number could be the latest block in the chain. | integer
ORACLE_FOREIGN_START_BLOCK | The block number in the Foreign network used to start watching for events when the bridge instance runs for the first time. Usually this is the same block where the Foreign Bridge contract was deployed to. If a new validator instance is being deployed for an existing set of validators, the block number could be the latest block in the chain. | integer
ORACLE_LOG_LEVEL | Set the level of details in the logs. | `trace` / `debug` / `info` / `warn` / `error` / `fatal`
ORACLE_MAX_PROCESSING_TIME | The workers processes will be killed if this amount of time (in milliseconds) is elapsed before they finish processing. It is recommended to set this value to 4 times the value of the longest polling time (set with the `HOME_POLLING_INTERVAL` and `FOREIGN_POLLING_INTERVAL` variables). To disable this, set the time to 0. | integer
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY | The private key of the bridge validator used to sign confirmations before sending transactions to the bridge contracts. The validator account is calculated automatically from the private key. Every bridge instance (set of watchers and senders) must have its own unique private key. The specified private key is used to sign transactions on both sides of the bridge. | hexidecimal without "0x"
ORACLE_VALIDATOR_ADDRESS | The public address of the bridge validator | hexidecimal with "0x"
## UI configuration
name | description | value
--- | --- | ---
UI_TITLE | The title for the bridge UI page. `%c` will be replaced by the name of the network. | string
UI_DESCRIPTION | The meta description for the deployed bridge page. | string
UI_NATIVE_TOKEN_DISPLAY_NAME | name of the home native coin | string
UI_HOME_NETWORK_DISPLAY_NAME | name to be displayed for home network | string
UI_FOREIGN_NETWORK_DISPLAY_NAME | name to be displayed for foreign network | string
UI_HOME_WITHOUT_EVENTS | `true` if home network doesn't support events | true/false
UI_FOREIGN_WITHOUT_EVENTS | `true` if foreign network doesn't support events | true/false
UI_HOME_EXPLORER_TX_TEMPLATE | template link to transaction on home explorer. `%s` will be replaced by transaction hash | URL template
UI_FOREIGN_EXPLORER_TX_TEMPLATE | template link to transaction on foreign explorer. `%s` will be replaced by transaction hash | URL template
UI_HOME_EXPLORER_ADDRESS_TEMPLATE | template link to address on home explorer. `%s` will be replaced by address | URL template
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE | template link to address on foreign explorer. `%s` will be replaced by address | URL template
UI_HOME_GAS_PRICE_UPDATE_INTERVAL | An interval in milliseconds used to get the updated gas price value either from the oracle or from the Home Bridge contract. | integer
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL | An interval in milliseconds used to get the updated gas price value either from the oracle or from the Foreign Bridge contract. | integer
UI_PORT | The port for the UI app. | integer
UI_STYLES | The set of styles to render the bridge UI page. Currently only `classic` is implemented | classic
## Monitor configuration
name | description | value
--- | --- | ---
MONITOR_HOME_START_BLOCK | The app will monitor transactions starting from this block. | integer
MONITOR_FOREIGN_START_BLOCK | The app will monitor transactions starting from this block. | integer
MONITOR_VALIDATOR_HOME_TX_LIMIT | Average gas usage of a transaction sent by a validator, it is used to estimate the number of transaction that can be paid by the validator. | integer
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT | Average gas usage of a transaction sent by a validator, it is used to estimate the number of transaction that can be paid by the validator. | integer
MONITOR_TX_NUMBER_THRESHOLD | If estimated number of transaction is equal to or below this value, the monitor will report that the validator has less funds than it is required. | integer
MONITOR_PORT | The port for the Monitor. | integer
MONITOR_BRIDGE_NAME | The name to be used in the url path for the bridge | string

View File

@@ -3,7 +3,6 @@ FROM node:10
WORKDIR /mono WORKDIR /mono
COPY package.json . COPY package.json .
COPY oracle-e2e/package.json ./oracle-e2e/ COPY oracle-e2e/package.json ./oracle-e2e/
COPY monitor-e2e/package.json ./monitor-e2e/
COPY contracts/package.json ./contracts/ COPY contracts/package.json ./contracts/
COPY yarn.lock . COPY yarn.lock .

View File

@@ -26,11 +26,10 @@ Sub-repositories maintained within this monorepo are listed below.
| [Oracle-E2E](oracle-e2e/README.md) | End to end tests for the Oracle | | [Oracle-E2E](oracle-e2e/README.md) | End to end tests for the Oracle |
| [Monitor-E2E](monitor-e2e/README.md) | End to end tests for the Monitor | | [Monitor-E2E](monitor-e2e/README.md) | End to end tests for the Monitor |
| [UI-E2E](ui-e2e/README.md) | End to end tests for the UI | | [UI-E2E](ui-e2e/README.md) | End to end tests for the UI |
| [Deployment-E2E](deployment-e2e/README.md) | End to end tests for the Deployment |
| [Commons](commons/README.md) | Interfaces, constants and utilities shared between the sub-repositories | | [Commons](commons/README.md) | Interfaces, constants and utilities shared between the sub-repositories |
| [E2E-Commons](e2e-commons/README.md) | Common utilities and configuration used in end to end tests | | [E2E-Commons](e2e-commons/README.md) | Common utilities and configuration used in end to end tests |
Additionally there are [Smart Contracts](https://github.com/poanetwork/tokenbridge-contracts) used to manage bridge validators, collect signatures, and confirm asset relay and disposal. Additionally there are [Smart Contracts](https://github.com/poanetwork/poa-bridge-contracts) used to manage bridge validators, collect signatures, and confirm asset relay and disposal.
## Available deployments ## Available deployments
@@ -52,12 +51,11 @@ Additionally there are [Smart Contracts](https://github.com/poanetwork/tokenbrid
## Operational Modes ## Operational Modes
The POA TokenBridge provides four operational modes: The POA TokenBridge provides three operational modes:
- [x] `Native-to-ERC20` **Coins** on a Home network can be converted to ERC20-compatible **tokens** on a Foreign network. Coins are locked on the Home side and the corresponding amount of ERC20 tokens are minted on the Foreign side. When the operation is reversed, tokens are burnt on the Foreign side and unlocked in the Home network. **More Information: [POA-to-POA20 Bridge](https://medium.com/poa-network/introducing-poa-bridge-and-poa20-55d8b78058ac)** - [x] `Native-to-ERC20` **Coins** on a Home network can be converted to ERC20-compatible **tokens** on a Foreign network. Coins are locked on the Home side and the corresponding amount of ERC20 tokens are minted on the Foreign side. When the operation is reversed, tokens are burnt on the Foreign side and unlocked in the Home network. **More Information: [POA-to-POA20 Bridge](https://medium.com/poa-network/introducing-poa-bridge-and-poa20-55d8b78058ac)**
- [x] `ERC20-to-ERC20` ERC20-compatible tokens on the Foreign network are locked and minted as ERC20-compatible tokens (ERC677 tokens) on the Home network. When transferred from Home to Foreign, they are burnt on the Home side and unlocked in the Foreign network. This can be considered a form of atomic swap when a user swaps the token "X" in network "A" to the token "Y" in network "B". **More Information: [ERC20-to-ERC20](https://medium.com/poa-network/introducing-the-erc20-to-erc20-tokenbridge-ce266cc1a2d0)** - [x] `ERC20-to-ERC20` ERC20-compatible tokens on the Foreign network are locked and minted as ERC20-compatible tokens (ERC677 tokens) on the Home network. When transferred from Home to Foreign, they are burnt on the Home side and unlocked in the Foreign network. This can be considered a form of atomic swap when a user swaps the token "X" in network "A" to the token "Y" in network "B". **More Information: [ERC20-to-ERC20](https://medium.com/poa-network/introducing-the-erc20-to-erc20-tokenbridge-ce266cc1a2d0)**
- [x] `ERC20-to-Native`: Pre-existing **tokens** in the Foreign network are locked and **coins** are minted in the `Home` network. In this mode, the Home network consensus engine invokes [Parity's Block Reward contract](https://wiki.parity.io/Block-Reward-Contract.html) to mint coins per the bridge contract request. **More Information: [xDai Chain](https://medium.com/poa-network/poa-network-partners-with-makerdao-on-xdai-chain-the-first-ever-usd-stable-blockchain-65a078c41e6a)** - [x] `ERC20-to-Native`: Pre-existing **tokens** in the Foreign network are locked and **coins** are minted in the `Home` network. In this mode, the Home network consensus engine invokes [Parity's Block Reward contract](https://wiki.parity.io/Block-Reward-Contract.html) to mint coins per the bridge contract request. **More Information: [xDai Chain](https://medium.com/poa-network/poa-network-partners-with-makerdao-on-xdai-chain-the-first-ever-usd-stable-blockchain-65a078c41e6a)**
- [x] `Arbitrary-Message`: Transfer arbitrary data between two networks as so the data could be interpreted as an arbitrary contract method invocation.
## Initializing the monorepository ## Initializing the monorepository
@@ -66,13 +64,11 @@ Clone the repository:
git clone https://github.com/poanetwork/tokenbridge git clone https://github.com/poanetwork/tokenbridge
``` ```
If there is no need to build docker images for the TokenBridge components (oracle, monitor, UI), initialize submodules, install dependencies, compile the Smart Contracts: Initialize submodules, install dependencies, compile the Smart Contracts:
``` ```
yarn initialize yarn initialize
``` ```
Then refer to the corresponding README files to get information about particular TokenBridge component.
## Linting ## Linting
Running linter for all JS projects: Running linter for all JS projects:
@@ -89,14 +85,13 @@ Running tests for all projects:
yarn test yarn test
``` ```
Additionally there are end-to-end tests for [Oracle](oracle-e2e/README.md) and [UI](ui-e2e/README.md). Additionaly there are end-to-end tests for [Oracle](oracle-e2e/README.md) and [UI](ui-e2e/README.md).
For details on building, running and developing please refer to respective READMEs in sub-repositories. For details on building, running and developing please refer to respective READMEs in sub-repositories.
## Building, running and deploying ## Building, running and deploying
Please refer to the instructions in sub-directories. Please refer to the instructions in sub-directories.
Configuration details are available [here](./CONFIGURATION.md).
## Contributing ## Contributing
@@ -108,4 +103,5 @@ This project is licensed under the GNU Lesser General Public License v3.0. See t
## References ## References
* [TokenBridge Documentation](http://www.tokenbridge.net/) * [Additional Documentation](https://forum.poa.network/c/tokenbridge)
* [POA20 Bridge FAQ](https://forum.poa.network/c/tokenbridge/poa20-bridge)

View File

@@ -13,7 +13,6 @@ const REWARDABLE_VALIDATORS_ABI = require('../contracts/build/contracts/Rewardab
const HOME_AMB_ABI = require('../contracts/build/contracts/HomeAMB').abi const HOME_AMB_ABI = require('../contracts/build/contracts/HomeAMB').abi
const FOREIGN_AMB_ABI = require('../contracts/build/contracts/ForeignAMB').abi const FOREIGN_AMB_ABI = require('../contracts/build/contracts/ForeignAMB').abi
const BOX_ABI = require('../contracts/build/contracts/Box').abi const BOX_ABI = require('../contracts/build/contracts/Box').abi
const SAI_TOP = require('../contracts/build/contracts/SaiTopMock').abi
const { HOME_V1_ABI, FOREIGN_V1_ABI } = require('./v1Abis') const { HOME_V1_ABI, FOREIGN_V1_ABI } = require('./v1Abis')
const { BRIDGE_MODES } = require('./constants') const { BRIDGE_MODES } = require('./constants')
@@ -93,6 +92,5 @@ module.exports = {
ERC20_BYTES32_ABI, ERC20_BYTES32_ABI,
HOME_AMB_ABI, HOME_AMB_ABI,
FOREIGN_AMB_ABI, FOREIGN_AMB_ABI,
BOX_ABI, BOX_ABI
SAI_TOP
} }

View File

@@ -17,11 +17,23 @@ const FEE_MANAGER_MODE = {
UNDEFINED: 'UNDEFINED' UNDEFINED: 'UNDEFINED'
} }
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000' const GAS_PRICE_OPTIONS = {
UNDEFINED: '00',
GAS_PRICE: '01',
SPEED: '02'
}
const ORACLE_GAS_PRICE_SPEEDS = {
SLOW: 'slow',
STANDARD: 'standard',
FAST: 'fast',
INSTANT: 'instant'
}
module.exports = { module.exports = {
BRIDGE_MODES, BRIDGE_MODES,
ERC_TYPES, ERC_TYPES,
FEE_MANAGER_MODE, FEE_MANAGER_MODE,
ZERO_ADDRESS GAS_PRICE_OPTIONS,
ORACLE_GAS_PRICE_SPEEDS
} }

View File

@@ -1,3 +1,13 @@
const web3Utils = require('web3-utils')
const { GAS_PRICE_OPTIONS, ORACLE_GAS_PRICE_SPEEDS } = require('./constants')
const gasPriceSpeedMapper = {
'01': ORACLE_GAS_PRICE_SPEEDS.INSTANT,
'02': ORACLE_GAS_PRICE_SPEEDS.FAST,
'03': ORACLE_GAS_PRICE_SPEEDS.STANDARD,
'04': ORACLE_GAS_PRICE_SPEEDS.SLOW
}
function strip0x(input) { function strip0x(input) {
return input.replace(/^0x/, '') return input.replace(/^0x/, '')
} }
@@ -12,11 +22,37 @@ function parseAMBMessage(message) {
const txHash = `0x${message.slice(0, 64)}` const txHash = `0x${message.slice(0, 64)}`
const sender = `0x${message.slice(64, 104)}` const sender = `0x${message.slice(64, 104)}`
const executor = `0x${message.slice(104, 144)}` const executor = `0x${message.slice(104, 144)}`
const gasLimit = web3Utils.toBN(message.slice(144, 208))
const dataType = message.slice(208, 210)
let gasPrice = null
let gasPriceSpeed = null
let dataStart = 210
switch (dataType) {
case GAS_PRICE_OPTIONS.GAS_PRICE:
gasPrice = web3Utils.toBN(message.slice(210, 274))
dataStart += 64
break
case GAS_PRICE_OPTIONS.SPEED:
gasPriceSpeed = gasPriceSpeedMapper[message.slice(210, 212)]
dataStart += 2
break
case GAS_PRICE_OPTIONS.UNDEFINED:
default:
break
}
const data = `0x${message.slice(dataStart, message.length)}`
return { return {
sender, sender,
executor, executor,
txHash txHash,
gasLimit,
dataType,
gasPrice,
gasPriceSpeed,
data
} }
} }

View File

@@ -1,6 +1,7 @@
const { BN } = require('web3-utils') const { BN, toBN } = require('web3-utils')
const { expect } = require('chai').use(require('bn-chai')(BN)) const { expect } = require('chai').use(require('bn-chai')(BN))
const { parseAMBMessage, strip0x, addTxHashToData } = require('../message') const { parseAMBMessage, strip0x, addTxHashToData } = require('../message')
const { ORACLE_GAS_PRICE_SPEEDS } = require('../constants')
describe('strip0x', () => { describe('strip0x', () => {
it('should remove 0x from input', () => { it('should remove 0x from input', () => {
@@ -59,11 +60,66 @@ describe('parseAMBMessage', () => {
)}${msgGasLimit}${msgDataType}${strip0x(msgData)}` )}${msgGasLimit}${msgDataType}${strip0x(msgData)}`
// when // when
const { sender, executor, txHash } = parseAMBMessage(message) const { sender, executor, txHash, gasLimit, dataType, gasPrice, gasPriceSpeed, data } = parseAMBMessage(message)
// then // then
expect(sender).to.be.equal(msgSender) expect(sender).to.be.equal(msgSender)
expect(executor).to.be.equal(msgExecutor) expect(executor).to.be.equal(msgExecutor)
expect(txHash).to.be.equal(msgTxHash) expect(txHash).to.be.equal(msgTxHash)
expect(gasLimit).to.eq.BN(toBN(msgGasLimit))
expect(dataType).to.be.equal(msgDataType)
expect(gasPrice).to.be.equal(null)
expect(gasPriceSpeed).to.be.equal(null)
expect(data).to.be.equal(msgData)
})
it('should parse data type 01', () => {
const msgSender = '0x003667154bb32e42bb9e1e6532f19d187fa0082e'
const msgExecutor = '0xf4bef13f9f4f2b203faf0c3cbbaabe1afe056955'
const msgTxHash = '0xbdceda9d8c94838aca10c687da1411a07b1390e88239c0638cb9cc264219cc10'
const msgGasLimit = '000000000000000000000000000000000000000000000000000000005b877705'
const msgDataType = '01'
const msgGasPrice = '0000000000000000000000000000000000000000000000000000000165a0bc00'
const msgData = '0xb1591967aed668a4b27645ff40c444892d91bf5951b382995d4d4f6ee3a2ce03'
const message = `0x${strip0x(msgTxHash)}${strip0x(msgSender)}${strip0x(
msgExecutor
)}${msgGasLimit}${msgDataType}${msgGasPrice}${strip0x(msgData)}`
// when
const { sender, executor, txHash, gasLimit, dataType, gasPrice, gasPriceSpeed, data } = parseAMBMessage(message)
// then
expect(sender).to.be.equal(msgSender)
expect(executor).to.be.equal(msgExecutor)
expect(txHash).to.be.equal(msgTxHash)
expect(gasLimit).to.eq.BN(toBN(msgGasLimit))
expect(dataType).to.be.equal(msgDataType)
expect(gasPrice).to.eq.BN(toBN(msgGasPrice))
expect(gasPriceSpeed).to.be.equal(null)
expect(data).to.be.equal(msgData)
})
it('should parse data type 02', () => {
const msgSender = '0x003667154bb32e42bb9e1e6532f19d187fa0082e'
const msgExecutor = '0xf4bef13f9f4f2b203faf0c3cbbaabe1afe056955'
const msgTxHash = '0xbdceda9d8c94838aca10c687da1411a07b1390e88239c0638cb9cc264219cc10'
const msgGasLimit = '000000000000000000000000000000000000000000000000000000005b877705'
const msgDataType = '02'
const msgGasPriceSpeed = '0x03'
const msgData = '0xb1591967aed668a4b27645ff40c444892d91bf5951b382995d4d4f6ee3a2ce03'
const message = `0x${strip0x(msgTxHash)}${strip0x(msgSender)}${strip0x(
msgExecutor
)}${msgGasLimit}${msgDataType}${strip0x(msgGasPriceSpeed)}${strip0x(msgData)}`
// when
const { sender, executor, txHash, gasLimit, dataType, gasPrice, gasPriceSpeed, data } = parseAMBMessage(message)
// then
expect(sender).to.be.equal(msgSender)
expect(executor).to.be.equal(msgExecutor)
expect(txHash).to.be.equal(msgTxHash)
expect(gasLimit).to.eq.BN(toBN(msgGasLimit))
expect(dataType).to.be.equal(msgDataType)
expect(gasPrice).to.be.equal(null)
expect(gasPriceSpeed).to.be.equal(ORACLE_GAS_PRICE_SPEEDS.STANDARD)
expect(data).to.be.equal(msgData)
}) })
}) })

View File

@@ -205,7 +205,7 @@ const normalizeGasPrice = (oracleGasPrice, factor, limits = null) => {
// fetchFn has to be supplied (instead of just url to oracle), // fetchFn has to be supplied (instead of just url to oracle),
// because this utility function is shared between Browser and Node, // because this utility function is shared between Browser and Node,
// we use built-in 'fetch' on browser side, and `node-fetch` package in Node. // we use built-in 'fetch' on browser side, and `node-fetch` package in Node.
const gasPriceFromSupplier = async (fetchFn, options = {}) => { const gasPriceFromOracle = async (fetchFn, options = {}) => {
try { try {
const response = await fetchFn() const response = await fetchFn()
const json = await response.json() const json = await response.json()
@@ -224,7 +224,7 @@ const gasPriceFromSupplier = async (fetchFn, options = {}) => {
options.logger.debug && options.logger.debug &&
options.logger.debug({ oracleGasPrice, normalizedGasPrice }, 'Gas price updated using the API') options.logger.debug({ oracleGasPrice, normalizedGasPrice }, 'Gas price updated using the API')
return normalizedGasPrice return options.returnAllSpeeds ? { gasPrice: normalizedGasPrice, oracleGasPriceSpeeds: json } : normalizedGasPrice
} catch (e) { } catch (e) {
options.logger && options.logger.error && options.logger.error(`Gas Price API is not available. ${e.message}`) options.logger && options.logger.error && options.logger.error(`Gas Price API is not available. ${e.message}`)
} }
@@ -258,7 +258,7 @@ module.exports = {
getPastEvents, getPastEvents,
getDeployedAtBlock, getDeployedAtBlock,
normalizeGasPrice, normalizeGasPrice,
gasPriceFromSupplier, gasPriceFromOracle,
gasPriceFromContract, gasPriceFromContract,
gasPriceWithinLimits gasPriceWithinLimits
} }

View File

@@ -1,9 +0,0 @@
#!/usr/bin/env bash
cd $(dirname $0)
set -e # exit when any command fails
while [ "$1" != "" ]; do
docker-compose build && docker-compose run molecule_runner /bin/bash -c "molecule test --scenario-name $1"
shift # Shift all the parameters down by one
done

View File

@@ -1,3 +0,0 @@
---
- import_playbook: ../../../deployment/site.yml
- import_playbook: ./run-checks.yml

View File

@@ -1,7 +0,0 @@
---
- 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'

View File

@@ -1,59 +0,0 @@
---
dependency:
name: galaxy
driver:
name: docker
lint:
name: yamllint
enabled: True
options:
config-data:
ignore: ../../hosts.yml
platforms:
- name: multiple-host
groups:
- example
children:
- oracle
- monitor
- ui
image: ubuntu:16.04
privileged: true
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
provisioner:
name: ansible
lint:
name: ansible-lint
enabled: True
options:
r: ["bug"]
playbooks:
prepare: ../prepare.yml
converge: ../monitor/converge.yml
inventory:
host_vars:
multiple-host:
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
MONITOR_PORT: 3003
syslog_server_port: "udp://127.0.0.1:514"
verifier:
name: testinfra
lint:
name: flake8
additional_files_or_dirs:
- ../../tests/*
scenario:
name: multiple
test_sequence:
- lint
- cleanup
- destroy
- dependency
- syntax
- create
- prepare
- converge
- verify
- destroy

View File

@@ -1,32 +0,0 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("service", [
("poabridge"),
("tokenbridge-ui"),
("tokenbridge-monitor")
])
def test_services(host, service):
assert host.service(service).is_enabled
assert host.service(service).is_running
@pytest.mark.parametrize("name", [
("oracle_rabbit_1"),
("oracle_redis_1"),
("oracle_bridge_request_1"),
("oracle_bridge_collected_1"),
("oracle_bridge_affirmation_1"),
("oracle_bridge_senderhome_1"),
("oracle_bridge_senderforeign_1"),
("ui_ui_1"),
("monitor_monitor_1")
])
def test_docker_containers(host, name):
container = host.docker(name)
assert container.is_running

View File

@@ -1,12 +0,0 @@
---
- name: Install Repository
hosts: all
become: true
tasks:
- import_role:
name: ../../../deployment/roles/common
tasks_from: repo
# Test that running the task again works
- import_role:
name: ../../../deployment/roles/common
tasks_from: repo

View File

@@ -1,30 +0,0 @@
---
driver:
name: docker
platforms:
- name: repo-host
image: ubuntu:16.04
privileged: true
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
provisioner:
name: ansible
playbooks:
prepare: ../prepare.yml
converge: ./converge.yml
inventory:
host_vars:
repo-host:
bridge_repo_branch: master
verifier:
name: testinfra
scenario:
name: repo
test_sequence:
- destroy
- create
- prepare
- converge
- verify
- destroy

View File

@@ -1,49 +0,0 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("path", [
("/home/poadocker"),
("/home/poadocker/bridge"),
("/home/poadocker/bridge/commons"),
("/home/poadocker/bridge/e2e-commons"),
("/home/poadocker/bridge/deployment"),
("/home/poadocker/bridge/contracts"),
("/home/poadocker/bridge/oracle"),
("/home/poadocker/bridge/monitor"),
("/home/poadocker/bridge/ui"),
("/home/poadocker/bridge/parity")
])
def test_existing_folders(host, path):
assert host.file(path).exists
assert host.file(path).is_directory
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/package.json"),
("/home/poadocker/bridge/commons/package.json"),
("/home/poadocker/bridge/contracts/package.json"),
("/home/poadocker/bridge/oracle/package.json"),
("/home/poadocker/bridge/monitor/package.json"),
("/home/poadocker/bridge/ui/package.json")
])
def test_existing_package_json(host, path):
assert host.file(path).exists
assert host.file(path).is_file
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/Dockerfile.e2e"),
("/home/poadocker/bridge/contracts/Dockerfile"),
("/home/poadocker/bridge/parity/Dockerfile"),
("/home/poadocker/bridge/oracle/Dockerfile"),
("/home/poadocker/bridge/monitor/Dockerfile"),
("/home/poadocker/bridge/ui/Dockerfile")
])
def test_existing_docker_files(host, path):
assert host.file(path).exists
assert host.file(path).is_file

View File

@@ -1,23 +0,0 @@
import os
import pytest
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/node_modules"),
("/home/poadocker/bridge/ui/node_modules"),
("/home/poadocker/bridge/oracle/node_modules"),
("/home/poadocker/bridge/monitor/node_modules"),
("/home/poadocker/bridge/contracts/node_modules"),
])
def test_non_existing_node_modules(host, path):
assert not host.file(path).exists
@pytest.mark.parametrize("path", [
("/home/poadocker/bridge/.git")
])
def test_non_existing_git(host, path):
assert not host.file(path).exists

View File

@@ -1,40 +0,0 @@
---
driver:
name: docker
platforms:
- name: oracle-amb-host
groups:
- ultimate
- amb
children:
- oracle
image: ubuntu:16.04
privileged: true
network_mode: host
volumes:
- /var/run/docker.sock:/var/run/docker.sock
provisioner:
name: ansible
playbooks:
prepare: ../prepare.yml
converge: ../ultimate-commons/converge.yml
inventory:
host_vars:
oracle-amb-host:
COMMON_HOME_RPC_URL: "http://parity1:8545"
COMMON_FOREIGN_RPC_URL: "http://parity2:8545"
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
verifier:
name: testinfra
lint:
name: flake8
scenario:
name: ultimate-amb
test_sequence:
- cleanup
- destroy
- syntax
- create
- prepare
- converge

View File

@@ -1,26 +0,0 @@
---
- name: Slurp docker compose file
slurp:
src: "/home/poadocker/bridge/oracle/{{ file }}.yml"
register: docker_compose_slurp
- name: Parse docker compose file
set_fact:
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
- name: Add the external network used to connect to Parity nodes
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
- name: Add all Oracle containers to the network
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {item: {'networks': docker_compose_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
with_items: "{{ docker_compose_parsed.services }}"
- name: Expose Redis port to allow connecting from redis-cli
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
- name: Write updated docker file
copy:
content: "{{ docker_compose_parsed | to_yaml }}"
dest: "/home/poadocker/bridge/oracle/{{ file }}.yml"

View File

@@ -1,35 +0,0 @@
---
- name: Overwrite Oracle the docker-compose
hosts: oracle
become: true
tasks:
- name: stop the service
shell: service poabridge stop
- name: Build current oracle image
shell: docker build -t oracle:ultimate-testing --file oracle/Dockerfile .
delegate_to: 127.0.0.1
become: false
args:
chdir: "{{ lookup('env', 'PWD') }}/.."
- name: Replace oracle image
replace:
path: "/home/poadocker/bridge/oracle/{{ item }}.yml"
regexp: 'poanetwork/tokenbridge-oracle:latest'
replace: "oracle:ultimate-testing"
with_items:
- docker-compose
- docker-compose-transfer
- docker-compose-erc-native
- include_tasks: oracle-add-docker-external-network.yml
with_items:
- docker-compose
- docker-compose-transfer
- docker-compose-erc-native
loop_control:
loop_var: file
- name: start the service
shell: service poabridge start

View File

@@ -1,14 +0,0 @@
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

View File

@@ -1,14 +0,0 @@
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

View File

@@ -1,14 +0,0 @@
# Molecule managed
{% if item.registry is defined %}
FROM {{ item.registry.url }}/{{ item.image }}
{% else %}
FROM {{ item.image }}
{% endif %}
RUN if [ $(command -v apt-get) ]; then apt-get update && apt-get install -y python sudo bash ca-certificates && apt-get clean; \
elif [ $(command -v dnf) ]; then dnf makecache && dnf --assumeyes install python sudo python-devel python*-dnf bash && dnf clean all; \
elif [ $(command -v yum) ]; then yum makecache fast && yum install -y python sudo yum-plugin-ovl bash && sed -i 's/plugins=0/plugins=1/g' /etc/yum.conf && yum clean all; \
elif [ $(command -v zypper) ]; then zypper refresh && zypper install -y python sudo bash python-xml && zypper clean -a; \
elif [ $(command -v apk) ]; then apk update && apk add --no-cache python sudo bash ca-certificates; \
elif [ $(command -v xbps-install) ]; then xbps-install -Syu && xbps-install -y python sudo bash ca-certificates && xbps-remove -O; fi

View File

@@ -1,6 +1,6 @@
# POA TokenBridge / Deployment Configuration # POA TokenBridge / Deployment Configuration
Please see the [Configuration](../CONFIGURATION.md) for additional configuration and execution details. Please see the [Oracle](../oracle/README.md) for additional configuration and execution details.
## Prerequisites ## Prerequisites
@@ -30,7 +30,7 @@ cp hosts.yml.example hosts.yml
hosts: hosts:
<host_ip_A>: <host_ip_A>:
ansible_user: <user> ansible_user: <user>
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "<private_key>" VALIDATOR_ADDRESS_PRIVATE_KEY: "<private_key>"
#syslog_server_port: "<protocol>://<ip>:<port>" # When this parameter is set all bridge logs will be redirected to <ip>:<port> address. #syslog_server_port: "<protocol>://<ip>:<port>" # When this parameter is set all bridge logs will be redirected to <ip>:<port> address.
<host_ip_B>: <host_ip_B>:
# (...) # (...)
@@ -69,7 +69,7 @@ Example config for installing only UI:
| `<bridge_name>` | The bridge name which tells Ansible which file to use. This is located in `group_vars/<bridge_name>.yml`. | | `<bridge_name>` | The bridge name which tells Ansible which file to use. This is located in `group_vars/<bridge_name>.yml`. |
| `<host_ip>` | Remote server IP address. | | `<host_ip>` | Remote server IP address. |
| ansible_user: `<user>` | User that will ssh into the node. This is typically `ubuntu` or `root`. | | ansible_user: `<user>` | User that will ssh into the node. This is typically `ubuntu` or `root`. |
| ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: `"<private_key>"` | The private key for the specified validator address. | | VALIDATOR_ADDRESS_PRIVATE_KEY: `"<private_key>"` | The private key for the specified validator address. |
| syslog_server_port: `"<protocol>://<ip>:<port>"` | Optional port specification for bridge logs. This value will be provided by an administrator if required. | | syslog_server_port: `"<protocol>://<ip>:<port>"` | Optional port specification for bridge logs. This value will be provided by an administrator if required. |
`hosts.yml` can contain multiple bridge configurations at once. `hosts.yml` can contain multiple bridge configurations at once.
@@ -79,10 +79,6 @@ Example config for installing only UI:
`cd group_vars` `cd group_vars`
2. Note the <bridge_name> and add it to the hosts.yml configuration. For example, if a bridge file is named sokol-kovan.yml, you would change the <bridge_name> value in hosts.yml to sokol-kovan. 2. Note the <bridge_name> and add it to the hosts.yml configuration. For example, if a bridge file is named sokol-kovan.yml, you would change the <bridge_name> value in hosts.yml to sokol-kovan.
## Examples
[Deploy a monitor for multiple bridges](./MONITOR.md)
## Administrator Configurations ## Administrator Configurations
1. The `group_vars/<bridge_name>.yml` file contains the public bridge parameters. This file is prepared by administrators for each bridge. The validator only needs to add the required bridge name in the hosts.yml file to tell Ansible which file to use. 1. The `group_vars/<bridge_name>.yml` file contains the public bridge parameters. This file is prepared by administrators for each bridge. The validator only needs to add the required bridge name in the hosts.yml file to tell Ansible which file to use.
@@ -93,6 +89,10 @@ Example config for installing only UI:
2.1 `compose_service_user` - specifies the user created by the playbooks. This user runs the TokenBridge Oracle. 2.1 `compose_service_user` - specifies the user created by the playbooks. This user runs the TokenBridge Oracle.
2.2 `bridge_repo` contains the address of the TokenBridge Oracle repository. The default value is https://github.com/poanetwork/tokenbridge.
2.3 `bridge_repo_branch` points to the specific branch or commit to use with the `bridge_repo`. If `bridge_repo_branch` is not specified, the default (`master`) branch is used.
2.4 `bridge_path` sets the path where the TokenBridge Oracle is installed. By default, it points. to the home folder of `compose_service_user` 2.4 `bridge_path` sets the path where the TokenBridge Oracle is installed. By default, it points. to the home folder of `compose_service_user`
2.5 `docker_compose_version` - specifies a version of docker-compose to be installed. 2.5 `docker_compose_version` - specifies a version of docker-compose to be installed.

View File

@@ -1,104 +0,0 @@
## 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/`.

View File

@@ -16,7 +16,7 @@ Please refer to [Execution](./EXECUTION.md).
## Testing ## Testing
Please refer to [Deployment-E2E](../deployment-e2e/README.md). Please refer to [Testing](./molecule/TESTING.md).
## Contributing ## Contributing

View File

@@ -1,5 +0,0 @@
---
ORACLE_BRIDGE_MODE: "ARBITRARY_MESSAGE"
COMMON_HOME_BRIDGE_ADDRESS: "0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0"
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0"
MONITOR_PORT: 3013

View File

@@ -1,34 +1,35 @@
--- ---
## General settings ## General settings
ORACLE_BRIDGE_MODE: "ERC_TO_NATIVE" BRIDGE_MODE: "ERC_TO_NATIVE"
UI_NATIVE_TOKEN_DISPLAY_NAME: "xDai" HOME_NATIVE_NAME: "xDai"
## Home contract ## Home contract
COMMON_HOME_RPC_URL: "https://dai.poa.network" HOME_RPC_URL: "https://dai.poa.network"
UI_HOME_NETWORK_DISPLAY_NAME: "xDai chain" HOME_NAME: "xDai chain"
UI_HOME_WITHOUT_EVENTS: false HOME_WITHOUT_EVENTS: false
COMMON_HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6" HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6"
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000 HOME_POLLING_INTERVAL: 5000
## Foreign contract ## Foreign contract
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io" FOREIGN_RPC_URL: "https://mainnet.infura.io"
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Ethereum Mainnet" FOREIGN_NAME: "Ethereum Mainnet"
UI_FOREIGN_WITHOUT_EVENTS: false FOREIGN_WITHOUT_EVENTS: false
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016" FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016"
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 5000 ERC20_TOKEN_ADDRESS: "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359"
FOREIGN_POLLING_INTERVAL: 5000
## Home Gasprice ## Home Gasprice
# COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://localhost:8888/" # HOME_GAS_PRICE_ORACLE_URL: "https://localhost:8888/"
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard" HOME_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_HOME_GAS_PRICE_FALLBACK: 0 HOME_GAS_PRICE_FALLBACK: 0
COMMON_HOME_GAS_PRICE_FACTOR: 600000 HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
## Foreign Gasprice ## Foreign Gasprice
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 10000000000 FOREIGN_GAS_PRICE_FALLBACK: 10000000000
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 FOREIGN_GAS_PRICE_FACTOR: 1
## UI ## UI
UI_TITLE: "TokenBridge UI app - %c" UI_TITLE: "TokenBridge UI app - %c"
@@ -38,14 +39,15 @@ UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/poa/dai/tx/%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/mainnet/tx/%s UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/mainnet/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/dai/address/%s UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/dai/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_HOME_GAS_PRICE_FALLBACK: 1000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
## Monitor ## Monitor
MONITOR_BRIDGE_NAME: "xdai"
MONITOR_PORT: 3003 MONITOR_PORT: 3003
MONITOR_HOME_START_BLOCK: 759 MONITOR_HOME_DEPLOYMENT_BLOCK: 759
MONITOR_FOREIGN_START_BLOCK: 6478417 MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 6478417
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000 MONITOR_HOME_GAS_LIMIT: 300000
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 MONITOR_FOREIGN_GAS_LIMIT: 300000
MONITOR_TX_NUMBER_THRESHOLD: 100 MONITOR_HOME_GAS_PRICE_FALLBACK: 0
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
MONITOR_LEFT_TX_THRESHOLD: 100

View File

@@ -1,6 +1,7 @@
--- ---
ORACLE_BRIDGE_MODE: "ERC_TO_ERC" BRIDGE_MODE: "ERC_TO_ERC"
COMMON_HOME_BRIDGE_ADDRESS: "0x1feB40aD9420b186F019A717c37f5546165d411E" HOME_BRIDGE_ADDRESS: "0x1feB40aD9420b186F019A717c37f5546165d411E"
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127" FOREIGN_BRIDGE_ADDRESS: "0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127"
ERC20_TOKEN_ADDRESS: "0x3C665A31199694Bf723fD08844AD290207B5797f"
UI_PORT: 3001 UI_PORT: 3001
MONITOR_PORT: 3011 MONITOR_PORT: 3011

View File

@@ -1,6 +1,7 @@
--- ---
ORACLE_BRIDGE_MODE: "ERC_TO_NATIVE" BRIDGE_MODE: "ERC_TO_NATIVE"
COMMON_HOME_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda" HOME_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda" FOREIGN_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
ERC20_TOKEN_ADDRESS: "0x3C665A31199694Bf723fD08844AD290207B5797f"
UI_PORT: 3002 UI_PORT: 3002
MONITOR_PORT: 3012 MONITOR_PORT: 3012

View File

@@ -1,36 +1,36 @@
--- ---
## General settings ## General settings
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC" BRIDGE_MODE: "NATIVE_TO_ERC"
ORACLE_LOG_LEVEL: debug HOME_NATIVE_NAME: "POA"
UI_NATIVE_TOKEN_DISPLAY_NAME: "POA"
## Home contract ## Home contract
COMMON_HOME_RPC_URL: "https://sokol.poa.network" HOME_RPC_URL: "https://sokol.poa.network"
UI_HOME_NETWORK_DISPLAY_NAME: "POA Sokol" HOME_NAME: "POA Sokol"
UI_HOME_WITHOUT_EVENTS: false HOME_WITHOUT_EVENTS: false
COMMON_HOME_BRIDGE_ADDRESS: "0x98aFdE294f1C46aA0a27Cc4049ED337F879d8976" HOME_BRIDGE_ADDRESS: "0x98aFdE294f1C46aA0a27Cc4049ED337F879d8976"
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000 HOME_POLLING_INTERVAL: 5000
## Foreign contract ## Foreign contract
COMMON_FOREIGN_RPC_URL: "https://sokol.poa.network" FOREIGN_RPC_URL: "https://sokol.poa.network"
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Kovan" FOREIGN_NAME: "Kovan"
UI_FOREIGN_WITHOUT_EVENTS: false FOREIGN_WITHOUT_EVENTS: false
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x5a584f4C30B36f282848dAc9a2b20E7BEF481981" FOREIGN_BRIDGE_ADDRESS: "0x5a584f4C30B36f282848dAc9a2b20E7BEF481981"
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 1000 ERC20_TOKEN_ADDRESS: "0x6ef22442D600E1865AD8A8c254d6befCe7f4e6e4"
FOREIGN_POLLING_INTERVAL: 1000
## Home Gasprice ## Home Gasprice
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" HOME_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard" HOME_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
COMMON_HOME_GAS_PRICE_FACTOR: 1 HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 HOME_GAS_PRICE_FACTOR: 1
## Foreign Gasprice ## Foreign Gasprice
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 FOREIGN_GAS_PRICE_FACTOR: 1
## UI ## UI
UI_TITLE: "TokenBridge UI app - %c" UI_TITLE: "TokenBridge UI app - %c"
@@ -40,14 +40,15 @@ UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/poa/sokol/tx/%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/kovan/tx/%s UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/kovan/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/sokol/address/%s UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/sokol/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/kovan/address/%s UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/kovan/address/%s
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_HOME_GAS_PRICE_FALLBACK: 1000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
## Monitor ## Monitor
MONITOR_BRIDGE_NAME: "bridge"
MONITOR_PORT: 3003 MONITOR_PORT: 3003
MONITOR_HOME_START_BLOCK: 0 MONITOR_HOME_DEPLOYMENT_BLOCK: 0
MONITOR_FOREIGN_START_BLOCK: 0 MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 0
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000 MONITOR_HOME_GAS_LIMIT: 300000
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 MONITOR_FOREIGN_GAS_LIMIT: 300000
MONITOR_TX_NUMBER_THRESHOLD: 100 MONITOR_HOME_GAS_PRICE_FALLBACK: 1000000000
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
MONITOR_LEFT_TX_THRESHOLD: 100

View File

@@ -1,6 +1,7 @@
--- ---
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC" BRIDGE_MODE: "NATIVE_TO_ERC"
COMMON_HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624" HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769" FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
UI_PORT: 3000 UI_PORT: 3000
MONITOR_PORT: 3010 MONITOR_PORT: 3010

View File

@@ -1,50 +1,56 @@
--- ---
## General settings ## General settings
UI_NATIVE_TOKEN_DISPLAY_NAME: "POA" # BRIDGE_MODE: ""
ORACLE_ALLOW_HTTP_FOR_RPC: yes HOME_NATIVE_NAME: "POA"
ORACLE_LOG_LEVEL: debug ALLOW_HTTP: yes
LOG_LEVEL: debug
## Home contract ## Home contract
COMMON_HOME_RPC_URL: "https://sokol.poa.network" HOME_RPC_URL: "https://sokol.poa.network"
UI_HOME_NETWORK_DISPLAY_NAME: "POA Sokol" HOME_NAME: "POA Sokol"
UI_HOME_WITHOUT_EVENTS: false HOME_WITHOUT_EVENTS: false
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000 # HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
HOME_POLLING_INTERVAL: 5000
## Foreign contract ## Foreign contract
COMMON_FOREIGN_RPC_URL: "https://sokol.poa.network" FOREIGN_RPC_URL: "https://sokol.poa.network"
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Kovan" FOREIGN_NAME: "Kovan"
UI_FOREIGN_WITHOUT_EVENTS: false FOREIGN_WITHOUT_EVENTS: false
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 1000 # FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
# ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
FOREIGN_POLLING_INTERVAL: 1000
## Home Gasprice ## Home Gasprice
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" HOME_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard" HOME_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
COMMON_HOME_GAS_PRICE_FACTOR: 1 HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 HOME_GAS_PRICE_FACTOR: 1
## Foreign Gasprice ## Foreign Gasprice
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 FOREIGN_GAS_PRICE_FACTOR: 1
## UI
#ui
UI_TITLE: "TokenBridge UI app - %c" UI_TITLE: "TokenBridge UI app - %c"
UI_DESCRIPTION: "The POA cross-chain bridge serves as a method of transferring POA native tokens from the POA Network to the Ethereum network in a quick and cost-efficient manner." UI_DESCRIPTION: "The POA cross-chain bridge serves as a method of transferring POA native tokens from the POA Network to the Ethereum network in a quick and cost-efficient manner."
# UI_PORT: 3000
UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/poa/sokol/tx/%s UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/poa/sokol/tx/%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/kovan/tx/%s UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/kovan/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/sokol/address/%s UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/sokol/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/kovan/address/%s UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/kovan/address/%s
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_HOME_GAS_PRICE_FALLBACK: 1000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
#monitor ## Monitor
MONITOR_BRIDGE_NAME: "bridge" # MONITOR_PORT: 3003
MONITOR_HOME_START_BLOCK: 0 MONITOR_HOME_DEPLOYMENT_BLOCK: 0
MONITOR_FOREIGN_START_BLOCK: 0 MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 0
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000 MONITOR_HOME_GAS_LIMIT: 300000
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 MONITOR_FOREIGN_GAS_LIMIT: 300000
MONITOR_TX_NUMBER_THRESHOLD: 100 MONITOR_HOME_GAS_PRICE_FALLBACK: 1000000000
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
MONITOR_LEFT_TX_THRESHOLD: 100

View File

@@ -1,35 +1,36 @@
--- ---
## General settings ## General settings
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC" BRIDGE_MODE: "NATIVE_TO_ERC"
UI_NATIVE_TOKEN_DISPLAY_NAME: "ETC" HOME_NATIVE_NAME: "ETC"
## Home contract ## Home contract
COMMON_HOME_RPC_URL: "https://ethereumclassic.network" HOME_RPC_URL: "https://ethereumclassic.network"
UI_HOME_NETWORK_DISPLAY_NAME: "Ethereum Classic" HOME_NAME: "Ethereum Classic"
UI_HOME_WITHOUT_EVENTS: false HOME_WITHOUT_EVENTS: false
COMMON_HOME_BRIDGE_ADDRESS: "0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9" HOME_BRIDGE_ADDRESS: "0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9"
ORACLE_HOME_RPC_POLLING_INTERVAL: 7000 HOME_POLLING_INTERVAL: 7000
## Foreign contract ## Foreign contract
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io/" FOREIGN_RPC_URL: "https://mainnet.infura.io/"
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Ethereum Mainnet" FOREIGN_NAME: "Ethereum Mainnet"
UI_FOREIGN_WITHOUT_EVENTS: false FOREIGN_WITHOUT_EVENTS: false
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040" FOREIGN_BRIDGE_ADDRESS: "0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040"
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 7000 ERC20_TOKEN_ADDRESS: "0x86aaBCc646f290b9Fc9Bd05CE17C3858d1511Da1"
FOREIGN_POLLING_INTERVAL: 7000
## Home Gasprice ## Home Gasprice
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice-etc.poa.network/" HOME_GAS_PRICE_ORACLE_URL: "https://gasprice-etc.poa.network/"
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard" HOME_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_HOME_GAS_PRICE_FALLBACK: 15000000000 # in wei HOME_GAS_PRICE_FALLBACK: 15000000000 # in wei
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
COMMON_HOME_GAS_PRICE_FACTOR: 1 HOME_GAS_PRICE_FACTOR: 1
## Foreign Gasprice ## Foreign Gasprice
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/" FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE: "standard" FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
COMMON_FOREIGN_GAS_PRICE_FALLBACK: 10000000000 # in wei FOREIGN_GAS_PRICE_FALLBACK: 10000000000 # in wei
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1 FOREIGN_GAS_PRICE_FACTOR: 1
## UI ## UI
UI_TITLE: "TokenBridge UI app - %c" UI_TITLE: "TokenBridge UI app - %c"
@@ -39,14 +40,15 @@ UI_HOME_EXPLORER_TX_TEMPLATE: https://blockscout.com/etc/mainnet/tx/%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/mainnet/tx/%s UI_FOREIGN_EXPLORER_TX_TEMPLATE: https://blockscout.com/eth/mainnet/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/etc/mainnet/address/%s UI_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/etc/mainnet/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_HOME_GAS_PRICE_FALLBACK: 15000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000 UI_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
## Monitor ## Monitor
MONITOR_BRIDGE_NAME: "wetc"
MONITOR_PORT: 3003 MONITOR_PORT: 3003
MONITOR_HOME_START_BLOCK: 7703292 MONITOR_HOME_DEPLOYMENT_BLOCK: 7703292
MONITOR_FOREIGN_START_BLOCK: 7412459 MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 7412459
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000 MONITOR_HOME_GAS_LIMIT: 300000
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000 MONITOR_FOREIGN_GAS_LIMIT: 300000
MONITOR_TX_NUMBER_THRESHOLD: 100 MONITOR_HOME_GAS_PRICE_FALLBACK: 15000000000
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
MONITOR_LEFT_TX_THRESHOLD: 100

View File

@@ -5,7 +5,7 @@ sokol-kovan:
hosts: hosts:
127.0.0.1: 127.0.0.1:
ansible_user: ubuntu ansible_user: ubuntu
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" VALIDATOR_ADDRESS_PRIVATE_KEY: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
#syslog_server_port: "udp://127.0.0.1:514" #syslog_server_port: "udp://127.0.0.1:514"
ui: ui:
hosts: hosts:

View File

@@ -1,4 +1,5 @@
FROM python:3.7-stretch FROM python:3.7-stretch
RUN curl -fsSL https://get.docker.com | sh RUN curl -fsSL https://get.docker.com | sh
RUN pip3 install docker molecule==2.22rc1 molecule[docker] flake8 RUN pip3 install docker molecule==2.22rc1 molecule[docker] flake8
WORKDIR mono/deployment-e2e WORKDIR runner
COPY . .

View File

@@ -33,4 +33,4 @@ ui | Deploys and checks standalone UI on Ubuntu host
## Ultimate E2E tests ## Ultimate E2E tests
For information on the Ultimate tests, please refer to [Ultimate](../e2e-commons/ULTIMATE.md). For information on the Ultimate tests, please refer to [Ultimate](../../e2e-commons/ULTIMATE.md).

View File

@@ -4,9 +4,8 @@ services:
molecule_runner: molecule_runner:
build: build:
context: .. context: ..
dockerfile: deployment-e2e/Dockerfile dockerfile: molecule/Dockerfile
restart: 'no' restart: 'no'
privileged: true privileged: true
volumes: volumes:
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
- ..:/mono

11
deployment/molecule/molecule.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
cd $(dirname $0)
set -e # exit when any command fails
CODEBASE_BRANCH=${CIRCLE_BRANCH-$(git symbolic-ref --short HEAD)}
while [ "$1" != "" ]; do
docker-compose build && docker-compose run -e CODEBASE_BRANCH=$CODEBASE_BRANCH molecule_runner /bin/bash -c "molecule test --scenario-name $1"
shift # Shift all the parameters down by one
done

View File

@@ -29,11 +29,11 @@ provisioner:
r: ["bug"] r: ["bug"]
playbooks: playbooks:
prepare: ../prepare.yml prepare: ../prepare.yml
converge: ./converge.yml converge: ../../site.yml
inventory: inventory:
host_vars: host_vars:
monitor-host: monitor-host:
MONITOR_PORT: 3003 bridge_repo_branch: $CODEBASE_BRANCH
syslog_server_port: "udp://127.0.0.1:514" syslog_server_port: "udp://127.0.0.1:514"
verifier: verifier:
name: testinfra name: testinfra

View File

@@ -34,14 +34,14 @@ def test_logging(host, filename):
def test_home_exists(host): def test_home_exists(host):
assert host.run_test( assert host.run_test(
'curl -s http://localhost:3003/bridge | ' 'curl -s http://localhost:3003 | '
'grep -q -i "home"' 'grep -q -i "home"'
) )
def test_foreign_exists(host): def test_foreign_exists(host):
assert host.run_test( assert host.run_test(
'curl -s http://localhost:3003/bridge | ' 'curl -s http://localhost:3003 | '
'grep -q -i "foreign"' 'grep -q -i "foreign"'
) )
@@ -49,6 +49,6 @@ def test_foreign_exists(host):
def test_no_error(host): def test_no_error(host):
assert host.run_expect( assert host.run_expect(
[1], [1],
'curl -s http://localhost:3003/bridge | ' 'curl -s http://localhost:3003 | '
'grep -i -q "error"' 'grep -i -q "error"'
) )

View File

@@ -29,12 +29,13 @@ provisioner:
r: ["bug"] r: ["bug"]
playbooks: playbooks:
prepare: ../prepare.yml prepare: ../prepare.yml
converge: ../../../deployment/site.yml converge: ../../site.yml
inventory: inventory:
host_vars: host_vars:
oracle-host: oracle-host:
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9" VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
syslog_server_port: "udp://127.0.0.1:514" syslog_server_port: "udp://127.0.0.1:514"
bridge_repo_branch: $CODEBASE_BRANCH
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View File

@@ -0,0 +1,13 @@
---
- name: prepare
hosts: all
tasks:
- name: install apt packages
apt:
name: "{{ packages }}"
vars:
packages:
- apt-transport-https
- rsyslog
- shell: service rsyslog start
- shell: groupadd docker && chgrp docker /var/run/docker.sock

View File

@@ -9,6 +9,7 @@ testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
def test_repo(host): def test_repo(host):
assert host.file('/home/poadocker/bridge').exists assert host.file('/home/poadocker/bridge').exists
assert host.file('/home/poadocker/bridge').is_directory assert host.file('/home/poadocker/bridge').is_directory
assert host.file('/home/poadocker/bridge/package.json').exists
def test_docker_group(host): def test_docker_group(host):

View File

@@ -29,11 +29,12 @@ provisioner:
r: ["bug"] r: ["bug"]
playbooks: playbooks:
prepare: ../prepare.yml prepare: ../prepare.yml
converge: ../../../deployment/site.yml converge: ../../site.yml
inventory: inventory:
host_vars: host_vars:
ui-host: ui-host:
syslog_server_port: "udp://127.0.0.1:514" syslog_server_port: "udp://127.0.0.1:514"
bridge_repo_branch: $CODEBASE_BRANCH
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View File

@@ -1,5 +1,5 @@
--- ---
- import_playbook: ../../../deployment/site.yml - import_playbook: ../../site.yml
# The docker-compose files have to be modified, in order to join the docker containers over network with the parity containers # The docker-compose files have to be modified, in order to join the docker containers over network with the parity containers
- import_playbook: ./oracle-docker-compose.yml - import_playbook: ./oracle-docker-compose.yml
- import_playbook: ./ui-docker-compose.yml - import_playbook: ./ui-docker-compose.yml

View File

@@ -0,0 +1,36 @@
---
- name: Overwrite Oracle the docker-compose
hosts: oracle
become: true
tasks:
- name: stop the service
shell: service poabridge stop
- name: Slurp docker compose file
slurp:
src: "/home/poadocker/bridge/oracle/docker-compose.yml"
register: docker_compose_slurp
- name: Parse docker compose file
set_fact:
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
- name: Add the external network used to connect to Parity nodes
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
- name: Add all Oracle containers to the network
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {item: {'networks': docker_compose_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
with_items: "{{ docker_compose_parsed.services }}"
- name: Expose Redis port to allow connecting from redis-cli
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
- name: Write new docker-compose file
copy:
content: "{{ docker_compose_parsed | to_yaml }}"
dest: "/home/poadocker/bridge/oracle/docker-compose.yml"
- name: start the service
shell: service poabridge start

View File

@@ -32,13 +32,15 @@ provisioner:
inventory: inventory:
host_vars: host_vars:
oracle-erc-to-erc-host: oracle-erc-to-erc-host:
COMMON_HOME_RPC_URL: "http://parity1:8545" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://parity2:8545" HOME_RPC_URL: "http://parity1:8545"
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b" FOREIGN_RPC_URL: "http://parity2:8545"
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9" VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
ui-erc-to-erc-host: ui-erc-to-erc-host:
COMMON_HOME_RPC_URL: "http://localhost:8541" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://localhost:8542" HOME_RPC_URL: "http://localhost:8541"
FOREIGN_RPC_URL: "http://localhost:8542"
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View File

@@ -32,15 +32,15 @@ provisioner:
inventory: inventory:
host_vars: host_vars:
oracle-erc-to-native-host: oracle-erc-to-native-host:
COMMON_HOME_RPC_URL: "http://parity1:8545" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://parity2:8545" HOME_RPC_URL: "http://parity1:8545"
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b" FOREIGN_RPC_URL: "http://parity2:8545"
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9" VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
ORACLE_HOME_START_BLOCK: 1 VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
ORACLE_FOREIGN_START_BLOCK: 1
ui-erc-to-native-host: ui-erc-to-native-host:
COMMON_HOME_RPC_URL: "http://localhost:8541" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://localhost:8542" HOME_RPC_URL: "http://localhost:8541"
FOREIGN_RPC_URL: "http://localhost:8542"
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View File

@@ -32,13 +32,15 @@ provisioner:
inventory: inventory:
host_vars: host_vars:
oracle-native-to-erc-host: oracle-native-to-erc-host:
COMMON_HOME_RPC_URL: "http://parity1:8545" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://parity2:8545" HOME_RPC_URL: "http://parity1:8545"
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b" FOREIGN_RPC_URL: "http://parity2:8545"
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9" VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
ui-native-to-erc-host: ui-native-to-erc-host:
COMMON_HOME_RPC_URL: "http://localhost:8541" bridge_repo_branch: $CODEBASE_BRANCH
COMMON_FOREIGN_RPC_URL: "http://localhost:8542" HOME_RPC_URL: "http://localhost:8541"
FOREIGN_RPC_URL: "http://localhost:8542"
verifier: verifier:
name: testinfra name: testinfra
lint: lint:

View File

@@ -2,3 +2,5 @@
docker_compose_version: 1.23.2 docker_compose_version: 1.23.2
compose_service_user: poadocker compose_service_user: poadocker
bridge_path: "/home/{{ compose_service_user }}/bridge" bridge_path: "/home/{{ compose_service_user }}/bridge"
bridge_repo: https://github.com/poanetwork/tokenbridge.git
bridge_repo_branch: master

View File

@@ -32,9 +32,6 @@
group: "root" group: "root"
mode: "0755" mode: "0755"
- name: Upgrade pip version
shell: pip3 install --upgrade pip
- name: Install python docker library - name: Install python docker library
shell: pip3 install docker docker-compose setuptools shell: pip3 install docker docker-compose setuptools

View File

@@ -1,21 +1,4 @@
--- ---
- name: Check if component is already deployed - include_tasks: dependencies.yml
shell: "test -f {{ bridge_path }}/{{ component }}/.env && echo 'true'" - include_tasks: repo.yml
ignore_errors: True - include_tasks: logging.yml
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 and skip_repo is undefined
- name: Include logging tasks
include_tasks: logging.yml
when: skip_task != true

View File

@@ -1,34 +1,12 @@
--- ---
- name: Create archives of the monorepository - name: Get bridge repo
shell: | git:
(git ls-tree -r HEAD --name-only | sed '/^contracts$/d') | xargs tar zcfv monorepo.tar.gz --files-from - repo: "{{ bridge_repo }}"
cd contracts; (git ls-tree -r HEAD --name-only) | xargs tar zcfv ../contracts.tar.gz --files-from - dest: "{{ bridge_path }}"
delegate_to: 127.0.0.1 force: no
become: false update: no
args: version: "{{ bridge_repo_branch }}"
chdir: "{{ lookup('env', 'PWD') }}/.." - name: Initialize submodules
shell: git submodule update --init
- name: Copy the archives
copy:
src: ../../../../{{ item }}
dest: "{{ bridge_path }}/"
with_items:
- monorepo.tar.gz
- contracts.tar.gz
- name: Untar the archives
shell: |
tar zxfv monorepo.tar.gz && rm monorepo.tar.gz
mkdir -p contracts && tar zxfv contracts.tar.gz -C ./contracts && rm contracts.tar.gz
args: args:
chdir: "{{ bridge_path }}" chdir: "{{ bridge_path }}"
- name: Remove local archives
shell: rm {{ item }}
delegate_to: 127.0.0.1
become: false
args:
chdir: "{{ lookup('env', 'PWD') }}/.."
with_items:
- monorepo.tar.gz
- contracts.tar.gz

View File

@@ -1,3 +1,3 @@
--- ---
dependencies: dependencies:
- { role: common, skip_repo: true, check_deployed: true, component: 'monitor' } - role: common

View File

@@ -6,7 +6,7 @@
day: "{{ monitor_cron_schedule.split(' ')[2] }}" day: "{{ monitor_cron_schedule.split(' ')[2] }}"
month: "{{ monitor_cron_schedule.split(' ')[3] }}" month: "{{ monitor_cron_schedule.split(' ')[3] }}"
weekday: "{{ monitor_cron_schedule.split(' ')[4] }}" weekday: "{{ monitor_cron_schedule.split(' ')[4] }}"
job: "/bin/bash -c 'cd {{ bridge_path }}/monitor/scripts; ./getBridgeStats.sh >cronWorker.out 2>cronWorker.err'" job: "/bin/bash -c 'cd {{ bridge_path }}/monitor/scripts; ./checkDocker.sh >cronWorker.out 2>cronWorker.err'"
- name: Add cron entry - name: Add cron entry
cron: cron:
name: "RUN_MONITOR_CHECKS" name: "RUN_MONITOR_CHECKS"

View File

@@ -1,5 +1,5 @@
--- ---
- name: Pull the containers images - name: Build the containers
shell: docker-compose pull shell: docker-compose build
args: args:
chdir: "{{ bridge_path }}/monitor" chdir: "{{ bridge_path }}/monitor"

View File

@@ -1,18 +1,6 @@
--- ---
- include_tasks: pre_config.yml - include_tasks: pre_config.yml
- include_tasks: logging.yml
- name: Include logging tasks - include_tasks: jumpbox.yml
include_tasks: logging.yml - include_tasks: servinstall.yml
when: skip_task != true - include_tasks: cron.yml
- 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

View File

@@ -1,47 +1,5 @@
--- ---
- name: Create configs directory
file:
path: "{{ bridge_path }}/monitor/configs"
state: directory
mode: '0755'
when: skip_task != true
- name: Create responses directory
file:
path: "{{ bridge_path }}/monitor/responses"
state: directory
mode: '0755'
when: skip_task != true
- name: Create scripts directory
file:
path: "{{ bridge_path }}/monitor/scripts"
state: directory
mode: '0755'
when: skip_task != true
- name: Install .env config - name: Install .env config
template: template:
src: .env.j2 src: .env.j2
dest: "{{ bridge_path }}/monitor/.env" dest: "{{ bridge_path }}/monitor/.env"
when: skip_task != true
- name: Copy docker-compose file
copy:
src: ../../../../monitor/docker-compose.yml
dest: "{{ bridge_path }}/monitor/docker-compose.yml"
mode: '0755'
when: skip_task != true
- name: Copy script file
copy:
src: ../../../../monitor/scripts/getBridgeStats.sh
dest: "{{ bridge_path }}/monitor/scripts/getBridgeStats.sh"
owner: "{{ compose_service_user }}"
mode: '0755'
when: skip_task != true
- name: Install bridge config env
template:
src: config.env.j2
dest: "{{ bridge_path }}/monitor/configs/{{ MONITOR_BRIDGE_NAME }}.env"

View File

@@ -1,5 +1,6 @@
# This role creates a tokenbridge-monitor service which is designed to manage docker-compose monitor deployment. # This role creates a tokenbridge-monitor service which is designed to manage docker-compose monitor deployment.
# /etc/init.d/tokenbridge-monitor start, status, stop, restart - does what the services usually do in such cases. # /etc/init.d/tokenbridge-monitor start, status, stop, restart - does what the services usually do in such cases.
# /etc/init.d/tokenbridge-monitor rebuild - builds a new monitor deployment from scratch.
--- ---
- name: "Set the service" - name: "Set the service"
template: template:

View File

@@ -1 +1,24 @@
MONITOR_PORT={{ MONITOR_PORT }} HOME_RPC_URL={{ HOME_RPC_URL }}
FOREIGN_RPC_URL={{ FOREIGN_RPC_URL }}
HOME_BRIDGE_ADDRESS={{ HOME_BRIDGE_ADDRESS }}
FOREIGN_BRIDGE_ADDRESS={{ FOREIGN_BRIDGE_ADDRESS }}
HOME_DEPLOYMENT_BLOCK={{ MONITOR_HOME_DEPLOYMENT_BLOCK }}
FOREIGN_DEPLOYMENT_BLOCK={{ MONITOR_FOREIGN_DEPLOYMENT_BLOCK }}
HOME_GAS_LIMIT={{ MONITOR_HOME_GAS_LIMIT }}
{% if HOME_GAS_PRICE_ORACLE_URL | default('') != '' %}
HOME_GAS_PRICE_ORACLE_URL={{ HOME_GAS_PRICE_ORACLE_URL }}
{% endif %}
{% if HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
{% endif %}
HOME_GAS_PRICE_FALLBACK={{ MONITOR_HOME_GAS_PRICE_FALLBACK }}
{% if HOME_GAS_PRICE_FACTOR | default('') != '' %}
HOME_GAS_PRICE_FACTOR={{ HOME_GAS_PRICE_FACTOR }}
{% endif %}
FOREIGN_GAS_LIMIT={{ MONITOR_FOREIGN_GAS_LIMIT }}
FOREIGN_GAS_PRICE_ORACLE_URL={{ FOREIGN_GAS_PRICE_ORACLE_URL }}
FOREIGN_GAS_PRICE_SPEED_TYPE={{ FOREIGN_GAS_PRICE_SPEED_TYPE }}
FOREIGN_GAS_PRICE_FALLBACK={{ MONITOR_FOREIGN_GAS_PRICE_FALLBACK }}
FOREIGN_GAS_PRICE_FACTOR={{ FOREIGN_GAS_PRICE_FACTOR }}
LEFT_TX_THRESHOLD={{ MONITOR_LEFT_TX_THRESHOLD }}
PORT={{ MONITOR_PORT }}

View File

@@ -1,34 +0,0 @@
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 }}

View File

@@ -18,7 +18,6 @@ start(){
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose rm -fv sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose rm -fv
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose up --detach sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose up --detach
sudo -u "{{ compose_service_user }}" /bin/bash -c 'cd scripts; ./getBridgeStats.sh >cronWorker.out 2>cronWorker.err'
} }
stop(){ stop(){
@@ -34,6 +33,14 @@ status(){
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose ps sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose ps
} }
rebuild(){
echo "Rebuild TokenBridge Monitor.."
cd $WORKDIR
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose rm -fv
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose up --detach --force-recreate --no-deps --build
}
case "$1" in case "$1" in
@@ -55,8 +62,12 @@ case "$1" in
start start
;; ;;
rebuild)
rebuild
;;
*) *)
echo $"Usage: $0 {start|stop|restart|status}" echo $"Usage: $0 {start|stop|restart|rebuild|status}"
exit 1 exit 1
;; ;;

View File

@@ -1,6 +1,6 @@
--- ---
bridge_path: "/home/{{ compose_service_user }}/bridge" bridge_path: "/home/{{ compose_service_user }}/bridge"
ORACLE_ALLOW_HTTP_FOR_RPC: no ALLOW_HTTP: no
ORACLE_QUEUE_URL: amqp://rabbit QUEUE_URL: amqp://rabbit
ORACLE_REDIS_URL: redis://redis REDIS_URL: redis://redis
keyfile_path: "/root/.key" keyfile_path: "/root/.key"

View File

@@ -1,3 +1,3 @@
--- ---
dependencies: dependencies:
- { role: common, skip_repo: true } - role: common

View File

@@ -1,5 +1,5 @@
--- ---
- name: Pull the containers images - name: Build the containers
shell: docker-compose pull shell: docker-compose build
args: args:
chdir: "{{ bridge_path }}/oracle" chdir: "{{ bridge_path }}/oracle"

View File

@@ -1,11 +1,22 @@
--- ---
- include_tasks: logging_by_syslog.yml - name: Slurp docker compose file
with_items: slurp:
- docker-compose src: "{{ bridge_path }}/oracle/docker-compose.yml"
- docker-compose-transfer register: docker_compose_slurp
- docker-compose-erc-native
loop_control: - name: Parse docker compose file
loop_var: file set_fact:
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
- name: Set logger to remote server
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed |combine({'services': {item: {'logging': {'driver': 'syslog','options': {'tag': '{{.Name}}/{{.ID}}'}}}}}, recursive=True) }}"
with_items: "{{ docker_compose_parsed.services }}"
- name: Write new docker-compose file
copy:
content: "{{ docker_compose_parsed | to_yaml }}"
dest: "{{ bridge_path }}/oracle/docker-compose.yml"
- name: Set the local container logs configuration file - name: Set the local container logs configuration file
template: template:
@@ -29,5 +40,5 @@
path: /etc/rsyslog.conf path: /etc/rsyslog.conf
insertbefore: "# Where to place spool and state files" insertbefore: "# Where to place spool and state files"
marker: "#{mark} add string to discarding unwanted messages" marker: "#{mark} add string to discarding unwanted messages"
content: ':msg, contains, "ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY" ~' content: ':msg, contains, "VALIDATOR_ADDRESS_PRIVATE_KEY" ~'
notify: restart rsyslog notify: restart rsyslog

View File

@@ -1,19 +0,0 @@
---
- name: Slurp docker compose file
slurp:
src: "{{ bridge_path }}/oracle/{{ file }}.yml"
register: docker_compose_slurp
- name: Parse docker compose file
set_fact:
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
- name: Set logger to remote server
set_fact:
docker_compose_parsed: "{{ docker_compose_parsed |combine({'services': {item: {'logging': {'driver': 'syslog','options': {'tag': '{{.Name}}/{{.ID}}'}}}}}, recursive=True) }}"
with_items: "{{ docker_compose_parsed.services }}"
- name: Write updated docker file
copy:
content: "{{ docker_compose_parsed | to_yaml }}"
dest: "{{ bridge_path }}/oracle/{{ file }}.yml"

View File

@@ -1,50 +1,29 @@
--- ---
- name: Get blocks - name: Get blocks
become_user: "{{ compose_service_user }}" become_user: "{{ compose_service_user }}"
shell: docker-compose run --rm --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_affirmation shell: docker-compose run --entrypoint "node scripts/getValidatorStartBlocks.js" bridge_affirmation
args: args:
chdir: "{{ bridge_path }}/oracle" chdir: "{{ bridge_path }}/oracle"
register: BLOCKS register: BLOCKS
when: (ORACLE_HOME_START_BLOCK is not defined) or (ORACLE_FOREIGN_START_BLOCK is not defined)
- name: Write blocks - name: Write blocks
blockinfile: blockinfile:
path: "{{ bridge_path }}/oracle/.env" path: "{{ bridge_path }}/oracle/.env"
marker: "## {mark} Calculated by scripts/getValidatorStartBlocks.js" marker: "## {mark} Calculated by scripts/getValidatorStartBlocks.js"
block: | block: |
ORACLE_HOME_START_BLOCK={{ (BLOCKS.stdout | from_json).homeStartBlock }} HOME_START_BLOCK={{ (BLOCKS.stdout | from_json).homeStartBlock }}
ORACLE_FOREIGN_START_BLOCK={{ (BLOCKS.stdout | from_json).foreignStartBlock }} FOREIGN_START_BLOCK={{ (BLOCKS.stdout | from_json).foreignStartBlock }}
when: (ORACLE_HOME_START_BLOCK is not defined) or (ORACLE_FOREIGN_START_BLOCK is not defined)
- name: Get validator address - name: Get validator address
become_user: "{{ compose_service_user }}" become_user: "{{ compose_service_user }}"
shell: docker-compose run --rm -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation shell: docker-compose run -e VALIDATOR_ADDRESS_PRIVATE_KEY="{{ VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
args: args:
chdir: "{{ bridge_path }}/oracle" chdir: "{{ bridge_path }}/oracle"
register: VADDRESS register: VADDRESS
- name: Set ORACLE_VALIDATOR_ADDRESS variable - name: Set VALIDATOR_ADDRESS variable
set_fact: set_fact:
ORACLE_VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}" VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}"
- name: Get foreign erc type
become_user: "{{ compose_service_user }}"
shell: docker-compose run --rm --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_ERC" and FOREIGN_ERC_TYPE != "ERC677"
- name: Extend docker compose file for erc to native
set_fact: composefileoverride="-f docker-compose-erc-native.yml"
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE"
- name: Install .key config - name: Install .key config
template: template:

View File

@@ -1,21 +1,5 @@
--- ---
- name: Create oracle directory
file:
path: "{{ bridge_path }}/oracle"
state: directory
mode: '0755'
- name: Install .env config - name: Install .env config
template: template:
src: .env.j2 src: .env.j2
dest: "{{ bridge_path }}/oracle/.env" dest: "{{ bridge_path }}/oracle/.env"
- name: Copy docker-compose files
copy:
src: ../../../../oracle/{{ item }}
dest: "{{ bridge_path }}/oracle/"
mode: '0755'
with_items:
- docker-compose.yml
- docker-compose-transfer.yml
- docker-compose-erc-native.yml

View File

@@ -1,5 +1,6 @@
# This role creates a poabridge service which is designed to manage docker-compose bridge deployment. # This role creates a poabridge service which is designed to manage docker-compose bridge deployment.
# /etc/init.d/poabridge start, status, stop, restart - does what the services usually do in such cases. # /etc/init.d/poabridge start, status, stop, restart - does what the services usually do in such cases.
# /etc/init.d/poabridge rebuild - builds a new bridge deployment from scratch.
--- ---
- name: "Set poabridge service" - name: "Set poabridge service"
template: template:

View File

@@ -1,56 +1,49 @@
## General settings ## General settings
ORACLE_BRIDGE_MODE={{ ORACLE_BRIDGE_MODE }} BRIDGE_MODE={{ BRIDGE_MODE }}
{% if ORACLE_LOG_LEVEL | default('') != '' %}
ORACLE_LOG_LEVEL={{ ORACLE_LOG_LEVEL }}
{% endif %}
## Home contract ## Home contract
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }} HOME_RPC_URL={{ HOME_RPC_URL }}
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }} HOME_BRIDGE_ADDRESS={{ HOME_BRIDGE_ADDRESS }}
ORACLE_HOME_RPC_POLLING_INTERVAL={{ ORACLE_HOME_RPC_POLLING_INTERVAL }} HOME_POLLING_INTERVAL={{ HOME_POLLING_INTERVAL }}
## Foreign contract ## Foreign contract
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }} FOREIGN_RPC_URL={{ FOREIGN_RPC_URL }}
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }} FOREIGN_BRIDGE_ADDRESS={{ FOREIGN_BRIDGE_ADDRESS }}
ORACLE_FOREIGN_RPC_POLLING_INTERVAL={{ ORACLE_FOREIGN_RPC_POLLING_INTERVAL }} {% if ERC20_TOKEN_ADDRESS | default('') != '' %}
ERC20_TOKEN_ADDRESS={{ ERC20_TOKEN_ADDRESS }}
{% endif %}
FOREIGN_POLLING_INTERVAL={{ FOREIGN_POLLING_INTERVAL }}
## Gasprice ## Gasprice
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %} {% if HOME_GAS_PRICE_ORACLE_URL | default('') != '' %}
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }} HOME_GAS_PRICE_ORACLE_URL={{ HOME_GAS_PRICE_ORACLE_URL }}
{% endif %} {% endif %}
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %} {% if HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }} HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
{% endif %} {% endif %}
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }} HOME_GAS_PRICE_FALLBACK={{ HOME_GAS_PRICE_FALLBACK }}
{% if ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %} {% if HOME_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL }} HOME_GAS_PRICE_UPDATE_INTERVAL={{ HOME_GAS_PRICE_UPDATE_INTERVAL }}
{% endif %} {% endif %}
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %} {% if HOME_GAS_PRICE_FACTOR | default('') != '' %}
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }} HOME_GAS_PRICE_FACTOR={{ HOME_GAS_PRICE_FACTOR }}
{% endif %} {% endif %}
{% if COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | default('') != '' %} {% if FOREIGN_GAS_PRICE_ORACLE_URL | default('') != '' %}
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }} FOREIGN_GAS_PRICE_ORACLE_URL={{ FOREIGN_GAS_PRICE_ORACLE_URL }}
{% endif %} {% endif %}
{% if COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %} {% if FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %}
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }} FOREIGN_GAS_PRICE_SPEED_TYPE={{ FOREIGN_GAS_PRICE_SPEED_TYPE }}
{% endif %} {% endif %}
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }} FOREIGN_GAS_PRICE_FALLBACK={{ FOREIGN_GAS_PRICE_FALLBACK }}
{% if ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %} {% if FOREIGN_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL }} FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
{% endif %} {% endif %}
{% if COMMON_FOREIGN_GAS_PRICE_FACTOR | default('') != '' %} {% if FOREIGN_GAS_PRICE_FACTOR | default('') != '' %}
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }} FOREIGN_GAS_PRICE_FACTOR={{ FOREIGN_GAS_PRICE_FACTOR }}
{% endif %} {% endif %}
## Transport configuration ## Transport configuration
ORACLE_ALLOW_HTTP_FOR_RPC={{ "yes" if ORACLE_ALLOW_HTTP_FOR_RPC else "no" }} ALLOW_HTTP={{ "yes" if ALLOW_HTTP else "no" }}
ORACLE_QUEUE_URL={{ ORACLE_QUEUE_URL }} QUEUE_URL={{ QUEUE_URL }}
ORACLE_REDIS_URL={{ ORACLE_REDIS_URL }} REDIS_URL={{ REDIS_URL }}
{% if ORACLE_HOME_START_BLOCK | default('') != '' %}
ORACLE_HOME_START_BLOCK={{ ORACLE_HOME_START_BLOCK }}
{% endif %}
{% if ORACLE_FOREIGN_START_BLOCK | default('') != '' %}
ORACLE_FOREIGN_START_BLOCK={{ ORACLE_FOREIGN_START_BLOCK }}
{% endif %}

View File

@@ -1,3 +1,3 @@
## Validator-specific options ## Validator-specific options
ORACLE_VALIDATOR_ADDRESS={{ ORACLE_VALIDATOR_ADDRESS }} VALIDATOR_ADDRESS={{ VALIDATOR_ADDRESS }}
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY={{ ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }} VALIDATOR_ADDRESS_PRIVATE_KEY={{ VALIDATOR_ADDRESS_PRIVATE_KEY }}

View File

@@ -14,9 +14,8 @@ WORKDIR="{{ '/home/' + compose_service_user | default('poadocker') + '/' + bridg
#Getting path to private key file and variable name for parsing key file #Getting path to private key file and variable name for parsing key file
keyfile="{{ keyfile_path }}" keyfile="{{ keyfile_path }}"
vaddr="ORACLE_VALIDATOR_ADDRESS=" vaddr="VALIDATOR_ADDRESS="
vkey="ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=" vkey="VALIDATOR_ADDRESS_PRIVATE_KEY="
composefileoverride="{{ composefileoverride | default('') }}"
#Parsing file content and add key to variable #Parsing file content and add key to variable
while read -r line while read -r line
@@ -34,22 +33,30 @@ done < $keyfile
start(){ start(){
echo "Starting bridge.." echo "Starting bridge.."
cd $WORKDIR cd $WORKDIR
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride down -v sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride rm -fv sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose rm -fv
sudo -u "{{ compose_service_user }}" ORACLE_VALIDATOR_ADDRESS=$vaddr ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=$vkey /usr/local/bin/docker-compose $composefileoverride up --detach sudo -u "{{ compose_service_user }}" VALIDATOR_ADDRESS=$vaddr VALIDATOR_ADDRESS_PRIVATE_KEY=$vkey /usr/local/bin/docker-compose up --detach
} }
stop(){ stop(){
echo "Stopping bridge.." echo "Stopping bridge.."
cd $WORKDIR cd $WORKDIR
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride down -v sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v
sleep 2 sleep 2
} }
status(){ status(){
echo "Bridge status:" echo "Bridge status:"
cd $WORKDIR cd $WORKDIR
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride ps sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose ps
}
rebuild(){
echo "Rebuild bridge.."
cd $WORKDIR
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose down -v
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose rm -fv
sudo -u "{{ compose_service_user }}" VALIDATOR_ADDRESS=$vaddr VALIDATOR_ADDRESS_PRIVATE_KEY=$vkey /usr/local/bin/docker-compose up --detach --force-recreate --no-deps --build
} }
@@ -73,8 +80,12 @@ case "$1" in
start start
;; ;;
rebuild)
rebuild
;;
*) *)
echo $"Usage: $0 {start|stop|restart|status}" echo $"Usage: $0 {start|stop|restart|rebuild|status}"
exit 1 exit 1
;; ;;

View File

@@ -1,42 +1,38 @@
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }} REACT_APP_HOME_BRIDGE_ADDRESS={{ HOME_BRIDGE_ADDRESS }}
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }} REACT_APP_FOREIGN_BRIDGE_ADDRESS={{ FOREIGN_BRIDGE_ADDRESS }}
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }} REACT_APP_FOREIGN_HTTP_PARITY_URL={{ FOREIGN_RPC_URL }}
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }} REACT_APP_HOME_HTTP_PARITY_URL={{ HOME_RPC_URL }}
UI_NATIVE_TOKEN_DISPLAY_NAME={{ UI_NATIVE_TOKEN_DISPLAY_NAME }} REACT_APP_HOME_NATIVE_NAME={{ HOME_NATIVE_NAME }}
UI_HOME_NETWORK_DISPLAY_NAME={{ UI_HOME_NETWORK_DISPLAY_NAME }} REACT_APP_HOME_NETWORK_NAME={{ HOME_NAME }}
UI_FOREIGN_NETWORK_DISPLAY_NAME={{ UI_FOREIGN_NETWORK_DISPLAY_NAME }} REACT_APP_FOREIGN_NETWORK_NAME={{ FOREIGN_NAME }}
UI_HOME_WITHOUT_EVENTS={{ UI_HOME_WITHOUT_EVENTS }} REACT_APP_HOME_WITHOUT_EVENTS={{ HOME_WITHOUT_EVENTS }}
UI_FOREIGN_WITHOUT_EVENTS={{ UI_FOREIGN_WITHOUT_EVENTS }} REACT_APP_FOREIGN_WITHOUT_EVENTS={{ FOREIGN_WITHOUT_EVENTS }}
UI_HOME_EXPLORER_TX_TEMPLATE={{ UI_HOME_EXPLORER_TX_TEMPLATE }} REACT_APP_HOME_EXPLORER_TX_TEMPLATE={{ UI_HOME_EXPLORER_TX_TEMPLATE }}
UI_FOREIGN_EXPLORER_TX_TEMPLATE={{ UI_FOREIGN_EXPLORER_TX_TEMPLATE }} REACT_APP_FOREIGN_EXPLORER_TX_TEMPLATE={{ UI_FOREIGN_EXPLORER_TX_TEMPLATE }}
UI_HOME_EXPLORER_ADDRESS_TEMPLATE={{ UI_HOME_EXPLORER_ADDRESS_TEMPLATE }} REACT_APP_HOME_EXPLORER_ADDRESS_TEMPLATE={{ UI_HOME_EXPLORER_ADDRESS_TEMPLATE }}
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE={{ UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE }} REACT_APP_FOREIGN_EXPLORER_ADDRESS_TEMPLATE={{ UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE }}
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %} {% if HOME_GAS_PRICE_ORACLE_URL | default('') != '' %}
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }} REACT_APP_HOME_GAS_PRICE_ORACLE_URL={{ HOME_GAS_PRICE_ORACLE_URL }}
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }} REACT_APP_HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
{% endif %} {% endif %}
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }} REACT_APP_HOME_GAS_PRICE_FALLBACK={{ UI_HOME_GAS_PRICE_FALLBACK }}
UI_HOME_GAS_PRICE_UPDATE_INTERVAL={{ UI_HOME_GAS_PRICE_UPDATE_INTERVAL }} REACT_APP_HOME_GAS_PRICE_UPDATE_INTERVAL={{ HOME_GAS_PRICE_UPDATE_INTERVAL }}
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %} {% if HOME_GAS_PRICE_FACTOR | default('') != '' %}
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }} REACT_APP_HOME_GAS_PRICE_FACTOR={{ HOME_GAS_PRICE_FACTOR }}
{% endif %} {% endif %}
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }} REACT_APP_FOREIGN_GAS_PRICE_ORACLE_URL={{ FOREIGN_GAS_PRICE_ORACLE_URL }}
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }} REACT_APP_FOREIGN_GAS_PRICE_SPEED_TYPE={{ FOREIGN_GAS_PRICE_SPEED_TYPE }}
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }} REACT_APP_FOREIGN_GAS_PRICE_FALLBACK={{ UI_FOREIGN_GAS_PRICE_FALLBACK }}
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL }} REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }} REACT_APP_FOREIGN_GAS_PRICE_FACTOR={{ FOREIGN_GAS_PRICE_FACTOR }}
# Default # Default
UI_TITLE={{ UI_TITLE }} REACT_APP_TITLE={{ UI_TITLE }}
UI_DESCRIPTION={{ UI_DESCRIPTION }} REACT_APP_DESCRIPTION={{ UI_DESCRIPTION }}
UI_PORT={{ UI_PORT }} PORT={{ UI_PORT }}
{% if UI_STYLES | default('') != '' %}
UI_STYLES={{ UI_STYLES }}
{% endif %}

View File

@@ -1,19 +0,0 @@
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0
COMMON_FOREIGN_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0
MONITOR_HOME_START_BLOCK=0
MONITOR_FOREIGN_START_BLOCK=0
MONITOR_VALIDATOR_HOME_TX_LIMIT=300000
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000
COMMON_HOME_GAS_PRICE_FACTOR=1
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT=300000
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
COMMON_FOREIGN_GAS_PRICE_FALLBACK=1000000000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
MONITOR_TX_NUMBER_THRESHOLD=100
MONITOR_PORT=3013
MONITOR_BRIDGE_NAME=bridge

View File

@@ -1,19 +0,0 @@
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
COMMON_FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
MONITOR_HOME_START_BLOCK=0
MONITOR_FOREIGN_START_BLOCK=0
MONITOR_VALIDATOR_HOME_TX_LIMIT=300000
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000
COMMON_HOME_GAS_PRICE_FACTOR=1
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT=300000
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
COMMON_FOREIGN_GAS_PRICE_FALLBACK=1000000000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
MONITOR_TX_NUMBER_THRESHOLD=100
MONITOR_PORT=3012
MONITOR_BRIDGE_NAME=bridge

View File

@@ -1,19 +0,0 @@
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
COMMON_FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
MONITOR_HOME_START_BLOCK=0
MONITOR_FOREIGN_START_BLOCK=0
MONITOR_VALIDATOR_HOME_TX_LIMIT=300000
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000
COMMON_HOME_GAS_PRICE_FACTOR=1
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT=300000
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
COMMON_FOREIGN_GAS_PRICE_FALLBACK=1000000000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
MONITOR_TX_NUMBER_THRESHOLD=100
MONITOR_PORT=3011
MONITOR_BRIDGE_NAME=bridge

View File

@@ -1,19 +0,0 @@
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
COMMON_FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
MONITOR_HOME_START_BLOCK=0
MONITOR_FOREIGN_START_BLOCK=0
MONITOR_VALIDATOR_HOME_TX_LIMIT=300000
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000
COMMON_HOME_GAS_PRICE_FACTOR=1
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT=300000
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
COMMON_FOREIGN_GAS_PRICE_FALLBACK=1000000000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
MONITOR_TX_NUMBER_THRESHOLD=100
MONITOR_PORT=3010
MONITOR_BRIDGE_NAME=bridge

View File

@@ -1,23 +0,0 @@
ORACLE_BRIDGE_MODE=ARBITRARY_MESSAGE
ORACLE_QUEUE_URL=amqp://rabbit
ORACLE_REDIS_URL=redis://redis
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0
COMMON_FOREIGN_BRIDGE_ADDRESS=0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0
ORACLE_VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1000000000
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL=600000
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
ORACLE_HOME_RPC_POLLING_INTERVAL=500
ORACLE_FOREIGN_RPC_POLLING_INTERVAL=500
ORACLE_ALLOW_HTTP_FOR_RPC=yes

View File

@@ -1,25 +0,0 @@
ORACLE_BRIDGE_MODE=ERC_TO_NATIVE
ORACLE_QUEUE_URL=amqp://rabbit
ORACLE_REDIS_URL=redis://redis
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
COMMON_FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
ORACLE_VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL=600000
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=1
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
COMMON_FOREIGN_GAS_PRICE_FACTOR=0.1
ORACLE_HOME_RPC_POLLING_INTERVAL=500
ORACLE_FOREIGN_RPC_POLLING_INTERVAL=500
ORACLE_ALLOW_HTTP_FOR_RPC=yes
ORACLE_HOME_START_BLOCK=1
ORACLE_FOREIGN_START_BLOCK=1

View File

@@ -1,23 +0,0 @@
ORACLE_BRIDGE_MODE=ERC_TO_ERC
ORACLE_QUEUE_URL=amqp://rabbit
ORACLE_REDIS_URL=redis://redis
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
COMMON_FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
ORACLE_VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL=600000
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=1
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
COMMON_FOREIGN_GAS_PRICE_FACTOR=0.1
ORACLE_HOME_RPC_POLLING_INTERVAL=500
ORACLE_FOREIGN_RPC_POLLING_INTERVAL=500
ORACLE_ALLOW_HTTP_FOR_RPC=yes

View File

@@ -1,23 +0,0 @@
ORACLE_BRIDGE_MODE=NATIVE_TO_ERC
ORACLE_QUEUE_URL=amqp://rabbit
ORACLE_REDIS_URL=redis://redis
COMMON_HOME_RPC_URL=http://parity1:8545
COMMON_FOREIGN_RPC_URL=http://parity2:8545
COMMON_HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
COMMON_FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
ORACLE_VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=1
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL=600000
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=1
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
COMMON_FOREIGN_GAS_PRICE_FACTOR=0.1
ORACLE_HOME_RPC_POLLING_INTERVAL=500
ORACLE_FOREIGN_RPC_POLLING_INTERVAL=500
ORACLE_ALLOW_HTTP_FOR_RPC=yes

View File

@@ -1,22 +0,0 @@
COMMON_HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
COMMON_FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
COMMON_FOREIGN_RPC_URL=http://localhost:8542
COMMON_HOME_RPC_URL=http://localhost:8541
UI_NATIVE_TOKEN_DISPLAY_NAME=POA
UI_HOME_NETWORK_DISPLAY_NAME=Sokol
UI_FOREIGN_NETWORK_DISPLAY_NAME=Kovan
UI_HOME_EXPLORER_TX_TEMPLATE=https://blockscout.com/poa/sokol/tx//%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE=https://blockscout.com/eth/kovan/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/poa/sokol/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/eth/kovan/address/%s
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=5000000000
UI_HOME_GAS_PRICE_UPDATE_INTERVAL=15000
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=5000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
UI_PORT=3000

View File

@@ -1,22 +0,0 @@
COMMON_HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
COMMON_FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
COMMON_FOREIGN_RPC_URL=http://localhost:8542
COMMON_HOME_RPC_URL=http://localhost:8541
UI_NATIVE_TOKEN_DISPLAY_NAME=POA
UI_HOME_NETWORK_DISPLAY_NAME=Sokol
UI_FOREIGN_NETWORK_DISPLAY_NAME=Kovan
UI_HOME_EXPLORER_TX_TEMPLATE=https://blockscout.com/poa/sokol/tx//%s
UI_FOREIGN_EXPLORER_TX_TEMPLATE=https://blockscout.com/eth/kovan/tx/%s
UI_HOME_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/poa/sokol/address/%s
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/eth/kovan/address/%s
COMMON_HOME_GAS_PRICE_SUPPLIER_URL=https://gasprice.poa.network/
COMMON_HOME_GAS_PRICE_SPEED_TYPE=standard
COMMON_HOME_GAS_PRICE_FALLBACK=5000000000
UI_HOME_GAS_PRICE_UPDATE_INTERVAL=15000
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=5000000000
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
COMMON_FOREIGN_GAS_PRICE_FACTOR=1
UI_PORT=3000

Some files were not shown because too many files have changed in this diff Show More