Rialto test network setup (#163)

* Dockerfile for OpenEth.

* Add relayer dockerfile.

* Add docker-compose.

* Working on the relay.

* Bump a bunch of deps.

* Change relay branch.

* Running a 3-validators poa network.

* Add bridge nodes.

* Conditional compilation of bridge configs.

* Fix genesis hash.

* Disable features build.

* Disable empty steps.

* Work on sub2eth

* Add some logs.

* More logs.

* Fix compilation.

* Add chain-id parameter to relay.

* Unify bridge-hash.

* Update the hash.

* Ditch sub2eth for now.

* Add some docs & proxy configuration.

* Fixes.

* Fix remaining issues.

* Increase health timeout.

* Make sure to install curl for health monitoring.

* Fix kovan.

* Fix build.

* Create if does not exist.

* Fix benches.

* Revert CLI params requirements.

* cargo fmt --all

* Apply suggestions from code review

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>

* Add some docs.

* Update BRIDGE_HASH to master

* Duplicate compose file.

* Rename testpoa to Rialto.

* Fix borked merge.

* Fix entrypoints to take arguments.

Co-authored-by: Hernando Castano <HCastano@users.noreply.github.com>
This commit is contained in:
Tomasz Drwięga
2020-07-17 16:39:32 +02:00
committed by Bastian Köcher
parent 00bd13f8cd
commit bebb5e6035
11 changed files with 300 additions and 52 deletions
+5
View File
@@ -53,6 +53,10 @@ subcommands:
value_name: ETH_CONTRACT
help: Address of deployed bridge contract.
takes_value: true
- eth-chain-id: &eth-chain-id
long: eth-chain-id
value_name: ETH_CHAIN_ID
help: Chain ID to use for signing.
- eth-signer: &eth-signer
long: eth-signer
value_name: ETH_SIGNER
@@ -65,6 +69,7 @@ subcommands:
- eth-host: *eth-host
- eth-port: *eth-port
- eth-signer: *eth-signer
- eth-chain-id: *eth-chain-id
- eth-contract-code:
long: eth-contract-code
value_name: ETH_CONTRACT_CODE
@@ -51,7 +51,7 @@ const MAX_SUBMITTED_HEADERS: usize = 128;
const PRUNE_DEPTH: u32 = 4096;
/// Ethereum synchronization parameters.
#[derive(Clone)]
#[derive(Clone, Debug)]
pub struct EthereumSyncParams {
/// Ethereum connection params.
pub eth: EthereumConnectionParams,
+14
View File
@@ -49,6 +49,7 @@ fn main() {
let matches = clap::App::from_yaml(yaml).get_matches();
match matches.subcommand() {
("eth-to-sub", Some(eth_to_sub_matches)) => {
log::info!(target: "bridge", "Starting ETH ➡ SUB relay.");
if ethereum_sync_loop::run(match ethereum_sync_params(&eth_to_sub_matches) {
Ok(ethereum_sync_params) => ethereum_sync_params,
Err(err) => {
@@ -63,6 +64,7 @@ fn main() {
};
}
("sub-to-eth", Some(sub_to_eth_matches)) => {
log::info!(target: "bridge", "Starting SUB ➡ ETH relay.");
if substrate_sync_loop::run(match substrate_sync_params(&sub_to_eth_matches) {
Ok(substrate_sync_params) => substrate_sync_params,
Err(err) => {
@@ -77,6 +79,7 @@ fn main() {
};
}
("eth-deploy-contract", Some(eth_deploy_matches)) => {
log::info!(target: "bridge", "Deploying ETH contracts.");
ethereum_deploy_contract::run(match ethereum_deploy_contract_params(&eth_deploy_matches) {
Ok(ethereum_deploy_matches) => ethereum_deploy_matches,
Err(err) => {
@@ -160,6 +163,11 @@ fn ethereum_signing_params(matches: &clap::ArgMatches) -> Result<EthereumSigning
.map_err(|e| format!("Failed to parse eth-signer: {}", e))
.and_then(|secret| KeyPair::from_secret(secret).map_err(|e| format!("Invalid eth-signer: {}", e)))?;
}
if let Some(eth_chain_id) = matches.value_of("eth-chain-id") {
params.chain_id = eth_chain_id
.parse::<u64>()
.map_err(|e| format!("Failed to parse eth-chain-id: {}", e))?;
}
Ok(params)
}
@@ -205,6 +213,8 @@ fn ethereum_sync_params(matches: &clap::ArgMatches) -> Result<EthereumSyncParams
None => eth_sync_params.sync_params.target_tx_mode = sync::TargetTransactionMode::Signed,
}
log::debug!(target: "bridge", "Ethereum sync params: {:?}", eth_sync_params);
Ok(eth_sync_params)
}
@@ -218,6 +228,8 @@ fn substrate_sync_params(matches: &clap::ArgMatches) -> Result<SubstrateSyncPara
sub_sync_params.eth_contract_address = eth_contract.parse().map_err(|e| format!("{}", e))?;
}
log::debug!(target: "bridge", "Substrate sync params: {:?}", sub_sync_params);
Ok(sub_sync_params)
}
@@ -234,6 +246,8 @@ fn ethereum_deploy_contract_params(
hex::decode(&eth_contract_code).map_err(|e| format!("Failed to parse eth-contract-code: {}", e))?;
}
log::debug!(target: "bridge", "Deploy params: {:?}", eth_deploy_params);
Ok(eth_deploy_params)
}