A hands-on, interactive way to learn Noir programming language through practical exercises. Perfect for both beginners and developers looking to sharpen their Noir skills.
|
|
|
- Clone and enter the repository:
git clone https://github.com/satyambnsal/noirlings.git
cd noirlingsMake sure you have both Rust and Noir installed. If you don't have it installed: Run
./install.sh
If you see any error in terminal, install them separately with following commands
- Install Rust and Cargo:
curl https://sh.rustup.rs -sSf | sh -s- Install Noir:
curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash
noirup- After Installing Rust and Nargo, you are ready to run your exercises. Lets first install the project binary with
cargo install --path .
- Now you should have noirlings available as command. You can verify the installation with
noirlings --version
noirlings watch Noirlings is designed to help you learn Noir through hands-on exercises:
- Each exercise is a Noir file containing a problem to solve
- Run
noirlings watchto start - you'll see an error message for the first exercise - Open the exercise file in your editor and start solving
- Type
hintin watch mode for help, or runnoirlings hint exercise_name - Remove the
// I AM NOT DONEcomment when you've solved an exercise - Watch mode automatically verifies your solution and moves to the next exercise
For syntax highlighting and language support:
- Install the Noir VSCode Extension
- Open the project folder in VSCode
- Create exercise file in
./exercises/<module_name>/<exercise_name>.nr - Add exercise metadata to
info.toml:
[[exercises]]
name = "exercise_name"
path = "exercises/module/exercise_name.nr"
mode = "test"
hint = "Your helpful hint here"- Test your exercise:
noirlings run exercise_name- Run test suite
- Submit a PR!
Run specific tests:
cargo test noirRun all tests:
cargo testIf you need any help while doing the exercises, feel free to ask in the Q&A category of the discussions if your question wasn't asked yet 💡
- If you get permission denied error when running
noirlings watchcommand. Check permissions of~/.nargo/github.comand~/.nargoYou can change permission of folder withchmod 777 ~/.nargo
- Inspired by Rustlings and Starklings
- [] Add Support for
nargo infofor each exercise to print ACIR Opcodes count and Brillig Opcode count.