In the hello world guide we executed
This command runs several other Leo CLI commands before verifying a proof.
Let's walk through each command called by
leo run and get a better understanding of what's happening under the hood.
First, remove all build files with:
leo build command compiles the program file
main.leo. Leo will check program syntax and produce the circuit.
To avoid unnecessary future compilations, Leo creates a checksum at outputs/hello-world.sum. The outputs directory will store all files generated by the Leo CLI.
leo setup command generates a proving key at outputs/hello-world.lpk and a verifying key at outputs/hello-world.lvk.
leo prove command generates a proof at outputs/hello-world.proof using the inputs at inputs/hello-world.in and proving key at outputs/hello-world.lpk`.
leo run command verifies the proof at outputs/hello-world.proof using the verifying key outputs/hello-world.lvk
and outputs the verifier result to console.
leo run command will attempt to verify a proof only if all previous steps completed successfully.
Under the hood, the Leo CLI will check for existing
in the outputs directory before running each command. This ensures that we don't run unnecessary commands.
The return value of the
main function is stored in the program's output file
Try editing the inputs in
input/hello-world.in and then executing
leo run. If you provided different input values to the program,
then you should see different results written to the output registers. Be sure to run
leo clean to delete the old checksum.
To learn more about how to use the Leo Language, start here.
To learn more about how to use the Leo CLI, start here.