diff --git a/README.md b/README.md index aacf54e..7646f6b 100644 --- a/README.md +++ b/README.md @@ -115,6 +115,8 @@ If successfully, it will generate the binary files in `target/release`/{`sha2-ru > [!NOTE] > You can run the guest program without generating a proof by setting the environmental variable `EXECUTE_ONLY` to "true".https://github.com/zkMIPS/zkm/issues/152 +> You can set the `ZKM_SKIP_PROGRAM_BUILD` environment variable to `true` to skip building the guest program when use `zkm_build::build_program`. + ### 3. Generate groth16 proof and verifier contract > [!NOTE] diff --git a/guest-program/README.md b/guest-program/README.md index 33674c0..b207c77 100644 --- a/guest-program/README.md +++ b/guest-program/README.md @@ -60,6 +60,8 @@ cargo build --target=mips-unknown-linux-musl --release The compiled mips ELF is in the zkm-project-template/guest-program/{sha2-rust,mem-alloc-vec,revme}/target/mips-unknown-linux-musl/release/ . +You can also integrate `zkm_build::build_program` into the compilation process of the host program. + ## Remarks If the guest program need outputing some messages , it must use the runtime::commit(). Then, the messages can be catched in the host program: [`fn print_guest_execution_output() or print_guest_execution_output_struct()`](../sdk/src/lib.rs) diff --git a/host-program/run-proving.sh b/host-program/run-proving.sh index 13bf392..61dbafc 100755 --- a/host-program/run-proving.sh +++ b/host-program/run-proving.sh @@ -12,7 +12,7 @@ export LD_LIBRARY_PATH=$BASEDIR/../sdk/src/local/libsnark:$LD_LIBRARY_PATH ##Mo export RUST_LOG=info export SEG_SIZE=262144 export ARGS="711e9609339e92b03ddc0a211827dba421f38f9ed8b9d806e1ffdd8c15ffa03d world!" -export ELF_PATH=${BASEDIR}/../guest-program/$program/target/mips-unknown-linux-musl/release/$program +export ELF_PATH=${BASEDIR}/../guest-program/$program/target/elf-compilation/mips-unknown-linux-musl/release/$program export JSON_PATH=${BASEDIR}/test-vectors/test.json export PROOF_RESULTS_PATH=${BASEDIR}/../contracts export EXECUTE_ONLY=false @@ -29,8 +29,8 @@ if [[ "$program" =~ .*go$ ]];then cd $BASEDIR/../guest-program/$program GOOS=linux GOARCH=mips GOMIPS=softfloat go build -o $program export ELF_PATH=${BASEDIR}/../guest-program/$program/$program + cd - fi -cd - if [ "$program" == "sha2-rust" ];then export SEG_SIZE=65536