Skip to content

Commit

Permalink
fix(prover-service): expose port in docker; add missing elf file
Browse files Browse the repository at this point in the history
  • Loading branch information
oyyblin committed Nov 21, 2024
1 parent 963c490 commit 65cfc8e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion prover-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ FROM debian:bookworm-slim

RUN apt-get update && apt-get install -y libssl3 ca-certificates
COPY --from=builder /usr/src/app/target/release/server /usr/local/bin/server
CMD ["server"]
COPY --from=builder /usr/src/app/elf/riscv32im-succinct-zkvm-elf /usr/local/bin/elf/

EXPOSE 9090

CMD ["server", "--elf-path", "/usr/local/bin/elf/riscv32im-succinct-zkvm-elf"]
12 changes: 8 additions & 4 deletions prover-service/src/bin/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use tonic_health::server::health_reporter;
)]
struct Args {
/// Port number for the server
#[arg(long, default_value = "9090")]
#[arg(long, default_value = "9090", env = "PORT")]
port: u16,

/// Private key of the prover (must be allowlisted by the prover network for now)
Expand All @@ -22,11 +22,15 @@ struct Args {
private_key: String,

/// Path to the ELF file
#[arg(long, default_value = "elf/riscv32im-succinct-zkvm-elf")]
#[arg(
long,
default_value = "elf/riscv32im-succinct-zkvm-elf",
env = "ELF_PATH"
)]
elf_path: String,

/// Timeout for waiting for the proof in seconds
#[arg(long, default_value = "300")]
#[arg(long, default_value = "300", env = "TIMEOUT_SECS")]
timeout_secs: u64,
}

Expand All @@ -39,7 +43,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let args = Args::parse();

// Start the server
let addr = format!("[::1]:{}", args.port).parse()?;
let addr = format!("0.0.0.0:{}", args.port).parse()?;
let service: ProverServiceImpl =
ProverServiceImpl::new(&args.private_key, &args.elf_path, args.timeout_secs)?;

Expand Down

0 comments on commit 65cfc8e

Please sign in to comment.