Commands
General options
Options:
-s, --show-ssa Emit debug information for the intermediate SSA IR
-d, --deny-warnings Quit execution when warnings are emitted
--show-output Display output of `println` statements during tests
-h, --help Print help
nargo help [subcommand]
Prints the list of available commands or specific information of a subcommand.
Arguments
<subcommand>
- The subcommand whose help message to display
nargo check
Generate the Prover.toml
and Verifier.toml
files for specifying prover and verifier in/output
values of the Noir program respectively.
nargo codegen-verifier
Generate a Solidity verifier smart contract for the program.
nargo compile <circuit_name>
Compile the program into a JSON build artifact file containing the ACIR representation and the ABI of the circuit. This build artifact can then be used to generate and verify proofs.
Arguments
<circuit_name>
- The name of the circuit file
Options
-c, --contracts
- Compile each contract function used within the program
nargo new <package_name> [path]
Creates a new Noir project.
Arguments
<package_name>
- Name of the package[path]
- The path to save the new project
nargo execute [witness_name]
Runs the Noir program and prints its return value.
Arguments
[witness_name]
- The name of the witness
Usage
The inputs to the circuit are read from the Prover.toml
file generated by nargo check
, which
must be filled in.
To save the witness to file, run the command with a value for the witness-name
argument. A
<witness_name-name>.tr
file will then be saved in the build
folder.
Info: The
.tr
file is the witness file. The witness file can be considered as program inputs parsed for your program's ACIR.This file can be passed along with circuit's ACIR into a TypeScript project for proving and verification. See the TypeScript section to learn more.
nargo prove <proof_name>
Creates a proof for the program.
Arguments
<proof_name>
- The name of the proof
Options
-v, --verify
- Verify proof after proving
nargo verify <proof>
Given a proof and a program, verify whether the proof is valid.
Arguments
<proof>
- The proof to verify
nargo test <pattern>
Nargo will automatically compile and run any functions which have the decorator #[test]
on them if
you run nargo test
.
See an example on the testing page.
Arguments
<pattern>
- a pattern to indicate to only run tests with names containing the pattern
nargo gates
Counts the occurrences of different gates in circuit
nargo print-acir
Print a compiled circuit to stdout such that the ACIR can be inspected.