Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: CLI fetch inputs #1397

Merged
merged 4 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clients/cli/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion clients/cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "nexus-network"
version = "0.5.3"
version = "0.5.5"
edition = "2021"
rust-version = "1.75"
build = "build.rs"
Expand Down
5 changes: 2 additions & 3 deletions clients/cli/src/orchestrator_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ impl OrchestratorClient {

match U::decode(response_bytes) {
Ok(msg) => Ok(Some(msg)),
Err(e) => {
println!("Failed to decode response: {:?}", e);
Err(_e) => {
// println!("Failed to decode response: {:?}", e);
Ok(None)
}
}
Expand Down Expand Up @@ -140,7 +140,6 @@ impl OrchestratorClient {
self.make_request::<SubmitProofRequest, ()>("/tasks/submit", "POST", &request)
.await?;

println!("\tNexus Orchestrator: Proof submitted successfully");
Ok(())
}
}
21 changes: 11 additions & 10 deletions clients/cli/src/prover.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use nexus_sdk::{
stwo::seq::Stwo,
Local,
Prover,
Viewable,
};
use nexus_sdk::{stwo::seq::Stwo, Local, Prover, Viewable};

use crate::config;
use crate::flops;
Expand Down Expand Up @@ -34,7 +29,7 @@ async fn authenticated_proving(
let prover =
Stwo::<Local>::new_from_file(&elf_file_path).expect("failed to load guest program");

println!("4. Creating ZK proof with inputs...");
println!("4. Creating ZK proof with inputs");
let (view, proof) = prover
.prove_with_input::<(), u32>(&(), &public_input)
.expect("Failed to run prover");
Expand Down Expand Up @@ -106,6 +101,7 @@ pub async fn start_prover(

// Run the initial setup to determine anonymous or connected node
match setup::run_initial_setup().await {
//each arm of the match is a choice by the user: anonymous or connected or invalid as catchall
setup::SetupResult::Anonymous => {
println!(
"\n===== {} =====\n",
Expand Down Expand Up @@ -162,13 +158,18 @@ pub async fn start_prover(
println!("\n================================================");
println!(
"{}",
format!("\nStarting proof #{} ...\n", proof_count).yellow()
format!(
"\n[node: {}] Starting proof #{} ...\n",
node_id, proof_count
)
.yellow()
);

match anonymous_proving() {
match authenticated_proving(&node_id, environment).await {
Ok(_) => (),
Err(e) => println!("Error in anonymous proving: {}", e),
Err(_e) => (),
}

proof_count += 1;
tokio::time::sleep(std::time::Duration::from_secs(4)).await;
}
Expand Down
2 changes: 1 addition & 1 deletion clients/cli/src/utils/cli_branding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub fn print_banner() {
"{} {} {}\n",
"Welcome to the".bright_white(),
"Nexus Network CLI".bright_cyan().bold(),
"v0.5.3".bright_white()
"v0.5.5".bright_white()
);
println!(
"{}",
Expand Down