-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mock crate separation from binaries (#375)
* mock_macro: Add initial. * mock_macro: Add initialize_database. * actor: Pilot mock_macro usage. * mock_macro: Add needed imports for integration tests. * tests: Use new mock_macro in integration tests. * mock_macro: Add create_actors. * mock_macro: Use create_actors everywhere and delete create_actors_grpc. * mock_macro: Use initialize_database everywhere. * mock_macro: Use create_test_config_with_thread_name in everywhere. * test_utils: Rename mock_macro. * cargo: Delete bin entry of `all_servers`. * test_utils: Remove create_database and drop_database to add them in initialize_database. * test_utils: Use get_postgresql_url in initialize_database. * JsonRPC endpoint removals (#377) * jsonrpc: Initial remove. * operator: Remove old rpc test. * verifier: Convert functions to pub. * tests: Delete old file. * cargo: Remove unused features for jsonrpsee.
- Loading branch information
Showing
32 changed files
with
1,359 additions
and
2,128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,62 @@ | ||
use clementine_core::servers::create_aggregator_server; | ||
use clementine_core::servers::create_operator_server; | ||
use clementine_core::servers::create_verifier_server; | ||
use clementine_core::utils::get_configuration_for_binaries; | ||
use clementine_core::{database::Database, extended_rpc::ExtendedRpc}; | ||
use std::process::exit; | ||
// use clementine_core::servers::create_aggregator_server; | ||
// use clementine_core::servers::create_operator_server; | ||
// use clementine_core::servers::create_verifier_server; | ||
// use clementine_core::utils::get_configuration_for_binaries; | ||
// use clementine_core::{database::Database, extended_rpc::ExtendedRpc}; | ||
// use std::process::exit; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let (mut config, args) = get_configuration_for_binaries(); | ||
|
||
if !args.verifier_server && !args.operator_server && !args.aggregator_server { | ||
eprintln!("No servers are specified. Please specify one."); | ||
exit(1); | ||
} | ||
|
||
let rpc = ExtendedRpc::new( | ||
config.bitcoin_rpc_url.clone(), | ||
config.bitcoin_rpc_user.clone(), | ||
config.bitcoin_rpc_password.clone(), | ||
) | ||
.await; | ||
|
||
Database::run_schema_script(&config).await.unwrap(); | ||
|
||
let mut handles = vec![]; | ||
|
||
if args.verifier_server { | ||
handles.push( | ||
create_verifier_server(config.clone(), rpc.clone()) | ||
.await | ||
.unwrap() | ||
.1 | ||
.stopped(), | ||
); | ||
config.port += 1; | ||
|
||
println!("Verifier server is started."); | ||
} | ||
|
||
if args.operator_server { | ||
handles.push( | ||
create_operator_server(config.clone(), rpc.clone()) | ||
.await | ||
.unwrap() | ||
.1 | ||
.stopped(), | ||
); | ||
config.port += 1; | ||
|
||
println!("Operator server is started."); | ||
} | ||
|
||
if args.aggregator_server { | ||
handles.push(create_aggregator_server(config).await.unwrap().1.stopped()); | ||
|
||
println!("Aggregator server is started."); | ||
} | ||
|
||
futures::future::join_all(handles).await; | ||
panic!("grpc switch in progress. please inform us if you get this error.") | ||
// let (mut config, args) = get_configuration_for_binaries(); | ||
|
||
// if !args.verifier_server && !args.operator_server && !args.aggregator_server { | ||
// eprintln!("No servers are specified. Please specify one."); | ||
// exit(1); | ||
// } | ||
|
||
// let rpc = ExtendedRpc::new( | ||
// config.bitcoin_rpc_url.clone(), | ||
// config.bitcoin_rpc_user.clone(), | ||
// config.bitcoin_rpc_password.clone(), | ||
// ) | ||
// .await; | ||
|
||
// Database::run_schema_script(&config).await.unwrap(); | ||
|
||
// let mut handles = vec![]; | ||
|
||
// if args.verifier_server { | ||
// handles.push( | ||
// create_verifier_server(config.clone(), rpc.clone()) | ||
// .await | ||
// .unwrap() | ||
// .1 | ||
// .stopped(), | ||
// ); | ||
// config.port += 1; | ||
|
||
// println!("Verifier server is started."); | ||
// } | ||
|
||
// if args.operator_server { | ||
// handles.push( | ||
// create_operator_server(config.clone(), rpc.clone()) | ||
// .await | ||
// .unwrap() | ||
// .1 | ||
// .stopped(), | ||
// ); | ||
// config.port += 1; | ||
|
||
// println!("Operator server is started."); | ||
// } | ||
|
||
// if args.aggregator_server { | ||
// handles.push(create_aggregator_server(config).await.unwrap().1.stopped()); | ||
|
||
// println!("Aggregator server is started."); | ||
// } | ||
|
||
// futures::future::join_all(handles).await; | ||
} |
Oops, something went wrong.