1818PROJECT_ROOT = Path (__file__ ).parent .parent .parent
1919CERTS_PATH = Path (settings .certs_path )
2020TLSN_EXECUTABLE_DIR = Path (settings .tlsn_project_root ) / "tlsn" / "examples" / "binance"
21+ TLSN_BINARY_PATH = Path (settings .tlsn_project_root ) / "tlsn" / "target" / "release" / "examples"
2122
2223CMD_VERIFY_TLSN_PROOF = "cargo run --release --example binance_verifier"
2324CMD_GEN_TLSN_PROOF = "cargo run --release --example binance_prover"
24-
25+ CMD_TLSN_PROVER = "./binance_prover"
2526
2627def locate_binance_prover ():
28+ # either in the project root or place executing `poetry run` or `tlsn executable dir`
2729 binance_provers = [
28- (Path ('.' ).resolve (), './binance_prover' ),
29- (TLSN_EXECUTABLE_DIR , CMD_GEN_TLSN_PROOF ),
30+ (Path ('.' ).resolve (), CMD_TLSN_PROVER ),
31+ (TLSN_BINARY_PATH , CMD_TLSN_PROVER ),
3032 ]
3133 binance_prover_dir = None
3234 for (dir , exec_cmd ) in binance_provers :
@@ -35,7 +37,7 @@ def locate_binance_prover():
3537 binance_prover_exec_cmd = exec_cmd
3638 break
3739 if binance_prover_dir is None :
38- raise FileNotFoundError (f"binance_prover not found in { binance_prover_dir } " )
40+ raise FileNotFoundError (f"binance_prover not found in { binance_prover_dir } . Please build it in TLSN repo. " )
3941 logger .info (f"Found binance_prover in { binance_prover_dir } " )
4042 return binance_prover_dir , binance_prover_exec_cmd
4143
0 commit comments