### Nexus CLI Start Command Help Output Example Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Example output of the help command for the 'nexus-cli start' command, detailing its specific options. ```bash # Output includes all options: # --node-id Node ID # --headless Run without the terminal UI # --max-threads Maximum number of threads for proving # --orchestrator-url Custom orchestrator URL # --check-memory Enable memory error risk checking # --with-background Enable background colors in dashboard # --max-tasks Maximum tasks before exiting # --max-difficulty Override max difficulty to request ``` -------------------------------- ### Install Nexus CLI (Recommended) Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Installs the latest Nexus CLI binary. Accepts Terms of Use and starts interactive mode. ```bash curl https://cli.nexus.xyz/ | sh ``` -------------------------------- ### Install Protobuf Compiler Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Installs the Protobuf compiler. Use 'brew install protobuf' on macOS, 'apt-get install protobuf-compiler' on Ubuntu/Debian, or download from releases for Windows. Verify installation. ```bash protoc --version ``` -------------------------------- ### Running Nexus CLI Example Programs Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Command to execute example programs locally using nexus-run. Lists available example programs. ```bash # Run example programs locally (requires nexus-run) cd clients/cli/examples cargo run -r --bin fib # Available example programs: # - fib: Basic fibonacci sequence # - fib_input: Fibonacci with external input # - fact: Factorial computation # - keccak: Keccak hash computation # - galeshapley: Gale-Shapley algorithm # - palindromes: Palindrome detection # - lambda_calculus: Lambda calculus evaluator ``` -------------------------------- ### Nexus CLI Configuration File Example Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt The `config.json` file stores CLI configuration. It can be manually created or edited. Ensure the `node_id` is present for quick starts using the `--node-id` flag. ```json { "environment": "Production", "user_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "wallet_address": "0x1234567890abcdef1234567890abcdef12345678", "node_id": "5880437" } ``` -------------------------------- ### Run Nexus VM Example Program Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/examples/README.md Use this command to build and run the default example program. Ensure you have the nexus-rt runtime configured. ```sh cargo run -r --bin example ``` -------------------------------- ### Install Dependencies Source: https://github.com/nexus-xyz/nexus-cli/blob/main/functions/README.md Run this command in the 'functions' directory to install project dependencies. ```bash cd functions npm install ``` -------------------------------- ### Nexus CLI Help Output Example Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Example output of the general help command for Nexus CLI, showing usage, commands, and options. ```bash # Output: # Usage: nexus-cli # # Commands: # start Start the prover # register-user Register a new user # register-node Register a new node to an existing user # logout Clear the node configuration and logout # help Print this message or the help of the given subcommand(s) # # Options: # -h, --help Print help # -V, --version Print version ``` -------------------------------- ### Install Protocol Buffers Compiler on macOS Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Installs the Protocol Buffers compiler using Homebrew and verifies the installation. ```bash # Install using Homebrew brew install protobuf # Verify installation protoc --version ``` -------------------------------- ### Start Nexus CLI with Adaptive Difficulty Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Use the `start` command to run the Nexus CLI. The adaptive difficulty system automatically adjusts task complexity. You can override the maximum difficulty level based on your system's resources. ```bash # Use default adaptive difficulty (starts at 'small', auto-promotes) nexus-cli start ``` ```bash # Override maximum difficulty for resource-constrained systems nexus-cli start --max-difficulty small nexus-cli start --max-difficulty small_medium ``` ```bash # Override for standard desktop/laptop performance nexus-cli start --max-difficulty medium nexus-cli start --max-difficulty large ``` ```bash # Override for high-performance dedicated systems (8+ cores, 16+ GB RAM) nexus-cli start --max-difficulty extra_large nexus-cli start --max-difficulty extra_large_2 nexus-cli start --max-difficulty extra_large_3 nexus-cli start --max-difficulty extra_large_4 nexus-cli start --max-difficulty extra_large_5 ``` ```bash # Difficulty levels are case-insensitive nexus-cli start --max-difficulty MEDIUM nexus-cli start --max-difficulty Medium nexus-cli start --max-difficulty medium ``` -------------------------------- ### Check Git Installation Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Verifies if Git is installed on the system. ```bash git --version ``` -------------------------------- ### Install Nexus CLI via Script Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Installs the Nexus CLI using a curl script. Use the interactive version for manual installation or the non-interactive version for automated environments. ```bash curl https://cli.nexus.xyz/ | sh ``` ```bash curl -sSf https://cli.nexus.xyz/ -o install.sh chmod +x install.sh NONINTERACTIVE=1 ./install.sh ``` -------------------------------- ### Docker Installation and Management Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Commands for building, running, checking logs, and shutting down the Nexus CLI in a Dockerized environment. Ensure Docker and Docker Compose are installed. ```bash docker compose build --no-cache docker compose up -d docker compose logs # Check logs docker compose down # Shutdown ``` -------------------------------- ### Rust Fibonacci Example for Nexus VM Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Demonstrates a basic zkVM program structure using Rust to compute the Fibonacci sequence. Requires the nexus-rt crate. ```rust #![cfg_attr(target_arch = "riscv32", no_std, no_main)] use nexus_rt::println; fn fib(n: u32) -> u32 { match n { 0 => 1, 1 => 1, _ => fib(n - 1) + fib(n - 2), } } #[nexus_rt::main] fn main() { for n in 0..10 { println!("fib({n}) = {}", fib(n)); } } ``` -------------------------------- ### Start Nexus CLI with Node ID Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Starts the Nexus CLI using an existing node ID. ```bash nexus-cli start --node-id ``` -------------------------------- ### Start Local Development Server Source: https://github.com/nexus-xyz/nexus-cli/blob/main/functions/README.md Use this command to run the Firebase Functions locally for development and testing. ```bash npm run serve ``` -------------------------------- ### Install Rust and Cargo Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Installs the latest stable version of Rust and Cargo using the official installation script. Verify the installation by checking the versions. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ```bash rustc --version cargo --version ``` -------------------------------- ### Build Nexus CLI from Source Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Compiles the Nexus CLI from its source code. Ensure all prerequisites are installed for your operating system before cloning and building. ```bash # Prerequisites (Linux/Ubuntu) sudo apt update && sudo apt upgrade sudo apt install build-essential pkg-config libssl-dev git-all protobuf-compiler ``` ```bash # Prerequisites (macOS) brew install protobuf ``` ```bash # Clone and build git clone https://github.com/nexus-xyz/nexus-cli cd nexus-cli/clients/cli cargo build --release ``` ```bash # Run the CLI cargo run --release ``` -------------------------------- ### Install Development Dependencies on Linux Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Installs essential build tools, libraries, and git for developing the Nexus CLI on a Linux system. ```bash sudo apt update sudo apt upgrade sudo apt install build-essential pkg-config libssl-dev git-all sudo apt install protobuf-compiler ``` -------------------------------- ### Install Protocol Buffers Compiler on Windows Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Installs the Protocol Buffers compiler using Chocolatey within the Windows Subsystem for Linux (WSL). ```bash # Install using Chocolatey choco install protobuf ``` -------------------------------- ### Start Nexus CLI in Headless Mode Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Starts the Nexus CLI in non-interactive, headless mode. ```bash nexus-cli start --headless ``` -------------------------------- ### Create Minimal Nexus CLI Configuration Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Create a minimal `config.json` file with only the `node_id`. This is useful for quick starts when using the `--node-id` flag. ```bash # Minimal configuration with just node ID (for quick start with --node-id flag) cat > ~/.nexus/config.json << 'EOF' { "node_id": "5880437" } EOF ``` -------------------------------- ### Install Nexus CLI (Non-Interactive) Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Installs the Nexus CLI non-interactively, suitable for automated environments like CI. ```bash curl -sSf https://cli.nexus.xyz/ -o install.sh chmod +x install.sh NONINTERACTIVE=1 ./install.sh ``` -------------------------------- ### Start Nexus Prover - Interactive Mode Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Launches the Nexus prover with a terminal UI for real-time monitoring. Options include specifying a node ID, enabling background colors, limiting worker threads, or processing a set number of tasks. ```bash # Start proving with the default configuration nexus-cli start ``` ```bash # Start with a specific node ID (skips config file requirement) nexus-cli start --node-id 5880437 ``` ```bash # Enable background colors in the dashboard nexus-cli start --with-background ``` ```bash # Limit the number of worker threads nexus-cli start --max-threads 4 ``` ```bash # Process a specific number of tasks then exit nexus-cli start --max-tasks 10 ``` -------------------------------- ### Start Nexus Prover - Headless Mode Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Runs the Nexus prover without a terminal UI, ideal for automated deployments. Options include specifying a node ID, custom orchestrator URL, memory checking, and thread limits. ```bash # Run in headless mode (no TUI) nexus-cli start --headless ``` ```bash # Headless mode with specific node ID nexus-cli start --headless --node-id 5880437 ``` ```bash # Headless with custom orchestrator URL (for testing) nexus-cli start --headless --orchestrator-url https://custom.orchestrator.url ``` ```bash # Enable memory checking for systems with limited RAM nexus-cli start --headless --check-memory ``` ```bash # Combined options for production deployment nexus-cli start --headless --node-id 5880437 --max-threads 8 --max-difficulty large ``` -------------------------------- ### Add RISC-V Target Source: https://github.com/nexus-xyz/nexus-cli/blob/main/programs/fib_input_initial/README.md Ensure the correct Rust toolchain for the RISC-V target is installed before building the program. ```bash rustup target add riscv32im-unknown-none-elf ``` -------------------------------- ### Nexus CLI Version Requirement Not Met Example Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Illustrates the error message displayed when the CLI version is too old to meet network requirements. Provides guidance on updating. ```bash # If version is too old: # ❌ Version requirement not met # Your version 0.9.0 does not meet the minimum required version 0.10.0 # To resolve this issue: # • Download the latest version from: # https://github.com/nexus-xyz/nexus-cli/releases ``` -------------------------------- ### Build Guest Script for Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/scripts/README.md Automates the creation and building of guest programs using `cargo nexus host`. Requires `cargo nexus` to be installed. Builds guest programs for the RISC-V target and copies the ELF to the assets directory. ```bash ./scripts/build_guest.sh [guest_name] ``` ```bash # Build with default name ./scripts/build_guest.sh ``` ```bash # Build with custom name ./scripts/build_guest.sh my_custom_program ``` -------------------------------- ### Register Nexus User Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Registers a new user with the Nexus orchestrator using an Ethereum wallet address. The wallet address must be a 42-character hex string starting with '0x'. ```bash # Register a user with an Ethereum wallet address # The wallet address must be a 42-character hex string starting with '0x' nexus-cli register-user --wallet-address 0x1234567890abcdef1234567890abcdef12345678 ``` -------------------------------- ### Display Nexus CLI Help Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Shows available command-line options and troubleshooting information. ```bash nexus-cli --help ``` -------------------------------- ### Build Project Source: https://github.com/nexus-xyz/nexus-cli/blob/main/functions/README.md Execute this command to build the Firebase Functions project for deployment. ```bash npm run build ``` -------------------------------- ### Deploy Functions Source: https://github.com/nexus-xyz/nexus-cli/blob/main/functions/README.md Run this command to deploy the Firebase Functions to the cloud. ```bash npm run deploy ``` -------------------------------- ### Display Nexus CLI Specific Command Help Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Command to display detailed help for a specific Nexus CLI command, including all its available options. ```bash # Display help for specific command nexus-cli start --help ``` -------------------------------- ### Build Fibonacci Guest Program Source: https://github.com/nexus-xyz/nexus-cli/blob/main/programs/fib_input_initial/README.md Build the `fib_input_initial` guest program for the RISC-V target. The resulting ELF file is located in the `target/riscv32im-unknown-none-elf/release/guest` directory. ```bash cargo build --release --target riscv32im-unknown-none-elf ``` -------------------------------- ### Display General Nexus CLI Help Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Command to access general help information for the Nexus CLI, listing available commands and options. ```bash # Display general help nexus-cli --help ``` -------------------------------- ### Build Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Builds the Nexus CLI project using Cargo. ```bash cargo build ``` -------------------------------- ### Build Nexus CLI with Proto Compilation Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Builds the Nexus CLI project, enabling proto compilation using the 'build_proto' feature. ```bash cargo build --features build_proto ``` -------------------------------- ### Build and Copy ELF File Script Source: https://github.com/nexus-xyz/nexus-cli/blob/main/programs/fib_input_initial/README.md Execute this script to build the guest program for the RISC-V target and copy the resulting ELF file to the CLI assets directory. This script automates the build and deployment process for the `fib_input_initial` program. ```bash ./build_and_copy.sh ``` -------------------------------- ### Register User and Node with Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Registers a wallet address and creates a node ID using the Nexus CLI. ```bash nexus-cli register-user --wallet-address ``` ```bash nexus-cli register-node --node-id ``` ```bash nexus-cli start ``` -------------------------------- ### Run Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Executes the Nexus CLI using Cargo. ```bash cargo run ``` -------------------------------- ### Test Guest Program with Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/programs/fib_input_initial/README.md Tests the Fibonacci guest program using the Nexus CLI's anonymous proving feature. The CLI handles loading the ELF, providing inputs, and generating a proof. ```bash cargo run -r start --headless ``` -------------------------------- ### Build Guest Program for RISC-V Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/programs/fib_input_initial/README.md Builds the Nexus guest program for the RISC-V target using Cargo. The compiled ELF file is essential for execution within the Nexus zkVM. ```bash # Build for RISC-V target cargo build --target riscv32i-unknown-none-elf --release # The ELF file will be generated at: target/riscv32i-unknown-none-elf/release/guest ``` -------------------------------- ### Docker Compose for Nexus CLI Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Sets up and runs the Nexus CLI within a Docker container. Ensure you replace '' with your actual node ID. ```yaml # docker-compose.yaml services: nexus-cli: build: . command: ["start", "--headless", "--node-id", ""] ``` ```bash # Build and run the Docker container docker compose build --no-cache docker compose up -d ``` ```bash # Monitor logs docker compose logs ``` ```bash # Shutdown docker compose down ``` -------------------------------- ### View Nexus CLI Configuration Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Use the `cat` command to view the current Nexus CLI configuration stored in `~/.nexus/config.json`. ```bash # View current configuration cat ~/.nexus/config.json ``` -------------------------------- ### Display Nexus CLI Version Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Command to display the current version of the Nexus CLI and its build information. Used for checking compatibility. ```bash # Version information is displayed with --version nexus-cli --version ``` -------------------------------- ### Nexus CLI Internal Proving Pipeline (Rust) Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt This Rust code illustrates the internal proving pipeline handled automatically by the CLI. It includes parsing inputs, generating and validating proofs, and computing proof hashes. ```rust // Internal proving pipeline structure (for reference) // The CLI handles this automatically during task processing // Step 1: Parse task inputs (triple format: u32, u32, u32) let inputs: (u32, u32, u32) = InputParser::parse_triple_input(&input_data)?; // Step 2: Generate proof using Stwo prover in subprocess (memory isolation) let proof = ProvingEngine::prove_and_validate(&inputs, &task, &environment, &client_id).await?; // Step 3: Verify proof locally before submission ProofVerifier::verify_proof(&proof, &inputs, &prover)?; // Step 4: Generate proof hash for submission let proof_hash = Keccak256::digest(&proof_bytes); ``` -------------------------------- ### Clone Nexus CLI Repository Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Clones the Nexus CLI repository from GitHub and navigates into the CLI client directory. ```bash git clone https://github.com/nexus-xyz/nexus-cli cd nexus-cli/clients/cli ``` -------------------------------- ### Configure Nexus CLI Parallel Proof Generation Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Configure the number of parallel workers for proof generation. The CLI automatically adjusts workers based on CPU cores and memory, but you can set explicit limits. It handles input distribution, hash combination, and error cancellation. ```bash # Configure parallel proof generation workers # Workers are automatically clamped to 75% of CPU cores and available memory # Explicit thread limit nexus-cli start --max-threads 4 # Memory-aware configuration (each worker requires ~4GB RAM) nexus-cli start --check-memory --max-threads 8 # The CLI automatically: # - Distributes inputs across workers using semaphore-based limiting # - Combines individual proof hashes using Keccak-256 # - Handles cancellation gracefully on critical errors ``` -------------------------------- ### Configure Nexus CLI Node ID Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Manually create a `~/.nexus/config.json` file to set your node ID and skip interactive prompts in non-interactive environments. ```json { "node_id": "" } ``` -------------------------------- ### Set Nexus CLI Max Difficulty (Case-Insensitive) Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Demonstrates that the max difficulty setting is case-insensitive. ```bash nexus-cli start --max-difficulty MEDIUM ``` ```bash nexus-cli start --max-difficulty medium ``` ```bash nexus-cli start --max-difficulty Medium ``` -------------------------------- ### Nexus CLI Task Fetching Monitoring Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt The Nexus CLI automatically fetches proving tasks from the orchestrator. Monitor the process through the CLI output, which indicates steps like fetching, proving, and submitting tasks. ```bash # Monitor task fetching in the CLI output: # Step 1 of 4: Fetching task... # Step 2 of 4: Proving task abc123... # Step 3 of 4: Submitting proof... # Step 4 of 4: Submission complete! ``` -------------------------------- ### Set Nexus CLI Max Difficulty (Higher) Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Sets the maximum task difficulty to 'medium', 'large', or higher for powerful hardware to optimize rewards. ```bash nexus-cli start --max-difficulty medium ``` ```bash nexus-cli start --max-difficulty large ``` ```bash nexus-cli start --max-difficulty extra_large ``` ```bash nexus-cli start --max-difficulty extra_large_2 ``` ```bash nexus-cli start --max-difficulty extra_large_3 ``` ```bash nexus-cli start --max-difficulty extra_large_4 ``` ```bash nexus-cli start --max-difficulty extra_large_5 ``` -------------------------------- ### Run Code Quality Checks Source: https://github.com/nexus-xyz/nexus-cli/blob/main/CONTRIBUTING.md Executes local code quality checks including formatting, lints, unused dependencies, and security vulnerabilities. ```bash # Format code cargo fmt --check # Run clippy lints cargo clippy -- -D warnings # Check for unused dependencies cargo udeps # Check for security vulnerabilities cargo audit ``` -------------------------------- ### Configure Nexus CLI Orchestrator Environment Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Configure the Nexus CLI to connect to different orchestrator environments. You can use the default production URL, specify a custom URL for development/testing, or set the environment via an environment variable. ```bash # Default production environment # URL: https://production.orchestrator.nexus.xyz nexus-cli start ``` ```bash # Custom orchestrator URL (for development/testing) nexus-cli start --orchestrator-url https://staging.orchestrator.example.com ``` ```bash # Set environment via environment variable NEXUS_ENVIRONMENT=production nexus-cli start ``` -------------------------------- ### Register Nexus Node Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt Registers a new prover node to an existing user account or links an existing node ID. If no node ID is provided, a new one will be auto-generated. ```bash # Register a new node (auto-generates node ID) nexus-cli register-node ``` ```bash # Link an existing node ID to your user account nexus-cli register-node --node-id 5880437 ``` -------------------------------- ### Monitor Peak Memory Usage of Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/scripts/README.md Monitors the peak memory usage of the nexus-cli during operation. Requires `nexus-cli` to be built and a valid nexus configuration. Defaults to monitoring for 60 seconds. ```bash ./scripts/peak_memory.sh [DURATION_SECONDS] ``` ```bash # Monitor for default 60 seconds ./scripts/peak_memory.sh ``` ```bash # Monitor for 20 seconds ./scripts/peak_memory.sh 20 ``` ```bash # Monitor for 5 minutes ./scripts/peak_memory.sh 300 ``` -------------------------------- ### Set Nexus CLI Max Difficulty (Lower) Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Sets the maximum task difficulty to 'small' or 'small_medium' for resource-constrained systems or background processing. ```bash nexus-cli start --max-difficulty small ``` ```bash nexus-cli start --max-difficulty small_medium ``` -------------------------------- ### Adjust Nexus CLI Max Difficulty Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Use the `--max-difficulty` flag to set the maximum difficulty for tasks. Set to 'small_medium' for lower difficulty or 'extra_large_2' for higher difficulty. ```bash nexus-cli start --max-difficulty small_medium ``` ```bash nexus-cli start --max-difficulty extra_large_2 ``` -------------------------------- ### Logout Nexus CLI Source: https://context7.com/nexus-xyz/nexus-cli/llms.txt The `logout` command clears the local node configuration file, effectively removing all stored credentials. ```bash # Clear node configuration nexus-cli logout ``` ```bash # Expected output: # ℹ Logging out # Clearing node configuration file... ``` -------------------------------- ### Logout from Nexus CLI Source: https://github.com/nexus-xyz/nexus-cli/blob/main/README.md Clears saved credentials from ~/.nexus/config.json. ```bash nexus-cli logout ``` -------------------------------- ### Iterative Fibonacci Calculation Function Source: https://github.com/nexus-xyz/nexus-cli/blob/main/clients/cli/programs/fib_input_initial/README.md Implements an iterative approach to calculate the nth Fibonacci number, supporting custom initial values. Ensure the input types match the function signature. ```rust fn fib_iter(n: u32, init_a: u32, init_b: u32) -> u32 { let mut a = init_a; let mut b = init_b; for i in 0..n + 1 { if i > 1 { let c = a + b; a = b; b = c; } } b } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.