Commands
General options
Options:
--show-ssa Emit debug information for the intermediate SSA IR
--deny-warnings Quit execution when warnings are emitted
-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.
Options
--package <PACKAGE> The name of the package to check
--workspace Check all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo codegen-verifier
Generate a Solidity verifier smart contract for the program.
Options
--package <PACKAGE> The name of the package to codegen
--workspace Codegen all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo compile
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.
You can also use "build" as an alias for compile (e.g. nargo build
).
Options
--include-keys Include Proving and Verification keys in the build artifacts
--package <PACKAGE> The name of the package to compile
--workspace Compile all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo new <PATH>
Creates a new Noir project in a new folder.
Arguments
<PATH> The path to save the new project
Options
--name <NAME> Name of the package [default: package directory name]
--lib Use a library template
--bin Use a binary template [default]
--contract Use a contract template
-h, --help Print help
nargo init
Creates a new Noir project in the current directory.
Options
--name <NAME> Name of the package [default: current directory name]
--lib Use a library template
--bin Use a binary template [default]
--contract Use a contract template
-h, --help Print help
nargo execute [WITNESS_NAME]
Runs the Noir program and prints its return value.
Arguments
[WITNESS_NAME] Write the execution witness to named file
Options
-p, --prover-name <PROVER_NAME> The name of the toml file which contains the inputs for the prover [default: Prover]
--package <PACKAGE> The name of the package to execute
--workspace Execute all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
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>.tr
file will then be saved in the ./target
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
Creates a proof for the program.
Options
-p, --prover-name <PROVER_NAME> The name of the toml file which contains the inputs for the prover [default: Prover]
-v, --verifier-name <VERIFIER_NAME> The name of the toml file which contains the inputs for the verifier [default: Verifier]
--verify Verify proof after proving
--package <PACKAGE> The name of the package to prove
--workspace Prove all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo verify
Given a proof and a program, verify whether the proof is valid.
Options
-v, --verifier-name <VERIFIER_NAME> The name of the toml file which contains the inputs for the verifier [default: Verifier]
--package <PACKAGE> The name of the package verify
--workspace Verify all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo test [TEST_NAME]
Nargo will automatically compile and run any functions which have the decorator #[test]
on them if
you run nargo test
. To print println
statements in tests, use the --show-output
flag.
Takes an optional --exact
flag which allows you to select tests based on an exact name.
See an example on the testing page.
Options
--show-output Display output of `println` statements
--exact Only run tests that match exactly
--package <PACKAGE> The name of the package to test
--workspace Test all packages in the workspace
--print-acir Display the ACIR for compiled circuit
--deny-warnings Treat all warnings as errors
-h, --help Print help
nargo info
Prints a table containing the information of the package.
Currently the table provide
- The number of ACIR opcodes
- The final number gates in the circuit used by a backend
If the file contains a contract the table will provide the above information about each function of the contract.
nargo lsp
Start a long-running Language Server process that communicates over stdin/stdout. Usually this command is not run by a user, but instead will be run by a Language Client, such as vscode-noir.