Compare commits
26 Commits
amb-defray
...
1.0.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
db89d1c12e | ||
|
|
4fd4ac3d73 | ||
|
|
cbd9d607ce | ||
|
|
346fa1e732 | ||
|
|
f6fa83d7ea | ||
|
|
1564ccc580 | ||
|
|
7a54e584d5 | ||
|
|
1d79cf82f3 | ||
|
|
9884b4b424 | ||
|
|
d577a71096 | ||
|
|
803f0074e6 | ||
|
|
e288df39dc | ||
|
|
8d0e70359f | ||
|
|
ab8270ee7c | ||
|
|
6b55c54497 | ||
|
|
114f62da7b | ||
|
|
8b010f887d | ||
|
|
d593577ace | ||
|
|
4e2971f880 | ||
|
|
54858ae597 | ||
|
|
443474e802 | ||
|
|
677bc50519 | ||
|
|
9af253b83e | ||
|
|
01186d6aa8 | ||
|
|
dd9add50a0 | ||
|
|
c39e81f97d |
@@ -5,6 +5,12 @@ orbs:
|
||||
commands:
|
||||
install-chrome:
|
||||
steps:
|
||||
- run:
|
||||
name: Update dpkg
|
||||
command: |
|
||||
sudo apt-get clean
|
||||
sudo apt-get update
|
||||
sudo apt-get install dpkg
|
||||
- run:
|
||||
name: Install Chrome
|
||||
command: |
|
||||
@@ -18,7 +24,7 @@ orbs:
|
||||
export NVM_DIR="/opt/circleci/.nvm"
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
|
||||
|
||||
nvm install 11.4.0 && nvm alias default 11.4.0
|
||||
nvm install 10.16.3 && nvm alias default 10.16.3
|
||||
|
||||
echo 'export NVM_DIR="/opt/circleci/.nvm"' >> $BASH_ENV
|
||||
echo ' [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> $BASH_ENV
|
||||
@@ -169,17 +175,42 @@ jobs:
|
||||
executor: tokenbridge-orb/machine-with-docker-caching
|
||||
steps:
|
||||
- checkout
|
||||
- run: deployment/molecule/molecule.sh oracle
|
||||
- run: git submodule update --init
|
||||
- run:
|
||||
name: Run the scenario
|
||||
command: deployment-e2e/molecule.sh oracle
|
||||
no_output_timeout: 40m
|
||||
deployment-ui:
|
||||
executor: tokenbridge-orb/machine-with-docker-caching
|
||||
steps:
|
||||
- checkout
|
||||
- run: deployment/molecule/molecule.sh ui
|
||||
- run: git submodule update --init
|
||||
- run:
|
||||
name: Run the scenario
|
||||
command: deployment-e2e/molecule.sh ui
|
||||
no_output_timeout: 40m
|
||||
deployment-monitor:
|
||||
executor: tokenbridge-orb/machine-with-docker-caching
|
||||
steps:
|
||||
- checkout
|
||||
- run: deployment/molecule/molecule.sh monitor
|
||||
- run: git submodule update --init
|
||||
- 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
|
||||
|
||||
ultimate:
|
||||
executor: tokenbridge-orb/machine-with-docker-caching
|
||||
parameters:
|
||||
@@ -202,7 +233,7 @@ jobs:
|
||||
- run:
|
||||
name: Prepare the infrastructure
|
||||
command: e2e-commons/up.sh deploy << parameters.scenario-name >>
|
||||
no_output_timeout: 30m
|
||||
no_output_timeout: 50m
|
||||
- tokenbridge-orb/wait-for-oracle:
|
||||
redis-key: << parameters.redis-key >>
|
||||
- run:
|
||||
@@ -240,6 +271,7 @@ workflows:
|
||||
- deployment-oracle
|
||||
- deployment-ui
|
||||
- deployment-monitor
|
||||
- deployment-repo
|
||||
- ultimate:
|
||||
name: "ultimate: native to erc"
|
||||
scenario-name: native-to-erc
|
||||
|
||||
2
.gitmodules
vendored
2
.gitmodules
vendored
@@ -1,3 +1,3 @@
|
||||
[submodule "contracts"]
|
||||
path = contracts
|
||||
url = https://github.com/poanetwork/poa-bridge-contracts.git
|
||||
url = https://github.com/poanetwork/tokenbridge-contracts.git
|
||||
|
||||
71
CONFIGURATION.md
Normal file
71
CONFIGURATION.md
Normal file
@@ -0,0 +1,71 @@
|
||||
# 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
|
||||
@@ -3,6 +3,7 @@ FROM node:10
|
||||
WORKDIR /mono
|
||||
COPY package.json .
|
||||
COPY oracle-e2e/package.json ./oracle-e2e/
|
||||
COPY monitor-e2e/package.json ./monitor-e2e/
|
||||
COPY contracts/package.json ./contracts/
|
||||
|
||||
COPY yarn.lock .
|
||||
|
||||
@@ -26,10 +26,11 @@ Sub-repositories maintained within this monorepo are listed below.
|
||||
| [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 |
|
||||
| [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 |
|
||||
| [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/poa-bridge-contracts) used to manage bridge validators, collect signatures, and confirm asset relay and disposal.
|
||||
Additionally there are [Smart Contracts](https://github.com/poanetwork/tokenbridge-contracts) used to manage bridge validators, collect signatures, and confirm asset relay and disposal.
|
||||
|
||||
## Available deployments
|
||||
|
||||
@@ -51,11 +52,12 @@ Additionally there are [Smart Contracts](https://github.com/poanetwork/poa-bridg
|
||||
|
||||
## Operational Modes
|
||||
|
||||
The POA TokenBridge provides three operational modes:
|
||||
The POA TokenBridge provides four 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] `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] `Arbitrary-Message`: Transfer arbitrary data between two networks as so the data could be interpreted as an arbitrary contract method invocation.
|
||||
|
||||
## Initializing the monorepository
|
||||
|
||||
@@ -85,13 +87,14 @@ Running tests for all projects:
|
||||
yarn test
|
||||
```
|
||||
|
||||
Additionaly there are end-to-end tests for [Oracle](oracle-e2e/README.md) and [UI](ui-e2e/README.md).
|
||||
Additionally 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.
|
||||
|
||||
## Building, running and deploying
|
||||
|
||||
Please refer to the instructions in sub-directories.
|
||||
Configuration details are available [here](./CONFIGURATION.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -10,6 +10,9 @@ const ERC677_BRIDGE_TOKEN_ABI = require('../contracts/build/contracts/ERC677Brid
|
||||
const BLOCK_REWARD_ABI = require('../contracts/build/contracts/IBlockReward').abi
|
||||
const BRIDGE_VALIDATORS_ABI = require('../contracts/build/contracts/BridgeValidators').abi
|
||||
const REWARDABLE_VALIDATORS_ABI = require('../contracts/build/contracts/RewardableValidators').abi
|
||||
const HOME_AMB_ABI = require('../contracts/build/contracts/HomeAMB').abi
|
||||
const FOREIGN_AMB_ABI = require('../contracts/build/contracts/ForeignAMB').abi
|
||||
const BOX_ABI = require('../contracts/build/contracts/Box').abi
|
||||
|
||||
const { HOME_V1_ABI, FOREIGN_V1_ABI } = require('./v1Abis')
|
||||
const { BRIDGE_MODES } = require('./constants')
|
||||
@@ -60,6 +63,9 @@ function getBridgeABIs(bridgeMode) {
|
||||
} else if (bridgeMode === BRIDGE_MODES.NATIVE_TO_ERC_V1) {
|
||||
HOME_ABI = HOME_V1_ABI
|
||||
FOREIGN_ABI = FOREIGN_V1_ABI
|
||||
} else if (bridgeMode === BRIDGE_MODES.ARBITRARY_MESSAGE) {
|
||||
HOME_ABI = HOME_AMB_ABI
|
||||
FOREIGN_ABI = FOREIGN_AMB_ABI
|
||||
} else {
|
||||
throw new Error(`Unrecognized bridge mode: ${bridgeMode}`)
|
||||
}
|
||||
@@ -83,5 +89,8 @@ module.exports = {
|
||||
REWARDABLE_VALIDATORS_ABI,
|
||||
HOME_V1_ABI,
|
||||
FOREIGN_V1_ABI,
|
||||
ERC20_BYTES32_ABI
|
||||
ERC20_BYTES32_ABI,
|
||||
HOME_AMB_ABI,
|
||||
FOREIGN_AMB_ABI,
|
||||
BOX_ABI
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@ const BRIDGE_MODES = {
|
||||
NATIVE_TO_ERC: 'NATIVE_TO_ERC',
|
||||
ERC_TO_ERC: 'ERC_TO_ERC',
|
||||
ERC_TO_NATIVE: 'ERC_TO_NATIVE',
|
||||
NATIVE_TO_ERC_V1: 'NATIVE_TO_ERC_V1'
|
||||
NATIVE_TO_ERC_V1: 'NATIVE_TO_ERC_V1',
|
||||
ARBITRARY_MESSAGE: 'ARBITRARY_MESSAGE'
|
||||
}
|
||||
|
||||
const ERC_TYPES = {
|
||||
@@ -16,4 +17,11 @@ const FEE_MANAGER_MODE = {
|
||||
UNDEFINED: 'UNDEFINED'
|
||||
}
|
||||
|
||||
module.exports = { BRIDGE_MODES, ERC_TYPES, FEE_MANAGER_MODE }
|
||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||
|
||||
module.exports = {
|
||||
BRIDGE_MODES,
|
||||
ERC_TYPES,
|
||||
FEE_MANAGER_MODE,
|
||||
ZERO_ADDRESS
|
||||
}
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
const constants = require('./constants')
|
||||
const abis = require('./abis')
|
||||
const utils = require('./utils')
|
||||
const message = require('./message')
|
||||
|
||||
module.exports = {
|
||||
...constants,
|
||||
...abis,
|
||||
...utils
|
||||
...utils,
|
||||
...message
|
||||
}
|
||||
|
||||
27
commons/message.js
Normal file
27
commons/message.js
Normal file
@@ -0,0 +1,27 @@
|
||||
function strip0x(input) {
|
||||
return input.replace(/^0x/, '')
|
||||
}
|
||||
|
||||
function addTxHashToData({ encodedData, transactionHash }) {
|
||||
return encodedData.slice(0, 2) + strip0x(transactionHash) + encodedData.slice(2)
|
||||
}
|
||||
|
||||
function parseAMBMessage(message) {
|
||||
message = strip0x(message)
|
||||
|
||||
const txHash = `0x${message.slice(0, 64)}`
|
||||
const sender = `0x${message.slice(64, 104)}`
|
||||
const executor = `0x${message.slice(104, 144)}`
|
||||
|
||||
return {
|
||||
sender,
|
||||
executor,
|
||||
txHash
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
addTxHashToData,
|
||||
parseAMBMessage,
|
||||
strip0x
|
||||
}
|
||||
@@ -8,6 +8,10 @@
|
||||
"test": "NODE_ENV=test mocha"
|
||||
},
|
||||
"dependencies": {
|
||||
"web3-utils": "1.0.0-beta.30"
|
||||
"web3-utils": "1.0.0-beta.34"
|
||||
},
|
||||
"devDependencies": {
|
||||
"bn-chai": "^1.0.1",
|
||||
"chai": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ const { BRIDGE_MODES, ERC_TYPES } = require('../constants')
|
||||
|
||||
describe('constants', () => {
|
||||
it('should contain correct number of bridge types', () => {
|
||||
expect(Object.keys(BRIDGE_MODES).length).to.be.equal(4)
|
||||
expect(Object.keys(BRIDGE_MODES).length).to.be.equal(5)
|
||||
})
|
||||
|
||||
it('should contain correct number of erc types', () => {
|
||||
69
commons/test/message.test.js
Normal file
69
commons/test/message.test.js
Normal file
@@ -0,0 +1,69 @@
|
||||
const { BN } = require('web3-utils')
|
||||
const { expect } = require('chai').use(require('bn-chai')(BN))
|
||||
const { parseAMBMessage, strip0x, addTxHashToData } = require('../message')
|
||||
|
||||
describe('strip0x', () => {
|
||||
it('should remove 0x from input', () => {
|
||||
// Given
|
||||
const input = '0x12345'
|
||||
|
||||
// When
|
||||
const result = strip0x(input)
|
||||
|
||||
// Then
|
||||
expect(result).to.be.equal('12345')
|
||||
})
|
||||
it('should not modify input if 0x is not present', () => {
|
||||
// Given
|
||||
const input = '12345'
|
||||
|
||||
// When
|
||||
const result = strip0x(input)
|
||||
|
||||
// Then
|
||||
expect(result).to.be.equal(input)
|
||||
})
|
||||
})
|
||||
describe('addTxHashToData', () => {
|
||||
it('should add txHash to encoded data at position 2', () => {
|
||||
// Given
|
||||
const msgSender = '0x003667154bb32e42bb9e1e6532f19d187fa0082e'
|
||||
const msgExecutor = '0xf4bef13f9f4f2b203faf0c3cbbaabe1afe056955'
|
||||
const msgGasLimit = '000000000000000000000000000000000000000000000000000000005b877705'
|
||||
const msgDataType = '00'
|
||||
const msgData = '0xb1591967aed668a4b27645ff40c444892d91bf5951b382995d4d4f6ee3a2ce03'
|
||||
const encodedData = `0x${strip0x(msgSender)}${strip0x(msgExecutor)}${msgGasLimit}${msgDataType}${strip0x(msgData)}`
|
||||
|
||||
const transactionHash = '0xbdceda9d8c94838aca10c687da1411a07b1390e88239c0638cb9cc264219cc10'
|
||||
const message = `0x${strip0x(transactionHash)}${strip0x(msgSender)}${strip0x(
|
||||
msgExecutor
|
||||
)}${msgGasLimit}${msgDataType}${strip0x(msgData)}`
|
||||
|
||||
// When
|
||||
const result = addTxHashToData({ encodedData, transactionHash })
|
||||
|
||||
// Then
|
||||
expect(result).to.be.equal(message)
|
||||
})
|
||||
})
|
||||
describe('parseAMBMessage', () => {
|
||||
it('should parse data type 00', () => {
|
||||
const msgSender = '0x003667154bb32e42bb9e1e6532f19d187fa0082e'
|
||||
const msgExecutor = '0xf4bef13f9f4f2b203faf0c3cbbaabe1afe056955'
|
||||
const msgTxHash = '0xbdceda9d8c94838aca10c687da1411a07b1390e88239c0638cb9cc264219cc10'
|
||||
const msgGasLimit = '000000000000000000000000000000000000000000000000000000005b877705'
|
||||
const msgDataType = '00'
|
||||
const msgData = '0xb1591967aed668a4b27645ff40c444892d91bf5951b382995d4d4f6ee3a2ce03'
|
||||
const message = `0x${strip0x(msgTxHash)}${strip0x(msgSender)}${strip0x(
|
||||
msgExecutor
|
||||
)}${msgGasLimit}${msgDataType}${strip0x(msgData)}`
|
||||
|
||||
// when
|
||||
const { sender, executor, txHash } = parseAMBMessage(message)
|
||||
|
||||
// then
|
||||
expect(sender).to.be.equal(msgSender)
|
||||
expect(executor).to.be.equal(msgExecutor)
|
||||
expect(txHash).to.be.equal(msgTxHash)
|
||||
})
|
||||
})
|
||||
@@ -10,6 +10,8 @@ function decodeBridgeMode(bridgeModeHash) {
|
||||
return BRIDGE_MODES.ERC_TO_ERC
|
||||
case '0x18762d46':
|
||||
return BRIDGE_MODES.ERC_TO_NATIVE
|
||||
case '0x2544fbb9':
|
||||
return BRIDGE_MODES.ARBITRARY_MESSAGE
|
||||
default:
|
||||
throw new Error(`Unrecognized bridge mode hash: '${bridgeModeHash}'`)
|
||||
}
|
||||
@@ -203,7 +205,7 @@ const normalizeGasPrice = (oracleGasPrice, factor, limits = null) => {
|
||||
// fetchFn has to be supplied (instead of just url to oracle),
|
||||
// because this utility function is shared between Browser and Node,
|
||||
// we use built-in 'fetch' on browser side, and `node-fetch` package in Node.
|
||||
const gasPriceFromOracle = async (fetchFn, options = {}) => {
|
||||
const gasPriceFromSupplier = async (fetchFn, options = {}) => {
|
||||
try {
|
||||
const response = await fetchFn()
|
||||
const json = await response.json()
|
||||
@@ -256,7 +258,7 @@ module.exports = {
|
||||
getPastEvents,
|
||||
getDeployedAtBlock,
|
||||
normalizeGasPrice,
|
||||
gasPriceFromOracle,
|
||||
gasPriceFromSupplier,
|
||||
gasPriceFromContract,
|
||||
gasPriceWithinLimits
|
||||
}
|
||||
|
||||
Submodule contracts updated: 048f51e0e8...20d262702d
@@ -1,5 +1,4 @@
|
||||
FROM python:3.7-stretch
|
||||
RUN curl -fsSL https://get.docker.com | sh
|
||||
RUN pip3 install docker molecule==2.22rc1 molecule[docker] flake8
|
||||
WORKDIR runner
|
||||
COPY . .
|
||||
WORKDIR mono/deployment-e2e
|
||||
@@ -33,4 +33,4 @@ ui | Deploys and checks standalone UI on Ubuntu host
|
||||
|
||||
## 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).
|
||||
@@ -4,8 +4,9 @@ services:
|
||||
molecule_runner:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: molecule/Dockerfile
|
||||
dockerfile: deployment-e2e/Dockerfile
|
||||
restart: 'no'
|
||||
privileged: true
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ..:/mono
|
||||
9
deployment-e2e/molecule.sh
Executable file
9
deployment-e2e/molecule.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
#!/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
|
||||
@@ -29,11 +29,10 @@ provisioner:
|
||||
r: ["bug"]
|
||||
playbooks:
|
||||
prepare: ../prepare.yml
|
||||
converge: ../../site.yml
|
||||
converge: ../../../deployment/site.yml
|
||||
inventory:
|
||||
host_vars:
|
||||
monitor-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
syslog_server_port: "udp://127.0.0.1:514"
|
||||
verifier:
|
||||
name: testinfra
|
||||
@@ -29,13 +29,12 @@ provisioner:
|
||||
r: ["bug"]
|
||||
playbooks:
|
||||
prepare: ../prepare.yml
|
||||
converge: ../../site.yml
|
||||
converge: ../../../deployment/site.yml
|
||||
inventory:
|
||||
host_vars:
|
||||
oracle-host:
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
syslog_server_port: "udp://127.0.0.1:514"
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
12
deployment-e2e/molecule/repo/converge.yml
Normal file
12
deployment-e2e/molecule/repo/converge.yml
Normal file
@@ -0,0 +1,12 @@
|
||||
---
|
||||
- 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
|
||||
30
deployment-e2e/molecule/repo/molecule.yml
Normal file
30
deployment-e2e/molecule/repo/molecule.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
---
|
||||
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
|
||||
49
deployment-e2e/molecule/repo/tests/test_existing.py
Normal file
49
deployment-e2e/molecule/repo/tests/test_existing.py
Normal file
@@ -0,0 +1,49 @@
|
||||
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
|
||||
23
deployment-e2e/molecule/repo/tests/test_non_existing.py
Normal file
23
deployment-e2e/molecule/repo/tests/test_non_existing.py
Normal file
@@ -0,0 +1,23 @@
|
||||
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
|
||||
@@ -29,12 +29,11 @@ provisioner:
|
||||
r: ["bug"]
|
||||
playbooks:
|
||||
prepare: ../prepare.yml
|
||||
converge: ../../site.yml
|
||||
converge: ../../../deployment/site.yml
|
||||
inventory:
|
||||
host_vars:
|
||||
ui-host:
|
||||
syslog_server_port: "udp://127.0.0.1:514"
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
- import_playbook: ../../site.yml
|
||||
- import_playbook: ../../../deployment/site.yml
|
||||
# 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: ./ui-docker-compose.yml
|
||||
@@ -0,0 +1,62 @@
|
||||
---
|
||||
- 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: Slurp docker compose extended file
|
||||
slurp:
|
||||
src: "/home/poadocker/bridge/oracle/docker-compose-transfer.yml"
|
||||
register: docker_compose_extended_slurp
|
||||
- name: Parse docker compose file
|
||||
set_fact:
|
||||
docker_compose_extended_parsed: "{{ docker_compose_extended_slurp['content'] | b64decode | from_yaml }}"
|
||||
|
||||
- name: Add the external network used to connect to Parity nodes in compose extended file
|
||||
set_fact:
|
||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
|
||||
|
||||
- name: Add all Oracle containers to the network in compose extended file
|
||||
set_fact:
|
||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed | combine({'services': {item: {'networks': docker_compose_extended_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
|
||||
with_items: "{{ docker_compose_extended_parsed.services }}"
|
||||
|
||||
- name: Expose Redis port to allow connecting from redis-cli in compose extended file
|
||||
set_fact:
|
||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
|
||||
|
||||
- name: Write new docker-compose extended file
|
||||
copy:
|
||||
content: "{{ docker_compose_extended_parsed | to_yaml }}"
|
||||
dest: "/home/poadocker/bridge/oracle/docker-compose-transfer.yml"
|
||||
|
||||
- name: start the service
|
||||
shell: service poabridge start
|
||||
@@ -32,15 +32,13 @@ provisioner:
|
||||
inventory:
|
||||
host_vars:
|
||||
oracle-erc-to-erc-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://parity1:8545"
|
||||
FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
COMMON_HOME_RPC_URL: "http://parity1:8545"
|
||||
COMMON_FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
ui-erc-to-erc-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://localhost:8541"
|
||||
FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
COMMON_HOME_RPC_URL: "http://localhost:8541"
|
||||
COMMON_FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
@@ -32,15 +32,13 @@ provisioner:
|
||||
inventory:
|
||||
host_vars:
|
||||
oracle-erc-to-native-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://parity1:8545"
|
||||
FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
COMMON_HOME_RPC_URL: "http://parity1:8545"
|
||||
COMMON_FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
ui-erc-to-native-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://localhost:8541"
|
||||
FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
COMMON_HOME_RPC_URL: "http://localhost:8541"
|
||||
COMMON_FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
14
deployment-e2e/molecule/ultimate-native-to-erc/Dockerfile.j2
Normal file
14
deployment-e2e/molecule/ultimate-native-to-erc/Dockerfile.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
# 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
|
||||
@@ -32,15 +32,13 @@ provisioner:
|
||||
inventory:
|
||||
host_vars:
|
||||
oracle-native-to-erc-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://parity1:8545"
|
||||
FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
COMMON_HOME_RPC_URL: "http://parity1:8545"
|
||||
COMMON_FOREIGN_RPC_URL: "http://parity2:8545"
|
||||
ORACLE_VALIDATOR_ADDRESS: "0xaaB52d66283F7A1D5978bcFcB55721ACB467384b"
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9"
|
||||
ui-native-to-erc-host:
|
||||
bridge_repo_branch: $CODEBASE_BRANCH
|
||||
HOME_RPC_URL: "http://localhost:8541"
|
||||
FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
COMMON_HOME_RPC_URL: "http://localhost:8541"
|
||||
COMMON_FOREIGN_RPC_URL: "http://localhost:8542"
|
||||
verifier:
|
||||
name: testinfra
|
||||
lint:
|
||||
@@ -1,6 +1,6 @@
|
||||
# POA TokenBridge / Deployment Configuration
|
||||
|
||||
Please see the [Oracle](../oracle/README.md) for additional configuration and execution details.
|
||||
Please see the [Configuration](../CONFIGURATION.md) for additional configuration and execution details.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
@@ -30,7 +30,7 @@ cp hosts.yml.example hosts.yml
|
||||
hosts:
|
||||
<host_ip_A>:
|
||||
ansible_user: <user>
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "<private_key>"
|
||||
ORACLE_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.
|
||||
<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`. |
|
||||
| `<host_ip>` | Remote server IP address. |
|
||||
| ansible_user: `<user>` | User that will ssh into the node. This is typically `ubuntu` or `root`. |
|
||||
| VALIDATOR_ADDRESS_PRIVATE_KEY: `"<private_key>"` | The private key for the specified validator address. |
|
||||
| ORACLE_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. |
|
||||
|
||||
`hosts.yml` can contain multiple bridge configurations at once.
|
||||
@@ -89,10 +89,6 @@ 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.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.5 `docker_compose_version` - specifies a version of docker-compose to be installed.
|
||||
|
||||
@@ -16,7 +16,7 @@ Please refer to [Execution](./EXECUTION.md).
|
||||
|
||||
## Testing
|
||||
|
||||
Please refer to [Testing](./molecule/TESTING.md).
|
||||
Please refer to [Deployment-E2E](../deployment-e2e/README.md).
|
||||
|
||||
## Contributing
|
||||
|
||||
|
||||
@@ -1,35 +1,34 @@
|
||||
---
|
||||
## General settings
|
||||
BRIDGE_MODE: "ERC_TO_NATIVE"
|
||||
HOME_NATIVE_NAME: "xDai"
|
||||
ORACLE_BRIDGE_MODE: "ERC_TO_NATIVE"
|
||||
UI_NATIVE_TOKEN_DISPLAY_NAME: "xDai"
|
||||
|
||||
## Home contract
|
||||
HOME_RPC_URL: "https://dai.poa.network"
|
||||
HOME_NAME: "xDai chain"
|
||||
HOME_WITHOUT_EVENTS: false
|
||||
HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6"
|
||||
HOME_POLLING_INTERVAL: 5000
|
||||
COMMON_HOME_RPC_URL: "https://dai.poa.network"
|
||||
UI_HOME_NETWORK_DISPLAY_NAME: "xDai chain"
|
||||
UI_HOME_WITHOUT_EVENTS: false
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x7301CFA0e1756B71869E93d4e4Dca5c7d0eb0AA6"
|
||||
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000
|
||||
|
||||
## Foreign contract
|
||||
FOREIGN_RPC_URL: "https://mainnet.infura.io"
|
||||
FOREIGN_NAME: "Ethereum Mainnet"
|
||||
FOREIGN_WITHOUT_EVENTS: false
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016"
|
||||
ERC20_TOKEN_ADDRESS: "0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359"
|
||||
FOREIGN_POLLING_INTERVAL: 5000
|
||||
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io"
|
||||
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Ethereum Mainnet"
|
||||
UI_FOREIGN_WITHOUT_EVENTS: false
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4aa42145Aa6Ebf72e164C9bBC74fbD3788045016"
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 5000
|
||||
|
||||
## Home Gasprice
|
||||
# HOME_GAS_PRICE_ORACLE_URL: "https://localhost:8888/"
|
||||
HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
HOME_GAS_PRICE_FALLBACK: 0
|
||||
HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
# COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://localhost:8888/"
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK: 0
|
||||
COMMON_HOME_GAS_PRICE_FACTOR: 600000
|
||||
|
||||
## Foreign Gasprice
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
FOREIGN_GAS_PRICE_FALLBACK: 10000000000
|
||||
FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
FOREIGN_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
|
||||
|
||||
## UI
|
||||
UI_TITLE: "TokenBridge UI app - %c"
|
||||
@@ -39,15 +38,13 @@ 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_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/poa/dai/address/%s
|
||||
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s
|
||||
UI_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||
UI_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
|
||||
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Monitor
|
||||
MONITOR_PORT: 3003
|
||||
MONITOR_HOME_DEPLOYMENT_BLOCK: 759
|
||||
MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 6478417
|
||||
MONITOR_HOME_GAS_LIMIT: 300000
|
||||
MONITOR_FOREIGN_GAS_LIMIT: 300000
|
||||
MONITOR_HOME_GAS_PRICE_FALLBACK: 0
|
||||
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
|
||||
MONITOR_LEFT_TX_THRESHOLD: 100
|
||||
MONITOR_HOME_START_BLOCK: 759
|
||||
MONITOR_FOREIGN_START_BLOCK: 6478417
|
||||
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000
|
||||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000
|
||||
MONITOR_TX_NUMBER_THRESHOLD: 100
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
BRIDGE_MODE: "ERC_TO_ERC"
|
||||
HOME_BRIDGE_ADDRESS: "0x1feB40aD9420b186F019A717c37f5546165d411E"
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127"
|
||||
ERC20_TOKEN_ADDRESS: "0x3C665A31199694Bf723fD08844AD290207B5797f"
|
||||
ORACLE_BRIDGE_MODE: "ERC_TO_ERC"
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x1feB40aD9420b186F019A717c37f5546165d411E"
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127"
|
||||
UI_PORT: 3001
|
||||
MONITOR_PORT: 3011
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
BRIDGE_MODE: "ERC_TO_NATIVE"
|
||||
HOME_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
|
||||
ERC20_TOKEN_ADDRESS: "0x3C665A31199694Bf723fD08844AD290207B5797f"
|
||||
ORACLE_BRIDGE_MODE: "ERC_TO_NATIVE"
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x488Af810997eD1730cB3a3918cD83b3216E6eAda"
|
||||
UI_PORT: 3002
|
||||
MONITOR_PORT: 3012
|
||||
|
||||
@@ -1,36 +1,36 @@
|
||||
---
|
||||
## General settings
|
||||
BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
HOME_NATIVE_NAME: "POA"
|
||||
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
ORACLE_LOG_LEVEL: debug
|
||||
UI_NATIVE_TOKEN_DISPLAY_NAME: "POA"
|
||||
|
||||
## Home contract
|
||||
HOME_RPC_URL: "https://sokol.poa.network"
|
||||
HOME_NAME: "POA Sokol"
|
||||
HOME_WITHOUT_EVENTS: false
|
||||
HOME_BRIDGE_ADDRESS: "0x98aFdE294f1C46aA0a27Cc4049ED337F879d8976"
|
||||
HOME_POLLING_INTERVAL: 5000
|
||||
COMMON_HOME_RPC_URL: "https://sokol.poa.network"
|
||||
UI_HOME_NETWORK_DISPLAY_NAME: "POA Sokol"
|
||||
UI_HOME_WITHOUT_EVENTS: false
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x98aFdE294f1C46aA0a27Cc4049ED337F879d8976"
|
||||
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000
|
||||
|
||||
## Foreign contract
|
||||
FOREIGN_RPC_URL: "https://sokol.poa.network"
|
||||
FOREIGN_NAME: "Kovan"
|
||||
FOREIGN_WITHOUT_EVENTS: false
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x5a584f4C30B36f282848dAc9a2b20E7BEF481981"
|
||||
ERC20_TOKEN_ADDRESS: "0x6ef22442D600E1865AD8A8c254d6befCe7f4e6e4"
|
||||
FOREIGN_POLLING_INTERVAL: 1000
|
||||
COMMON_FOREIGN_RPC_URL: "https://sokol.poa.network"
|
||||
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Kovan"
|
||||
UI_FOREIGN_WITHOUT_EVENTS: false
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x5a584f4C30B36f282848dAc9a2b20E7BEF481981"
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 1000
|
||||
|
||||
## Home Gasprice
|
||||
HOME_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
HOME_GAS_PRICE_FACTOR: 1
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/"
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
COMMON_HOME_GAS_PRICE_FACTOR: 1
|
||||
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Foreign Gasprice
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
FOREIGN_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: 1000000000 # in wei
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1
|
||||
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## UI
|
||||
UI_TITLE: "TokenBridge UI app - %c"
|
||||
@@ -40,15 +40,13 @@ 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
|
||||
UI_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||
UI_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Monitor
|
||||
MONITOR_PORT: 3003
|
||||
MONITOR_HOME_DEPLOYMENT_BLOCK: 0
|
||||
MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 0
|
||||
MONITOR_HOME_GAS_LIMIT: 300000
|
||||
MONITOR_FOREIGN_GAS_LIMIT: 300000
|
||||
MONITOR_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||
MONITOR_HOME_START_BLOCK: 0
|
||||
MONITOR_FOREIGN_START_BLOCK: 0
|
||||
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000
|
||||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000
|
||||
MONITOR_LEFT_TX_THRESHOLD: 100
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
---
|
||||
BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
|
||||
ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
|
||||
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
|
||||
UI_PORT: 3000
|
||||
MONITOR_PORT: 3010
|
||||
|
||||
@@ -1,56 +1,49 @@
|
||||
---
|
||||
## General settings
|
||||
# BRIDGE_MODE: ""
|
||||
HOME_NATIVE_NAME: "POA"
|
||||
ALLOW_HTTP: yes
|
||||
LOG_LEVEL: debug
|
||||
UI_NATIVE_TOKEN_DISPLAY_NAME: "POA"
|
||||
ORACLE_ALLOW_HTTP_FOR_RPC: yes
|
||||
ORACLE_LOG_LEVEL: debug
|
||||
|
||||
## Home contract
|
||||
HOME_RPC_URL: "https://sokol.poa.network"
|
||||
HOME_NAME: "POA Sokol"
|
||||
HOME_WITHOUT_EVENTS: false
|
||||
# HOME_BRIDGE_ADDRESS: "0x32198D570fffC7033641F8A9094FFDCaAEF42624"
|
||||
HOME_POLLING_INTERVAL: 5000
|
||||
COMMON_HOME_RPC_URL: "https://sokol.poa.network"
|
||||
UI_HOME_NETWORK_DISPLAY_NAME: "POA Sokol"
|
||||
UI_HOME_WITHOUT_EVENTS: false
|
||||
ORACLE_HOME_RPC_POLLING_INTERVAL: 5000
|
||||
|
||||
## Foreign contract
|
||||
FOREIGN_RPC_URL: "https://sokol.poa.network"
|
||||
FOREIGN_NAME: "Kovan"
|
||||
FOREIGN_WITHOUT_EVENTS: false
|
||||
# FOREIGN_BRIDGE_ADDRESS: "0x2B6871b9B02F73fa24F4864322CdC78604207769"
|
||||
# ERC20_TOKEN_ADDRESS: "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B"
|
||||
FOREIGN_POLLING_INTERVAL: 1000
|
||||
COMMON_FOREIGN_RPC_URL: "https://sokol.poa.network"
|
||||
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Kovan"
|
||||
UI_FOREIGN_WITHOUT_EVENTS: false
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 1000
|
||||
|
||||
## Home Gasprice
|
||||
HOME_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
HOME_GAS_PRICE_FACTOR: 1
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice.poa.network/"
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
COMMON_HOME_GAS_PRICE_FACTOR: 1
|
||||
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Foreign Gasprice
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
FOREIGN_GAS_PRICE_FALLBACK: 1000000000 # in wei
|
||||
FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
FOREIGN_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: 1000000000 # in wei
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1
|
||||
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## UI
|
||||
|
||||
#ui
|
||||
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_PORT: 3000
|
||||
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
|
||||
UI_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||
UI_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Monitor
|
||||
# MONITOR_PORT: 3003
|
||||
MONITOR_HOME_DEPLOYMENT_BLOCK: 0
|
||||
MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 0
|
||||
MONITOR_HOME_GAS_LIMIT: 300000
|
||||
MONITOR_FOREIGN_GAS_LIMIT: 300000
|
||||
MONITOR_HOME_GAS_PRICE_FALLBACK: 1000000000
|
||||
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 1000000000
|
||||
#montior
|
||||
MONITOR_HOME_START_BLOCK: 0
|
||||
MONITOR_FOREIGN_START_BLOCK: 0
|
||||
MONITOR_VALIDATOR_HOME_TX_LIMIT: 300000
|
||||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT: 300000
|
||||
MONITOR_LEFT_TX_THRESHOLD: 100
|
||||
|
||||
@@ -1,36 +1,35 @@
|
||||
---
|
||||
## General settings
|
||||
BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
HOME_NATIVE_NAME: "ETC"
|
||||
ORACLE_BRIDGE_MODE: "NATIVE_TO_ERC"
|
||||
UI_NATIVE_TOKEN_DISPLAY_NAME: "ETC"
|
||||
|
||||
## Home contract
|
||||
HOME_RPC_URL: "https://ethereumclassic.network"
|
||||
HOME_NAME: "Ethereum Classic"
|
||||
HOME_WITHOUT_EVENTS: false
|
||||
HOME_BRIDGE_ADDRESS: "0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9"
|
||||
HOME_POLLING_INTERVAL: 7000
|
||||
COMMON_HOME_RPC_URL: "https://ethereumclassic.network"
|
||||
UI_HOME_NETWORK_DISPLAY_NAME: "Ethereum Classic"
|
||||
UI_HOME_WITHOUT_EVENTS: false
|
||||
COMMON_HOME_BRIDGE_ADDRESS: "0x073081832B4Ecdce79d4D6753565c85Ba4b3BeA9"
|
||||
ORACLE_HOME_RPC_POLLING_INTERVAL: 7000
|
||||
|
||||
## Foreign contract
|
||||
FOREIGN_RPC_URL: "https://mainnet.infura.io/"
|
||||
FOREIGN_NAME: "Ethereum Mainnet"
|
||||
FOREIGN_WITHOUT_EVENTS: false
|
||||
FOREIGN_BRIDGE_ADDRESS: "0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040"
|
||||
ERC20_TOKEN_ADDRESS: "0x86aaBCc646f290b9Fc9Bd05CE17C3858d1511Da1"
|
||||
FOREIGN_POLLING_INTERVAL: 7000
|
||||
COMMON_FOREIGN_RPC_URL: "https://mainnet.infura.io/"
|
||||
UI_FOREIGN_NETWORK_DISPLAY_NAME: "Ethereum Mainnet"
|
||||
UI_FOREIGN_WITHOUT_EVENTS: false
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS: "0x0cB781EE62F815bdD9CD4c2210aE8600d43e7040"
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL: 7000
|
||||
|
||||
## Home Gasprice
|
||||
HOME_GAS_PRICE_ORACLE_URL: "https://gasprice-etc.poa.network/"
|
||||
HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
HOME_GAS_PRICE_FALLBACK: 15000000000 # in wei
|
||||
HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
HOME_GAS_PRICE_FACTOR: 1
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL: "https://gasprice-etc.poa.network/"
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK: 15000000000 # in wei
|
||||
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
COMMON_HOME_GAS_PRICE_FACTOR: 1
|
||||
|
||||
## Foreign Gasprice
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL: "https://gasprice.poa.network/"
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE: "standard"
|
||||
FOREIGN_GAS_PRICE_FALLBACK: 10000000000 # in wei
|
||||
FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
FOREIGN_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 # in wei
|
||||
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR: 1
|
||||
|
||||
## UI
|
||||
UI_TITLE: "TokenBridge UI app - %c"
|
||||
@@ -40,15 +39,13 @@ 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_HOME_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/etc/mainnet/address/%s
|
||||
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE: https://blockscout.com/eth/mainnet/address/%s
|
||||
UI_HOME_GAS_PRICE_FALLBACK: 15000000000
|
||||
UI_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
|
||||
UI_HOME_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL: 600000
|
||||
|
||||
## Monitor
|
||||
MONITOR_PORT: 3003
|
||||
MONITOR_HOME_DEPLOYMENT_BLOCK: 7703292
|
||||
MONITOR_FOREIGN_DEPLOYMENT_BLOCK: 7412459
|
||||
MONITOR_HOME_GAS_LIMIT: 300000
|
||||
MONITOR_FOREIGN_GAS_LIMIT: 300000
|
||||
MONITOR_HOME_GAS_PRICE_FALLBACK: 15000000000
|
||||
MONITOR_FOREIGN_GAS_PRICE_FALLBACK: 10000000000
|
||||
MONITOR_LEFT_TX_THRESHOLD: 100
|
||||
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
|
||||
|
||||
@@ -5,7 +5,7 @@ sokol-kovan:
|
||||
hosts:
|
||||
127.0.0.1:
|
||||
ansible_user: ubuntu
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
||||
#syslog_server_port: "udp://127.0.0.1:514"
|
||||
ui:
|
||||
hosts:
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
#!/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
|
||||
@@ -1,13 +0,0 @@
|
||||
---
|
||||
- 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
|
||||
@@ -1,36 +0,0 @@
|
||||
---
|
||||
- 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
|
||||
@@ -2,5 +2,3 @@
|
||||
docker_compose_version: 1.23.2
|
||||
compose_service_user: poadocker
|
||||
bridge_path: "/home/{{ compose_service_user }}/bridge"
|
||||
bridge_repo: https://github.com/poanetwork/tokenbridge.git
|
||||
bridge_repo_branch: master
|
||||
|
||||
@@ -1,12 +1,34 @@
|
||||
---
|
||||
- name: Get bridge repo
|
||||
git:
|
||||
repo: "{{ bridge_repo }}"
|
||||
dest: "{{ bridge_path }}"
|
||||
force: no
|
||||
update: no
|
||||
version: "{{ bridge_repo_branch }}"
|
||||
- name: Initialize submodules
|
||||
shell: git submodule update --init
|
||||
- name: Create archives of the monorepository
|
||||
shell: |
|
||||
(git ls-tree -r HEAD --name-only | sed '/^contracts$/d') | xargs tar zcfv monorepo.tar.gz --files-from -
|
||||
cd contracts; (git ls-tree -r HEAD --name-only) | xargs tar zcfv ../contracts.tar.gz --files-from -
|
||||
delegate_to: 127.0.0.1
|
||||
become: false
|
||||
args:
|
||||
chdir: "{{ lookup('env', 'PWD') }}/.."
|
||||
|
||||
- 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:
|
||||
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
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
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 }}
|
||||
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }}
|
||||
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }}
|
||||
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }}
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }}
|
||||
MONITOR_HOME_START_BLOCK={{ MONITOR_HOME_START_BLOCK }}
|
||||
MONITOR_FOREIGN_START_BLOCK={{ MONITOR_FOREIGN_START_BLOCK }}
|
||||
MONITOR_VALIDATOR_HOME_TX_LIMIT={{ MONITOR_VALIDATOR_HOME_TX_LIMIT }}
|
||||
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }}
|
||||
{% endif %}
|
||||
{% if HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
|
||||
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_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 }}
|
||||
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 %}
|
||||
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 }}
|
||||
MONITOR_VALIDATOR_FOREIGN_TX_LIMIT={{ MONITOR_VALIDATOR_FOREIGN_TX_LIMIT }}
|
||||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }}
|
||||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }}
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }}
|
||||
MONITOR_LEFT_TX_THRESHOLD={{ MONITOR_LEFT_TX_THRESHOLD }}
|
||||
MONITOR_PORT={{ MONITOR_PORT }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
bridge_path: "/home/{{ compose_service_user }}/bridge"
|
||||
ALLOW_HTTP: no
|
||||
QUEUE_URL: amqp://rabbit
|
||||
REDIS_URL: redis://redis
|
||||
ORACLE_ALLOW_HTTP_FOR_RPC: no
|
||||
ORACLE_QUEUE_URL: amqp://rabbit
|
||||
ORACLE_REDIS_URL: redis://redis
|
||||
keyfile_path: "/root/.key"
|
||||
|
||||
@@ -40,5 +40,5 @@
|
||||
path: /etc/rsyslog.conf
|
||||
insertbefore: "# Where to place spool and state files"
|
||||
marker: "#{mark} add string to discarding unwanted messages"
|
||||
content: ':msg, contains, "VALIDATOR_ADDRESS_PRIVATE_KEY" ~'
|
||||
content: ':msg, contains, "ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY" ~'
|
||||
notify: restart rsyslog
|
||||
|
||||
@@ -16,14 +16,29 @@
|
||||
|
||||
- name: Get validator address
|
||||
become_user: "{{ compose_service_user }}"
|
||||
shell: docker-compose run -e VALIDATOR_ADDRESS_PRIVATE_KEY="{{ VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
|
||||
shell: docker-compose run -e ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="{{ ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}" --entrypoint "node scripts/privateKeyToAddress.js" bridge_affirmation
|
||||
args:
|
||||
chdir: "{{ bridge_path }}/oracle"
|
||||
register: VADDRESS
|
||||
|
||||
- name: Set VALIDATOR_ADDRESS variable
|
||||
- name: Set ORACLE_VALIDATOR_ADDRESS variable
|
||||
set_fact:
|
||||
VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}"
|
||||
ORACLE_VALIDATOR_ADDRESS: "{{ VADDRESS.stdout }}"
|
||||
|
||||
- name: Get foreign erc type
|
||||
become_user: "{{ compose_service_user }}"
|
||||
shell: docker-compose run --entrypoint "node scripts/initialChecks.js" bridge_affirmation
|
||||
args:
|
||||
chdir: "{{ bridge_path }}/oracle"
|
||||
register: ERCTYPE
|
||||
|
||||
- name: Set FOREIGN_ERC_TYPE variable
|
||||
set_fact:
|
||||
FOREIGN_ERC_TYPE: "{{ (ERCTYPE.stdout).foreignERC | default('') }}"
|
||||
|
||||
- name: Extend docker compose file
|
||||
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
||||
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE" or ( ORACLE_BRIDGE_MODE == "ERC_TO_ERC" and FOREIGN_ERC_TYPE != "ERC677")
|
||||
|
||||
- name: Install .key config
|
||||
template:
|
||||
|
||||
@@ -1,47 +1,47 @@
|
||||
## General settings
|
||||
BRIDGE_MODE={{ BRIDGE_MODE }}
|
||||
ORACLE_BRIDGE_MODE={{ ORACLE_BRIDGE_MODE }}
|
||||
ORACLE_LOG_LEVEL={{ ORACLE_LOG_LEVEL }}
|
||||
|
||||
## Home contract
|
||||
HOME_RPC_URL={{ HOME_RPC_URL }}
|
||||
HOME_BRIDGE_ADDRESS={{ HOME_BRIDGE_ADDRESS }}
|
||||
HOME_POLLING_INTERVAL={{ HOME_POLLING_INTERVAL }}
|
||||
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }}
|
||||
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }}
|
||||
ORACLE_HOME_RPC_POLLING_INTERVAL={{ ORACLE_HOME_RPC_POLLING_INTERVAL }}
|
||||
|
||||
## Foreign contract
|
||||
FOREIGN_RPC_URL={{ FOREIGN_RPC_URL }}
|
||||
FOREIGN_BRIDGE_ADDRESS={{ FOREIGN_BRIDGE_ADDRESS }}
|
||||
ERC20_TOKEN_ADDRESS={{ ERC20_TOKEN_ADDRESS }}
|
||||
FOREIGN_POLLING_INTERVAL={{ FOREIGN_POLLING_INTERVAL }}
|
||||
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }}
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }}
|
||||
ORACLE_FOREIGN_RPC_POLLING_INTERVAL={{ ORACLE_FOREIGN_RPC_POLLING_INTERVAL }}
|
||||
|
||||
## Gasprice
|
||||
{% if HOME_GAS_PRICE_ORACLE_URL | default('') != '' %}
|
||||
HOME_GAS_PRICE_ORACLE_URL={{ HOME_GAS_PRICE_ORACLE_URL }}
|
||||
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }}
|
||||
{% endif %}
|
||||
{% if HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
|
||||
{% if COMMON_HOME_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }}
|
||||
{% endif %}
|
||||
HOME_GAS_PRICE_FALLBACK={{ HOME_GAS_PRICE_FALLBACK }}
|
||||
{% if HOME_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||
HOME_GAS_PRICE_UPDATE_INTERVAL={{ HOME_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }}
|
||||
{% if ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||
ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_HOME_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
{% endif %}
|
||||
{% if HOME_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
HOME_GAS_PRICE_FACTOR={{ HOME_GAS_PRICE_FACTOR }}
|
||||
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }}
|
||||
{% endif %}
|
||||
|
||||
{% if FOREIGN_GAS_PRICE_ORACLE_URL | default('') != '' %}
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL={{ FOREIGN_GAS_PRICE_ORACLE_URL }}
|
||||
{% if COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }}
|
||||
{% endif %}
|
||||
{% if FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE={{ FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||
{% if COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE | default('') != '' %}
|
||||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||
{% endif %}
|
||||
FOREIGN_GAS_PRICE_FALLBACK={{ FOREIGN_GAS_PRICE_FALLBACK }}
|
||||
{% if FOREIGN_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||
FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }}
|
||||
{% if ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL | default('') != '' %}
|
||||
ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ ORACLE_FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
{% endif %}
|
||||
{% if FOREIGN_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
FOREIGN_GAS_PRICE_FACTOR={{ FOREIGN_GAS_PRICE_FACTOR }}
|
||||
{% if COMMON_FOREIGN_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }}
|
||||
{% endif %}
|
||||
|
||||
## Transport configuration
|
||||
ALLOW_HTTP={{ "yes" if ALLOW_HTTP else "no" }}
|
||||
QUEUE_URL={{ QUEUE_URL }}
|
||||
REDIS_URL={{ REDIS_URL }}
|
||||
ORACLE_ALLOW_HTTP_FOR_RPC={{ "yes" if ORACLE_ALLOW_HTTP_FOR_RPC else "no" }}
|
||||
ORACLE_QUEUE_URL={{ ORACLE_QUEUE_URL }}
|
||||
ORACLE_REDIS_URL={{ ORACLE_REDIS_URL }}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
## Validator-specific options
|
||||
VALIDATOR_ADDRESS={{ VALIDATOR_ADDRESS }}
|
||||
VALIDATOR_ADDRESS_PRIVATE_KEY={{ VALIDATOR_ADDRESS_PRIVATE_KEY }}
|
||||
ORACLE_VALIDATOR_ADDRESS={{ ORACLE_VALIDATOR_ADDRESS }}
|
||||
ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY={{ ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY }}
|
||||
|
||||
@@ -14,8 +14,9 @@ WORKDIR="{{ '/home/' + compose_service_user | default('poadocker') + '/' + bridg
|
||||
|
||||
#Getting path to private key file and variable name for parsing key file
|
||||
keyfile="{{ keyfile_path }}"
|
||||
vaddr="VALIDATOR_ADDRESS="
|
||||
vkey="VALIDATOR_ADDRESS_PRIVATE_KEY="
|
||||
vaddr="ORACLE_VALIDATOR_ADDRESS="
|
||||
vkey="ORACLE_VALIDATOR_ADDRESS_PRIVATE_KEY="
|
||||
composefileoverride="{{ composefileoverride | default('') }}"
|
||||
|
||||
#Parsing file content and add key to variable
|
||||
while read -r line
|
||||
@@ -33,30 +34,30 @@ done < $keyfile
|
||||
start(){
|
||||
echo "Starting 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
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride down -v
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride 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
|
||||
}
|
||||
|
||||
stop(){
|
||||
echo "Stopping 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 $composefileoverride down -v
|
||||
sleep 2
|
||||
}
|
||||
|
||||
status(){
|
||||
echo "Bridge status:"
|
||||
cd $WORKDIR
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose ps
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride 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
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride down -v
|
||||
sudo -u "{{ compose_service_user }}" /usr/local/bin/docker-compose $composefileoverride 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 --force-recreate --no-deps --build
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,38 +1,42 @@
|
||||
REACT_APP_HOME_BRIDGE_ADDRESS={{ HOME_BRIDGE_ADDRESS }}
|
||||
REACT_APP_FOREIGN_BRIDGE_ADDRESS={{ FOREIGN_BRIDGE_ADDRESS }}
|
||||
REACT_APP_FOREIGN_HTTP_PARITY_URL={{ FOREIGN_RPC_URL }}
|
||||
REACT_APP_HOME_HTTP_PARITY_URL={{ HOME_RPC_URL }}
|
||||
COMMON_HOME_BRIDGE_ADDRESS={{ COMMON_HOME_BRIDGE_ADDRESS }}
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS={{ COMMON_FOREIGN_BRIDGE_ADDRESS }}
|
||||
COMMON_FOREIGN_RPC_URL={{ COMMON_FOREIGN_RPC_URL }}
|
||||
COMMON_HOME_RPC_URL={{ COMMON_HOME_RPC_URL }}
|
||||
|
||||
REACT_APP_HOME_NATIVE_NAME={{ HOME_NATIVE_NAME }}
|
||||
UI_NATIVE_TOKEN_DISPLAY_NAME={{ UI_NATIVE_TOKEN_DISPLAY_NAME }}
|
||||
|
||||
REACT_APP_HOME_NETWORK_NAME={{ HOME_NAME }}
|
||||
REACT_APP_FOREIGN_NETWORK_NAME={{ FOREIGN_NAME }}
|
||||
UI_HOME_NETWORK_DISPLAY_NAME={{ UI_HOME_NETWORK_DISPLAY_NAME }}
|
||||
UI_FOREIGN_NETWORK_DISPLAY_NAME={{ UI_FOREIGN_NETWORK_DISPLAY_NAME }}
|
||||
|
||||
REACT_APP_HOME_WITHOUT_EVENTS={{ HOME_WITHOUT_EVENTS }}
|
||||
REACT_APP_FOREIGN_WITHOUT_EVENTS={{ FOREIGN_WITHOUT_EVENTS }}
|
||||
UI_HOME_WITHOUT_EVENTS={{ UI_HOME_WITHOUT_EVENTS }}
|
||||
UI_FOREIGN_WITHOUT_EVENTS={{ UI_FOREIGN_WITHOUT_EVENTS }}
|
||||
|
||||
REACT_APP_HOME_EXPLORER_TX_TEMPLATE={{ UI_HOME_EXPLORER_TX_TEMPLATE }}
|
||||
REACT_APP_FOREIGN_EXPLORER_TX_TEMPLATE={{ UI_FOREIGN_EXPLORER_TX_TEMPLATE }}
|
||||
REACT_APP_HOME_EXPLORER_ADDRESS_TEMPLATE={{ UI_HOME_EXPLORER_ADDRESS_TEMPLATE }}
|
||||
REACT_APP_FOREIGN_EXPLORER_ADDRESS_TEMPLATE={{ UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE }}
|
||||
UI_HOME_EXPLORER_TX_TEMPLATE={{ UI_HOME_EXPLORER_TX_TEMPLATE }}
|
||||
UI_FOREIGN_EXPLORER_TX_TEMPLATE={{ UI_FOREIGN_EXPLORER_TX_TEMPLATE }}
|
||||
UI_HOME_EXPLORER_ADDRESS_TEMPLATE={{ UI_HOME_EXPLORER_ADDRESS_TEMPLATE }}
|
||||
UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE={{ UI_FOREIGN_EXPLORER_ADDRESS_TEMPLATE }}
|
||||
|
||||
{% if HOME_GAS_PRICE_ORACLE_URL | default('') != '' %}
|
||||
REACT_APP_HOME_GAS_PRICE_ORACLE_URL={{ HOME_GAS_PRICE_ORACLE_URL }}
|
||||
REACT_APP_HOME_GAS_PRICE_SPEED_TYPE={{ HOME_GAS_PRICE_SPEED_TYPE }}
|
||||
{% if COMMON_HOME_GAS_PRICE_SUPPLIER_URL | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_SUPPLIER_URL={{ COMMON_HOME_GAS_PRICE_SUPPLIER_URL }}
|
||||
COMMON_HOME_GAS_PRICE_SPEED_TYPE={{ COMMON_HOME_GAS_PRICE_SPEED_TYPE }}
|
||||
{% endif %}
|
||||
REACT_APP_HOME_GAS_PRICE_FALLBACK={{ UI_HOME_GAS_PRICE_FALLBACK }}
|
||||
REACT_APP_HOME_GAS_PRICE_UPDATE_INTERVAL={{ HOME_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
{% if HOME_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
REACT_APP_HOME_GAS_PRICE_FACTOR={{ HOME_GAS_PRICE_FACTOR }}
|
||||
COMMON_HOME_GAS_PRICE_FALLBACK={{ COMMON_HOME_GAS_PRICE_FALLBACK }}
|
||||
UI_HOME_GAS_PRICE_UPDATE_INTERVAL={{ UI_HOME_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
{% if COMMON_HOME_GAS_PRICE_FACTOR | default('') != '' %}
|
||||
COMMON_HOME_GAS_PRICE_FACTOR={{ COMMON_HOME_GAS_PRICE_FACTOR }}
|
||||
{% endif %}
|
||||
|
||||
REACT_APP_FOREIGN_GAS_PRICE_ORACLE_URL={{ FOREIGN_GAS_PRICE_ORACLE_URL }}
|
||||
REACT_APP_FOREIGN_GAS_PRICE_SPEED_TYPE={{ FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||
REACT_APP_FOREIGN_GAS_PRICE_FALLBACK={{ UI_FOREIGN_GAS_PRICE_FALLBACK }}
|
||||
REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
REACT_APP_FOREIGN_GAS_PRICE_FACTOR={{ FOREIGN_GAS_PRICE_FACTOR }}
|
||||
COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL={{ COMMON_FOREIGN_GAS_PRICE_SUPPLIER_URL }}
|
||||
COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE={{ COMMON_FOREIGN_GAS_PRICE_SPEED_TYPE }}
|
||||
COMMON_FOREIGN_GAS_PRICE_FALLBACK={{ COMMON_FOREIGN_GAS_PRICE_FALLBACK }}
|
||||
UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL={{ UI_FOREIGN_GAS_PRICE_UPDATE_INTERVAL }}
|
||||
COMMON_FOREIGN_GAS_PRICE_FACTOR={{ COMMON_FOREIGN_GAS_PRICE_FACTOR }}
|
||||
|
||||
# Default
|
||||
REACT_APP_TITLE={{ UI_TITLE }}
|
||||
REACT_APP_DESCRIPTION={{ UI_DESCRIPTION }}
|
||||
PORT={{ UI_PORT }}
|
||||
UI_TITLE={{ UI_TITLE }}
|
||||
UI_DESCRIPTION={{ UI_DESCRIPTION }}
|
||||
UI_PORT={{ UI_PORT }}
|
||||
|
||||
{% if UI_STYLES | default('') != '' %}
|
||||
UI_STYLES={{ UI_STYLES }}
|
||||
{% endif %}
|
||||
|
||||
18
e2e-commons/components-envs/monitor-erc20-native.env
Normal file
18
e2e-commons/components-envs/monitor-erc20-native.env
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
18
e2e-commons/components-envs/monitor-erc20.env
Normal file
18
e2e-commons/components-envs/monitor-erc20.env
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
18
e2e-commons/components-envs/monitor.env
Normal file
18
e2e-commons/components-envs/monitor.env
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
23
e2e-commons/components-envs/oracle-amb.env
Normal file
23
e2e-commons/components-envs/oracle-amb.env
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
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
|
||||
23
e2e-commons/components-envs/oracle-erc20-native.env
Normal file
23
e2e-commons/components-envs/oracle-erc20-native.env
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
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
|
||||
23
e2e-commons/components-envs/oracle-erc20.env
Normal file
23
e2e-commons/components-envs/oracle-erc20.env
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
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
|
||||
23
e2e-commons/components-envs/oracle.env
Normal file
23
e2e-commons/components-envs/oracle.env
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
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
|
||||
22
e2e-commons/components-envs/ui-erc20-native.env
Normal file
22
e2e-commons/components-envs/ui-erc20-native.env
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
22
e2e-commons/components-envs/ui-erc20.env
Normal file
22
e2e-commons/components-envs/ui-erc20.env
Normal file
@@ -0,0 +1,22 @@
|
||||
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
|
||||
22
e2e-commons/components-envs/ui.env
Normal file
22
e2e-commons/components-envs/ui.env
Normal file
@@ -0,0 +1,22 @@
|
||||
COMMON_HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
|
||||
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
|
||||
@@ -19,20 +19,29 @@
|
||||
"home": "0x32198D570fffC7033641F8A9094FFDCaAEF42624",
|
||||
"foreign": "0x2B6871b9B02F73fa24F4864322CdC78604207769",
|
||||
"foreignToken": "0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B",
|
||||
"ui": "http://localhost:3000"
|
||||
"ui": "http://localhost:3000",
|
||||
"monitor": "http://monitor:3010"
|
||||
},
|
||||
"ercToErcBridge": {
|
||||
"home": "0x1feB40aD9420b186F019A717c37f5546165d411E",
|
||||
"foreign": "0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127",
|
||||
"homeToken": "0x792455a6bCb62Ed4C4362D323E0590654CA4765c",
|
||||
"foreignToken": "0x3C665A31199694Bf723fD08844AD290207B5797f",
|
||||
"ui": "http://localhost:3001"
|
||||
"ui": "http://localhost:3001",
|
||||
"monitor": "http://monitor-erc20:3011"
|
||||
},
|
||||
"ercToNativeBridge": {
|
||||
"home": "0x488Af810997eD1730cB3a3918cD83b3216E6eAda",
|
||||
"foreign": "0x488Af810997eD1730cB3a3918cD83b3216E6eAda",
|
||||
"foreignToken": "0x3C665A31199694Bf723fD08844AD290207B5797f",
|
||||
"ui": "http://localhost:3002"
|
||||
"ui": "http://localhost:3002",
|
||||
"monitor": "http://monitor-erc20-native:3012"
|
||||
},
|
||||
"amb": {
|
||||
"home": "0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0",
|
||||
"foreign": "0x0AEe1FCD12dDFab6265F7f8956e6E012A9Fe4Aa0",
|
||||
"homeBox": "0x6C4EaAb8756d53Bf599FFe2347FAFF1123D6C8A1",
|
||||
"foreignBox": "0x6C4EaAb8756d53Bf599FFe2347FAFF1123D6C8A1"
|
||||
},
|
||||
"homeRPC": {
|
||||
"URL": "http://parity1:8545",
|
||||
|
||||
25
e2e-commons/contracts-envs/amb.env
Normal file
25
e2e-commons/contracts-envs/amb.env
Normal file
@@ -0,0 +1,25 @@
|
||||
BRIDGE_MODE=ARBITRARY_MESSAGE
|
||||
DEPLOYMENT_ACCOUNT_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
|
||||
HOME_DEPLOYMENT_GAS_PRICE=10000000000
|
||||
FOREIGN_DEPLOYMENT_GAS_PRICE=10000000000
|
||||
GET_RECEIPT_INTERVAL_IN_MILLISECONDS=50
|
||||
DEPLOYMENT_GAS_LIMIT_EXTRA=0.2
|
||||
|
||||
HOME_RPC_URL=http://parity1:8545
|
||||
HOME_BRIDGE_OWNER=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
HOME_VALIDATORS_OWNER=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
HOME_UPGRADEABLE_ADMIN=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
HOME_MAX_AMOUNT_PER_TX=8000000
|
||||
HOME_REQUIRED_BLOCK_CONFIRMATIONS=1
|
||||
HOME_GAS_PRICE=1000000000
|
||||
|
||||
FOREIGN_RPC_URL=http://parity2:8545
|
||||
FOREIGN_BRIDGE_OWNER=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
FOREIGN_VALIDATORS_OWNER=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
FOREIGN_UPGRADEABLE_ADMIN=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
FOREIGN_MAX_AMOUNT_PER_TX=8000000
|
||||
FOREIGN_REQUIRED_BLOCK_CONFIRMATIONS=1
|
||||
FOREIGN_GAS_PRICE=10000000000
|
||||
|
||||
REQUIRED_NUMBER_OF_VALIDATORS=1
|
||||
VALIDATORS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
@@ -32,31 +32,10 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: oracle/Dockerfile
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/oracle.env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- BRIDGE_MODE=NATIVE_TO_ERC
|
||||
- QUEUE_URL=amqp://rabbit
|
||||
- REDIS_URL=redis://redis
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
|
||||
- ERC20_TOKEN_ADDRESS=0xdbeE25CbE97e4A5CC6c499875774dc7067E9426B
|
||||
- VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
- VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1
|
||||
- HOME_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1
|
||||
- FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=0.1
|
||||
- HOME_POLLING_INTERVAL=500
|
||||
- FOREIGN_POLLING_INTERVAL=500
|
||||
- ALLOW_HTTP=yes
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -64,32 +43,10 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: oracle/Dockerfile
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/oracle-erc20.env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- BRIDGE_MODE=ERC_TO_ERC
|
||||
- QUEUE_URL=amqp://rabbit
|
||||
- REDIS_URL=redis://redis
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
|
||||
- ERC20_TOKEN_ADDRESS=0x3C665A31199694Bf723fD08844AD290207B5797f
|
||||
- BRIDGEABLE_TOKEN_ADDRESS=0x792455a6bCb62Ed4C4362D323E0590654CA4765c
|
||||
- VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
- VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1
|
||||
- HOME_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1
|
||||
- FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=0.1
|
||||
- HOME_POLLING_INTERVAL=500
|
||||
- FOREIGN_POLLING_INTERVAL=500
|
||||
- ALLOW_HTTP=yes
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -97,32 +54,21 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: oracle/Dockerfile
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/oracle-erc20-native.env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
oracle-amb:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: oracle/Dockerfile
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/oracle-amb.env
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- BRIDGE_MODE=ERC_TO_NATIVE
|
||||
- QUEUE_URL=amqp://rabbit
|
||||
- REDIS_URL=redis://redis
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- ERC20_TOKEN_ADDRESS=0x3C665A31199694Bf723fD08844AD290207B5797f
|
||||
- BRIDGEABLE_TOKEN_ADDRESS=0x792455a6bCb62Ed4C4362D323E0590654CA4765c
|
||||
- VALIDATOR_ADDRESS=0xaaB52d66283F7A1D5978bcFcB55721ACB467384b
|
||||
- VALIDATOR_ADDRESS_PRIVATE_KEY=8e829f695aed89a154550f30262f1529582cc49dc30eff74a6b491359e0230f9
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1
|
||||
- HOME_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1
|
||||
- FOREIGN_GAS_PRICE_UPDATE_INTERVAL=600000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=0.1
|
||||
- HOME_POLLING_INTERVAL=500
|
||||
- FOREIGN_POLLING_INTERVAL=500
|
||||
- ALLOW_HTTP=yes
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -130,29 +76,8 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ui/Dockerfile
|
||||
environment:
|
||||
- REACT_APP_HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
|
||||
- REACT_APP_FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
|
||||
- REACT_APP_FOREIGN_HTTP_PARITY_URL=http://localhost:8542
|
||||
- REACT_APP_HOME_HTTP_PARITY_URL=http://localhost:8541
|
||||
- REACT_APP_HOME_NATIVE_NAME=POA
|
||||
- REACT_APP_HOME_NETWORK_NAME=Sokol
|
||||
- REACT_APP_FOREIGN_NETWORK_NAME=Kovan
|
||||
- REACT_APP_HOME_EXPLORER_TX_TEMPLATE=https://blockscout.com/poa/sokol/tx//%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_TX_TEMPLATE=https://blockscout.com/eth/kovan/tx/%s
|
||||
- REACT_APP_HOME_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/poa/sokol/address/%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/eth/kovan/address/%s
|
||||
- REACT_APP_HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_HOME_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_HOME_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_HOME_GAS_PRICE_FACTOR=1
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- PORT=3000
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/ui.env
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -160,29 +85,8 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ui/Dockerfile
|
||||
environment:
|
||||
- REACT_APP_HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
|
||||
- REACT_APP_FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
|
||||
- REACT_APP_FOREIGN_HTTP_PARITY_URL=http://localhost:8542
|
||||
- REACT_APP_HOME_HTTP_PARITY_URL=http://localhost:8541
|
||||
- REACT_APP_HOME_NATIVE_NAME=POA
|
||||
- REACT_APP_HOME_NETWORK_NAME=Sokol
|
||||
- REACT_APP_FOREIGN_NETWORK_NAME=Kovan
|
||||
- REACT_APP_HOME_EXPLORER_TX_TEMPLATE=https://blockscout.com/poa/sokol/tx//%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_TX_TEMPLATE=https://blockscout.com/eth/kovan/tx/%s
|
||||
- REACT_APP_HOME_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/poa/sokol/address/%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/eth/kovan/address/%s
|
||||
- REACT_APP_HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_HOME_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_HOME_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_HOME_GAS_PRICE_FACTOR=1
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- PORT=3000
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/ui-erc20.env
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -190,29 +94,8 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: ui/Dockerfile
|
||||
environment:
|
||||
- REACT_APP_HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- REACT_APP_FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- REACT_APP_FOREIGN_HTTP_PARITY_URL=http://localhost:8542
|
||||
- REACT_APP_HOME_HTTP_PARITY_URL=http://localhost:8541
|
||||
- REACT_APP_HOME_NATIVE_NAME=POA
|
||||
- REACT_APP_HOME_NETWORK_NAME=Sokol
|
||||
- REACT_APP_FOREIGN_NETWORK_NAME=Kovan
|
||||
- REACT_APP_HOME_EXPLORER_TX_TEMPLATE=https://blockscout.com/poa/sokol/tx//%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_TX_TEMPLATE=https://blockscout.com/eth/kovan/tx/%s
|
||||
- REACT_APP_HOME_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/poa/sokol/address/%s
|
||||
- REACT_APP_FOREIGN_EXPLORER_ADDRESS_TEMPLATE=https://blockscout.com/eth/kovan/address/%s
|
||||
- REACT_APP_HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_HOME_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_HOME_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_HOME_GAS_PRICE_FACTOR=1
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FALLBACK=5000000000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_UPDATE_INTERVAL=15000
|
||||
- REACT_APP_FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- PORT=3000
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/ui-erc20-native.env
|
||||
command: "true"
|
||||
networks:
|
||||
- ultimate
|
||||
@@ -220,26 +103,9 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: monitor/Dockerfile
|
||||
environment:
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x32198D570fffC7033641F8A9094FFDCaAEF42624
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x2B6871b9B02F73fa24F4864322CdC78604207769
|
||||
- HOME_DEPLOYMENT_BLOCK=0
|
||||
- FOREIGN_DEPLOYMENT_BLOCK=0
|
||||
- HOME_GAS_LIMIT=300000
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1000000000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_LIMIT=300000
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1000000000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- LEFT_TX_THRESHOLD=100
|
||||
- PORT=3010
|
||||
entrypoint: yarn start
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/monitor.env
|
||||
entrypoint: yarn check-and-start
|
||||
ports:
|
||||
- "3010:3010"
|
||||
networks:
|
||||
@@ -248,26 +114,9 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: monitor/Dockerfile
|
||||
environment:
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x1feB40aD9420b186F019A717c37f5546165d411E
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x4a58D6d8D416a5fBCAcf3dC52eb8bE8948E25127
|
||||
- HOME_DEPLOYMENT_BLOCK=0
|
||||
- FOREIGN_DEPLOYMENT_BLOCK=0
|
||||
- HOME_GAS_LIMIT=300000
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1000000000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_LIMIT=300000
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1000000000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- LEFT_TX_THRESHOLD=100
|
||||
- PORT=3011
|
||||
entrypoint: yarn start
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/monitor-erc20.env
|
||||
entrypoint: yarn check-and-start
|
||||
ports:
|
||||
- "3011:3011"
|
||||
networks:
|
||||
@@ -276,26 +125,9 @@ services:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: monitor/Dockerfile
|
||||
environment:
|
||||
- HOME_RPC_URL=http://parity1:8545
|
||||
- FOREIGN_RPC_URL=http://parity2:8545
|
||||
- HOME_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- FOREIGN_BRIDGE_ADDRESS=0x488Af810997eD1730cB3a3918cD83b3216E6eAda
|
||||
- HOME_DEPLOYMENT_BLOCK=0
|
||||
- FOREIGN_DEPLOYMENT_BLOCK=0
|
||||
- HOME_GAS_LIMIT=300000
|
||||
- HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
- HOME_GAS_PRICE_FALLBACK=1000000000
|
||||
- HOME_GAS_PRICE_FACTOR=1
|
||||
- FOREIGN_GAS_LIMIT=300000
|
||||
- FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
- FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
- FOREIGN_GAS_PRICE_FALLBACK=1000000000
|
||||
- FOREIGN_GAS_PRICE_FACTOR=1
|
||||
- LEFT_TX_THRESHOLD=100
|
||||
- PORT=3012
|
||||
entrypoint: yarn start
|
||||
args:
|
||||
DOT_ENV_PATH: e2e-commons/components-envs/monitor-erc20-native.env
|
||||
entrypoint: yarn check-and-start
|
||||
ports:
|
||||
- "3012:3012"
|
||||
networks:
|
||||
|
||||
@@ -4,7 +4,7 @@ set -e # exit when any command fails
|
||||
|
||||
CONTRACTS_PATH="../../contracts"
|
||||
DEPLOY_PATH="$CONTRACTS_PATH/deploy"
|
||||
ENVS_PATH="../envs"
|
||||
ENVS_PATH="../contracts-envs"
|
||||
|
||||
echo -e "\n\n############ Deploying native-to-erc ############\n"
|
||||
cp "$ENVS_PATH/native-to-erc.env" "$DEPLOY_PATH/.env"
|
||||
@@ -29,3 +29,14 @@ cp "$ENVS_PATH/erc-to-native.env" "$DEPLOY_PATH/.env"
|
||||
cd "$DEPLOY_PATH"
|
||||
node deploy.js
|
||||
cd - > /dev/null
|
||||
|
||||
echo -e "\n\n############ Deploying amb ############\n"
|
||||
cp "$ENVS_PATH/amb.env" "$DEPLOY_PATH/.env"
|
||||
cd "$DEPLOY_PATH"
|
||||
node deploy.js
|
||||
cd - > /dev/null
|
||||
|
||||
echo -e "\n\n############ Deploying test contract for amb ############\n"
|
||||
cd "$DEPLOY_PATH"
|
||||
node src/utils/deployTestBox.js
|
||||
cd - > /dev/null
|
||||
|
||||
@@ -9,7 +9,7 @@ docker-compose up -d parity1 parity2 e2e
|
||||
|
||||
while [ "$1" != "" ]; do
|
||||
if [ "$1" == "oracle" ]; then
|
||||
docker-compose up -d redis rabbit oracle oracle-erc20 oracle-erc20-native
|
||||
docker-compose up -d redis rabbit oracle oracle-erc20 oracle-erc20-native oracle-amb
|
||||
|
||||
docker-compose run -d oracle yarn watcher:signature-request
|
||||
docker-compose run -d oracle yarn watcher:collected-signatures
|
||||
@@ -17,9 +17,14 @@ while [ "$1" != "" ]; do
|
||||
docker-compose run -d oracle-erc20 yarn watcher:signature-request
|
||||
docker-compose run -d oracle-erc20 yarn watcher:collected-signatures
|
||||
docker-compose run -d oracle-erc20 yarn watcher:affirmation-request
|
||||
docker-compose run -d oracle-erc20 yarn watcher:transfer
|
||||
docker-compose run -d oracle-erc20-native yarn watcher:signature-request
|
||||
docker-compose run -d oracle-erc20-native yarn watcher:collected-signatures
|
||||
docker-compose run -d oracle-erc20-native yarn watcher:affirmation-request
|
||||
docker-compose run -d oracle-erc20-native yarn watcher:transfer
|
||||
docker-compose run -d oracle-amb yarn watcher:signature-request
|
||||
docker-compose run -d oracle-amb yarn watcher:collected-signatures
|
||||
docker-compose run -d oracle-amb yarn watcher:affirmation-request
|
||||
docker-compose run -d oracle yarn sender:home
|
||||
docker-compose run -d oracle yarn sender:foreign
|
||||
fi
|
||||
@@ -45,15 +50,15 @@ while [ "$1" != "" ]; do
|
||||
fi
|
||||
|
||||
if [ "$1" == "native-to-erc" ]; then
|
||||
../deployment/molecule/molecule.sh ultimate-native-to-erc
|
||||
../deployment-e2e/molecule.sh ultimate-native-to-erc
|
||||
fi
|
||||
|
||||
if [ "$1" == "erc-to-native" ]; then
|
||||
../deployment/molecule/molecule.sh ultimate-erc-to-native
|
||||
../deployment-e2e/molecule.sh ultimate-erc-to-native
|
||||
fi
|
||||
|
||||
if [ "$1" == "erc-to-erc" ]; then
|
||||
../deployment/molecule/molecule.sh ultimate-erc-to-erc
|
||||
../deployment-e2e/molecule.sh ultimate-erc-to-erc
|
||||
fi
|
||||
|
||||
shift # Shift all the parameters down by one
|
||||
|
||||
16
monitor-e2e/.eslintrc
Normal file
16
monitor-e2e/.eslintrc
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"extends": [
|
||||
"plugin:node/recommended",
|
||||
"airbnb-base",
|
||||
"../.eslintrc"
|
||||
],
|
||||
"plugins": ["node"],
|
||||
"rules": {
|
||||
"node/no-unpublished-require": "off",
|
||||
"node/no-extraneous-require": "off",
|
||||
"import/no-extraneous-dependencies": "off"
|
||||
},
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
set -e # exit when any command fails
|
||||
|
||||
echo "MONITOR E2E - ERC TO ERC"
|
||||
export URL=localhost:3011
|
||||
|
||||
echo "Test case - Web Interface should return balances"
|
||||
OUTPUT=$(curl -s http://$URL/)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return validators"
|
||||
OUTPUT=$(curl -s http://$URL/validators)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return eventsStats"
|
||||
OUTPUT=$(curl -s http://$URL/eventsStats)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return alerts"
|
||||
OUTPUT=$(curl -s http://$URL/alerts)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
@@ -1,26 +0,0 @@
|
||||
set -e # exit when any command fails
|
||||
|
||||
echo "MONITOR E2E - ERC TO NATIVE"
|
||||
export URL=localhost:3012
|
||||
|
||||
echo "Test case - Web Interface should return balances"
|
||||
OUTPUT=$(curl -s http://$URL/)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return validators"
|
||||
OUTPUT=$(curl -s http://$URL/validators)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return eventsStats"
|
||||
OUTPUT=$(curl -s http://$URL/eventsStats)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return alerts"
|
||||
OUTPUT=$(curl -s http://$URL/alerts)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
@@ -1,26 +0,0 @@
|
||||
set -e # exit when any command fails
|
||||
|
||||
echo "MONITOR E2E - NATIVE TO ERC"
|
||||
export URL="localhost:3010"
|
||||
|
||||
echo "Test case - Web Interface should return balances"
|
||||
OUTPUT=$(curl -s http://$URL/)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return validators"
|
||||
OUTPUT=$(curl -s http://$URL/validators)
|
||||
grep -q home <<< "$OUTPUT"
|
||||
grep -q foreign <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return eventsStats"
|
||||
OUTPUT=$(curl -s http://$URL/eventsStats)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
|
||||
echo "Test case - Web Interface should return alerts"
|
||||
OUTPUT=$(curl -s http://$URL/alerts)
|
||||
grep -q lastChecked <<< "$OUTPUT"
|
||||
(! grep -q error <<< "$OUTPUT")
|
||||
19
monitor-e2e/package.json
Normal file
19
monitor-e2e/package.json
Normal file
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"name": "monitor-e2e",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"start": "mocha --timeout 30000",
|
||||
"lint": "eslint . --ignore-path ../.eslintignore"
|
||||
},
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"dependencies": {},
|
||||
"engines": {
|
||||
"node": ">= 8.9"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "0.19.0"
|
||||
}
|
||||
}
|
||||
6
monitor-e2e/periodically-check-all.sh
Executable file
6
monitor-e2e/periodically-check-all.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
while true; do
|
||||
sleep 3
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor yarn check-all
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 yarn check-all
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native yarn check-all
|
||||
done
|
||||
@@ -1,51 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
cd $(dirname $0)
|
||||
set -e # exit when any command fails
|
||||
|
||||
../e2e-commons/up.sh deploy monitor
|
||||
|
||||
##### Helper Functions #####
|
||||
./wait-for-monitor.sh
|
||||
nohup ./periodically-check-all.sh < /dev/null > /dev/null 2>&1 &
|
||||
checkPID=$!
|
||||
|
||||
function cleanup {
|
||||
../e2e-commons/down.sh
|
||||
}
|
||||
trap cleanup EXIT
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml run e2e yarn workspace monitor-e2e run start
|
||||
rc=$?
|
||||
|
||||
FILES=(getBalances.json validators.json eventsStats.json alerts.json)
|
||||
|
||||
check_files_exist() {
|
||||
rc=0
|
||||
for f in "${FILES[@]}"; do
|
||||
command="test -f responses/$f"
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "$command") || rc=1
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "$command") || rc=1
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "$command") || rc=1
|
||||
done
|
||||
return $rc
|
||||
}
|
||||
|
||||
|
||||
##### Initialization #####
|
||||
|
||||
../e2e-commons/up.sh deploy oracle monitor
|
||||
|
||||
|
||||
##### Initial checks #####
|
||||
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "yarn check-all"
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "yarn check-all"
|
||||
docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "yarn check-all"
|
||||
check_files_exist
|
||||
|
||||
|
||||
##### Test cases #####
|
||||
|
||||
./native-to-erc.sh
|
||||
|
||||
./erc-to-erc.sh
|
||||
|
||||
./erc-to-native.sh
|
||||
|
||||
|
||||
##### Cleanup #####
|
||||
|
||||
cleanup
|
||||
../e2e-commons/down.sh
|
||||
kill $checkPID
|
||||
exit $rc
|
||||
|
||||
99
monitor-e2e/test/common.js
Normal file
99
monitor-e2e/test/common.js
Normal file
@@ -0,0 +1,99 @@
|
||||
const assert = require('assert')
|
||||
const axios = require('axios')
|
||||
const { nativeToErcBridge, ercToErcBridge, ercToNativeBridge, validator } = require('../../e2e-commons/constants.json')
|
||||
|
||||
const types = [
|
||||
{ description: 'NATIVE TO ERC', baseUrl: nativeToErcBridge.monitor },
|
||||
{ description: 'ERC TO ERC', baseUrl: ercToErcBridge.monitor },
|
||||
{ description: 'ERC TO NATIVE', baseUrl: ercToNativeBridge.monitor }
|
||||
]
|
||||
|
||||
types.forEach(type => {
|
||||
describe(type.description, () => {
|
||||
describe('balances', async () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${type.baseUrl}`))
|
||||
})
|
||||
|
||||
describe('home', async () => {
|
||||
it('should contain deposits:', () => assert(data.home.deposits === 0))
|
||||
it('should contain withdrawals', () => assert(data.home.withdrawals === 0))
|
||||
})
|
||||
|
||||
describe('foreign', async () => {
|
||||
it('should contain deposits:', () => assert(data.foreign.deposits === 0))
|
||||
it('should contain withdrawals', () => assert(data.foreign.withdrawals === 0))
|
||||
})
|
||||
|
||||
describe('general', async () => {
|
||||
it('should contain balanceDiff', () => assert(data.balanceDiff === 0))
|
||||
it('should contain depositsDiff', () => assert(data.depositsDiff === 0))
|
||||
it('should contain withdrawalDiff', () => assert(data.withdrawalDiff === 0))
|
||||
it('should contain timeDiff', () => assert(data.timeDiff >= 0))
|
||||
it('should contain lastChecked', () => assert(data.lastChecked >= 0))
|
||||
})
|
||||
})
|
||||
|
||||
describe('validators', async () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${type.baseUrl}/validators`))
|
||||
})
|
||||
|
||||
it('home', () => {
|
||||
assert(typeof data.home.validators === 'object')
|
||||
assert(data.home.validators[validator.address].balance > 0)
|
||||
assert(data.home.validators[validator.address].leftTx > 0)
|
||||
assert(data.home.validators[validator.address].gasPrice > 0)
|
||||
})
|
||||
|
||||
it('foreign', () => {
|
||||
assert(typeof data.foreign.validators === 'object')
|
||||
assert(data.foreign.validators[validator.address].balance > 0)
|
||||
assert(data.foreign.validators[validator.address].leftTx > 0)
|
||||
assert(data.foreign.validators[validator.address].gasPrice > 0)
|
||||
})
|
||||
|
||||
it('requiredSignaturesMatch', () => assert(data.requiredSignaturesMatch, 1))
|
||||
it('validatorsMatch', () => assert(data.validatorsMatch))
|
||||
it('lastChecked', () => assert(data.lastChecked >= 0))
|
||||
it('timeDiff', () => assert(data.timeDiff >= 0))
|
||||
it('homeOk', () => assert(data.homeOk))
|
||||
it('foreignOk', () => assert(data.foreignOk))
|
||||
it('ok', () => assert(data.ok))
|
||||
})
|
||||
|
||||
describe('eventsStats', async () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${type.baseUrl}/eventsStats`))
|
||||
})
|
||||
|
||||
it('ok', () => assert(data.ok))
|
||||
it('lastChecked', () => assert(data.lastChecked >= 0))
|
||||
it('timeDiff', () => assert(data.timeDiff >= 0))
|
||||
it('onlyInHomeDeposits', () => assert(typeof data.onlyInHomeDeposits === 'object'))
|
||||
it('onlyInForeignDeposits', () => assert(typeof data.onlyInForeignDeposits === 'object'))
|
||||
it('onlyInHomeWithdrawals', () => assert(typeof data.onlyInHomeWithdrawals === 'object'))
|
||||
it('onlyInForeignWithdrawals', () => assert(typeof data.onlyInForeignWithdrawals === 'object'))
|
||||
})
|
||||
|
||||
describe('alerts', async () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${type.baseUrl}/alerts`))
|
||||
})
|
||||
|
||||
it('ok', () => assert(data.ok))
|
||||
it('lastChecked', () => assert(data.lastChecked >= 0))
|
||||
it('timeDiff', () => assert(data.timeDiff >= 0))
|
||||
it('executeSignatures', () => assert(typeof data.executeSignatures === 'object'))
|
||||
it('executeAffirmations', () => assert(typeof data.executeAffirmations === 'object'))
|
||||
})
|
||||
})
|
||||
})
|
||||
43
monitor-e2e/test/ercToErc.js
Normal file
43
monitor-e2e/test/ercToErc.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const assert = require('assert')
|
||||
const axios = require('axios')
|
||||
const { ercToErcBridge, user, foreignRPC, validator } = require('../../e2e-commons/constants.json')
|
||||
const { waitUntil, sendTokens, addValidator } = require('../utils')
|
||||
|
||||
const baseUrl = ercToErcBridge.monitor
|
||||
|
||||
describe('ERC TO ERC', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
})
|
||||
|
||||
it('balance', () => assert(parseInt(data.foreign.erc20Balance, 10) >= 0))
|
||||
it('should contain totalSupply', () => assert(data.home.totalSupply === '0'))
|
||||
})
|
||||
|
||||
describe('ERC TO ERC with changing state of contracts', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
assert((await axios.get(`${baseUrl}`)).data.balanceDiff === 0)
|
||||
assert((await axios.get(`${baseUrl}/validators`)).data.validatorsMatch === true)
|
||||
})
|
||||
|
||||
it('should change balanceDiff', async () => {
|
||||
await sendTokens(foreignRPC.URL, user, ercToErcBridge.foreignToken, ercToErcBridge.foreign)
|
||||
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
return data.balanceDiff !== 0
|
||||
})
|
||||
})
|
||||
|
||||
it('should change validatorsMatch', async () => {
|
||||
await addValidator(foreignRPC.URL, validator, ercToErcBridge.foreign)
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}/validators`))
|
||||
return data.validatorsMatch === false
|
||||
})
|
||||
})
|
||||
})
|
||||
43
monitor-e2e/test/ercToNative.js
Normal file
43
monitor-e2e/test/ercToNative.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const assert = require('assert')
|
||||
const axios = require('axios')
|
||||
const { ercToNativeBridge, user, foreignRPC, validator } = require('../../e2e-commons/constants.json')
|
||||
const { waitUntil, sendTokens, addValidator } = require('../utils')
|
||||
|
||||
const baseUrl = ercToNativeBridge.monitor
|
||||
|
||||
describe('ERC TO NATIVE', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
})
|
||||
|
||||
it('balance', () => assert(parseInt(data.foreign.erc20Balance, 10) >= 0))
|
||||
it('should contain totalSupply', () => assert(data.home.totalSupply === '0'))
|
||||
})
|
||||
|
||||
describe('ERC TO NATIVE with changing state of contracts', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
assert((await axios.get(`${baseUrl}`)).data.balanceDiff === 0)
|
||||
assert((await axios.get(`${baseUrl}/validators`)).data.validatorsMatch === true)
|
||||
})
|
||||
|
||||
it('should change balanceDiff', async () => {
|
||||
await sendTokens(foreignRPC.URL, user, ercToNativeBridge.foreignToken, ercToNativeBridge.foreign)
|
||||
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
return data.balanceDiff !== 0
|
||||
})
|
||||
})
|
||||
|
||||
it('should change validatorsMatch', async () => {
|
||||
await addValidator(foreignRPC.URL, validator, ercToNativeBridge.foreign)
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}/validators`))
|
||||
return data.validatorsMatch === false
|
||||
})
|
||||
})
|
||||
})
|
||||
43
monitor-e2e/test/nativeToErc.js
Normal file
43
monitor-e2e/test/nativeToErc.js
Normal file
@@ -0,0 +1,43 @@
|
||||
const assert = require('assert')
|
||||
const axios = require('axios')
|
||||
const { nativeToErcBridge, user, homeRPC, foreignRPC, validator } = require('../../e2e-commons/constants.json')
|
||||
const { waitUntil, sendEther, addValidator } = require('../utils')
|
||||
|
||||
const baseUrl = nativeToErcBridge.monitor
|
||||
|
||||
describe('NATIVE TO ERC', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
})
|
||||
|
||||
it('balance', () => assert(parseInt(data.home.balance, 10) >= 0))
|
||||
it('should contain totalSupply', () => assert(data.foreign.totalSupply === '0'))
|
||||
})
|
||||
|
||||
describe('NATIVE TO ERC with changing state of contracts', () => {
|
||||
let data
|
||||
|
||||
before(async () => {
|
||||
assert((await axios.get(`${baseUrl}`)).data.balanceDiff === 0)
|
||||
assert((await axios.get(`${baseUrl}/validators`)).data.validatorsMatch === true)
|
||||
})
|
||||
|
||||
it('should change balanceDiff', async () => {
|
||||
await sendEther(homeRPC.URL, user, nativeToErcBridge.home)
|
||||
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}`))
|
||||
return data.balanceDiff !== 0
|
||||
})
|
||||
})
|
||||
|
||||
it('should change validatorsMatch', async () => {
|
||||
await addValidator(foreignRPC.URL, validator, nativeToErcBridge.foreign)
|
||||
await waitUntil(async () => {
|
||||
;({ data } = await axios.get(`${baseUrl}/validators`))
|
||||
return data.validatorsMatch === false
|
||||
})
|
||||
})
|
||||
})
|
||||
57
monitor-e2e/utils.js
Normal file
57
monitor-e2e/utils.js
Normal file
@@ -0,0 +1,57 @@
|
||||
const Web3 = require('web3')
|
||||
const { ERC677_BRIDGE_TOKEN_ABI, BRIDGE_VALIDATORS_ABI, FOREIGN_NATIVE_TO_ERC_ABI } = require('../commons')
|
||||
|
||||
const waitUntil = async (predicate, step = 100, timeout = 10000) => {
|
||||
const stopTime = Date.now() + timeout
|
||||
while (Date.now() <= stopTime) {
|
||||
const result = await predicate()
|
||||
if (result) {
|
||||
return result
|
||||
}
|
||||
await new Promise(resolve => setTimeout(resolve, step)) // sleep
|
||||
}
|
||||
throw new Error(`waitUntil timed out after ${timeout} ms`)
|
||||
}
|
||||
|
||||
const sendEther = async (rpcUrl, account, to) => {
|
||||
const web3 = new Web3(new Web3.providers.HttpProvider(rpcUrl))
|
||||
web3.eth.accounts.wallet.add(account.privateKey)
|
||||
|
||||
await web3.eth.sendTransaction({
|
||||
from: account.address,
|
||||
to,
|
||||
gasPrice: '1',
|
||||
gas: '50000',
|
||||
value: '1000000000000000000'
|
||||
})
|
||||
}
|
||||
|
||||
const sendTokens = async (rpcUrl, account, tokenAddress, recipientAddress) => {
|
||||
const web3 = new Web3(new Web3.providers.HttpProvider(rpcUrl))
|
||||
web3.eth.accounts.wallet.add(account.privateKey)
|
||||
const erc20Token = new web3.eth.Contract(ERC677_BRIDGE_TOKEN_ABI, tokenAddress)
|
||||
|
||||
await erc20Token.methods.transfer(recipientAddress, web3.utils.toWei('0.01')).send({
|
||||
from: account.address,
|
||||
gas: '1000000'
|
||||
})
|
||||
}
|
||||
|
||||
const addValidator = async (rpcUrl, account, bridgeAddress) => {
|
||||
const web3 = new Web3(new Web3.providers.HttpProvider(rpcUrl))
|
||||
web3.eth.accounts.wallet.add(account.privateKey)
|
||||
const bridgeContract = new web3.eth.Contract(FOREIGN_NATIVE_TO_ERC_ABI, bridgeAddress)
|
||||
const foreignValidatorsAddress = await bridgeContract.methods.validatorContract().call()
|
||||
const foreignBridgeValidators = new web3.eth.Contract(BRIDGE_VALIDATORS_ABI, foreignValidatorsAddress)
|
||||
await foreignBridgeValidators.methods.addValidator('0xE71FBa5db00172bb0C93d649362B006300000935').send({
|
||||
from: account.address,
|
||||
gas: '5000000'
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
waitUntil,
|
||||
sendEther,
|
||||
sendTokens,
|
||||
addValidator
|
||||
}
|
||||
27
monitor-e2e/wait-for-monitor.sh
Executable file
27
monitor-e2e/wait-for-monitor.sh
Executable file
@@ -0,0 +1,27 @@
|
||||
FILES=(getBalances.json validators.json eventsStats.json alerts.json)
|
||||
|
||||
check_files_exist() {
|
||||
rc=0
|
||||
for f in "${FILES[@]}"; do
|
||||
command="test -f responses/$f"
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor /bin/bash -c "$command") || rc=1
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20 /bin/bash -c "$command") || rc=1
|
||||
(docker-compose -f ../e2e-commons/docker-compose.yml exec monitor-erc20-native /bin/bash -c "$command") || rc=1
|
||||
done
|
||||
return $rc
|
||||
}
|
||||
|
||||
i=0
|
||||
until check_files_exist
|
||||
do
|
||||
((i++))
|
||||
if [ "$i" -gt 30 ]
|
||||
then
|
||||
exit -1
|
||||
fi
|
||||
|
||||
echo "Waiting for monitor to start..."
|
||||
sleep 3
|
||||
done
|
||||
|
||||
echo "Monitor started"
|
||||
@@ -1,21 +1,21 @@
|
||||
HOME_RPC_URL=https://sokol.poa.network
|
||||
FOREIGN_RPC_URL=https://kovan.infura.io/mew
|
||||
HOME_BRIDGE_ADDRESS=0xABb4C1399DcC28FBa3Beb76CAE2b50Be3e087353
|
||||
FOREIGN_BRIDGE_ADDRESS=0xE405F6872cE38a7a4Ff63DcF946236D458c2ca3a
|
||||
HOME_DEPLOYMENT_BLOCK=0
|
||||
FOREIGN_DEPLOYMENT_BLOCK=0
|
||||
COMMON_HOME_RPC_URL=https://sokol.poa.network
|
||||
COMMON_FOREIGN_RPC_URL=https://kovan.infura.io/mew
|
||||
COMMON_HOME_BRIDGE_ADDRESS=0xABb4C1399DcC28FBa3Beb76CAE2b50Be3e087353
|
||||
COMMON_FOREIGN_BRIDGE_ADDRESS=0xE405F6872cE38a7a4Ff63DcF946236D458c2ca3a
|
||||
MONITOR_HOME_START_BLOCK=0
|
||||
MONITOR_FOREIGN_START_BLOCK=0
|
||||
|
||||
HOME_GAS_LIMIT=300000
|
||||
HOME_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
HOME_GAS_PRICE_SPEED_TYPE=standard
|
||||
HOME_GAS_PRICE_FALLBACK=1000000000
|
||||
HOME_GAS_PRICE_FACTOR=1
|
||||
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
|
||||
|
||||
FOREIGN_GAS_LIMIT=300000
|
||||
FOREIGN_GAS_PRICE_ORACLE_URL=https://gasprice.poa.network/
|
||||
FOREIGN_GAS_PRICE_SPEED_TYPE=standard
|
||||
FOREIGN_GAS_PRICE_FALLBACK=1000000000
|
||||
FOREIGN_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
|
||||
|
||||
LEFT_TX_THRESHOLD=100
|
||||
PORT=3003
|
||||
MONITOR_TX_NUMBER_THRESHOLD=100
|
||||
MONITOR_PORT=3003
|
||||
|
||||
@@ -8,5 +8,8 @@
|
||||
"rules": {
|
||||
"no-use-before-define": "off",
|
||||
"node/no-unpublished-require": "off"
|
||||
},
|
||||
"env": {
|
||||
"mocha": true
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user