mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
Have processor's Network::new sleep until booted, not panic
This commit is contained in:
@@ -50,14 +50,7 @@ mod bitcoin {
|
||||
|
||||
async fn bitcoin(ops: &DockerOperations) -> Bitcoin {
|
||||
let handle = ops.handle("serai-dev-bitcoin").host_port(8332).unwrap();
|
||||
let url = format!("http://serai:seraidex@{}:{}", handle.0, handle.1);
|
||||
for _ in 0 .. 20 {
|
||||
if bitcoin_serai::rpc::Rpc::new(url.clone()).await.is_ok() {
|
||||
break;
|
||||
}
|
||||
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
let bitcoin = Bitcoin::new(url).await;
|
||||
let bitcoin = Bitcoin::new(format!("http://serai:seraidex@{}:{}", handle.0, handle.1)).await;
|
||||
bitcoin.fresh_chain().await;
|
||||
bitcoin
|
||||
}
|
||||
@@ -114,15 +107,7 @@ mod monero {
|
||||
|
||||
async fn monero(ops: &DockerOperations) -> Monero {
|
||||
let handle = ops.handle("serai-dev-monero").host_port(18081).unwrap();
|
||||
let url = format!("http://serai:seraidex@{}:{}", handle.0, handle.1);
|
||||
for _ in 0 .. 60 {
|
||||
if monero_serai::rpc::HttpRpc::new(url.clone()).await.is_ok() {
|
||||
break;
|
||||
}
|
||||
tokio::time::sleep(core::time::Duration::from_secs(1)).await;
|
||||
}
|
||||
|
||||
let monero = Monero::new(url).await;
|
||||
let monero = Monero::new(format!("http://serai:seraidex@{}:{}", handle.0, handle.1)).await;
|
||||
while monero.get_latest_block_number().await.unwrap() < 150 {
|
||||
monero.mine_block().await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user