1- use std:: sync:: { Arc , Mutex } ;
2-
31use axum:: {
42 Json , Router ,
53 extract:: { Multipart , Query } ,
@@ -11,6 +9,7 @@ use co_ultrahonk::prelude::ZeroKnowledge;
119use rustls:: pki_types:: CertificateDer ;
1210use serde:: Deserialize ;
1311use serde_json:: json;
12+ use std:: sync:: Arc ;
1413use token:: Token ;
1514use tower_http:: {
1615 cors:: { Any , CorsLayer } ,
@@ -29,7 +28,7 @@ mod shares;
2928mod token;
3029
3130use db:: { connect_db, get_matches, setup_db} ;
32- use matching:: { DIR , run_matches} ;
31+ use matching:: { CONFIG_DIR , DATA_DIR , run_matches} ;
3332use shares:: upload;
3433
3534#[ derive( Debug , Deserialize ) ]
@@ -61,21 +60,21 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
6160 NetworkParty :: new(
6261 PartyID :: ID0 . into( ) ,
6362 Address :: new( "localhost" . to_string( ) , 10000 ) ,
64- CertificateDer :: from( std:: fs:: read( DIR . join( "cert0.der" ) ) ?) . into_owned( ) ,
63+ CertificateDer :: from( std:: fs:: read( CONFIG_DIR . join( "cert0.der" ) ) ?) . into_owned( ) ,
6564 ) ,
6665 NetworkParty :: new(
6766 PartyID :: ID1 . into( ) ,
6867 Address :: new( "localhost" . to_string( ) , 10001 ) ,
69- CertificateDer :: from( std:: fs:: read( DIR . join( "cert1.der" ) ) ?) . into_owned( ) ,
68+ CertificateDer :: from( std:: fs:: read( CONFIG_DIR . join( "cert1.der" ) ) ?) . into_owned( ) ,
7069 ) ,
7170 NetworkParty :: new(
7271 PartyID :: ID2 . into( ) ,
7372 Address :: new( "localhost" . to_string( ) , 10002 ) ,
74- CertificateDer :: from( std:: fs:: read( DIR . join( "cert2.der" ) ) ?) . into_owned( ) ,
73+ CertificateDer :: from( std:: fs:: read( CONFIG_DIR . join( "cert2.der" ) ) ?) . into_owned( ) ,
7574 ) ,
7675 ] ;
7776
78- let program_artifact = Utils :: get_program_artifact_from_file ( DIR . join ( "circuit.json" ) ) ?;
77+ let program_artifact = Utils :: get_program_artifact_from_file ( DATA_DIR . join ( "circuit.json" ) ) ?;
7978 let constraint_system = Arc :: new ( Utils :: get_constraint_system_from_artifact (
8079 & program_artifact,
8180 true ,
@@ -86,8 +85,8 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
8685
8786 let crs_size = co_noir:: compute_circuit_size :: < Bn254 > ( & constraint_system, recursive) ?;
8887 let crs = CrsParser :: < Bn254 > :: get_crs (
89- DIR . join ( "bn254_g1.dat" ) ,
90- DIR . join ( "bn254_g2.dat" ) ,
88+ CONFIG_DIR . join ( "bn254_g1.dat" ) ,
89+ CONFIG_DIR . join ( "bn254_g2.dat" ) ,
9190 crs_size,
9291 has_zk,
9392 ) ?;
0 commit comments