Skip to content

Commit

Permalink
servers: Fix aggregator no watchtower endpoint.
Browse files Browse the repository at this point in the history
  • Loading branch information
ceyhunsen committed Dec 10, 2024
1 parent c324906 commit 713b843
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions core/src/servers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,12 +437,28 @@ pub async fn create_actors_grpc(
.await
.unwrap();

// let config = create_test_config_with_thread_name(config_name, None).await;
println!("Port: {}", start_port);
let port = start_port
+ all_verifiers_secret_keys.len() as u16
+ all_operators_secret_keys.len() as u16
+ 1;
println!("Watchtower start port: {}", port);
let wathctower_futures = (0..number_of_watchtowers)
.map(|i| {
let verifier_configs = verifier_configs.clone();

create_watchtower_grpc_server(BridgeConfig {
port: port + i as u16,
..verifier_configs[0].clone()
})
})
.collect::<Vec<_>>();
let wathctower_endpoints = futures::future::try_join_all(wathctower_futures)
.await
.unwrap();

// let config = create_test_config_with_thread_name(config_name, None).await;
println!("Port: {}", start_port);
let port = port + number_of_watchtowers as u16;
// + all_operators_secret_keys.len() as u16;
let aggregator = create_aggregator_grpc_server(BridgeConfig {
port,
Expand All @@ -458,27 +474,17 @@ pub async fn create_actors_grpc(
.map(|(socket_addr,)| format!("http://{}", socket_addr))
.collect(),
),
watchtower_endpoints: Some(
wathctower_endpoints
.iter()
.map(|(socket_addr,)| format!("http://{}", socket_addr))
.collect(),
),
..verifier_configs[0].clone()
})
.await
.unwrap();

let port = port + 1;
println!("Watchtower start port: {}", port);
let wathctower_futures = (0..number_of_watchtowers)
.map(|i| {
let verifier_configs = verifier_configs.clone();

create_watchtower_grpc_server(BridgeConfig {
port: port + i as u16,
..verifier_configs[0].clone()
})
})
.collect::<Vec<_>>();
let wathctower_endpoints = futures::future::try_join_all(wathctower_futures)
.await
.unwrap();

(
verifier_endpoints,
operator_endpoints,
Expand Down

0 comments on commit 713b843

Please sign in to comment.