### Sample Output for Visual Studio Component Installation Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Provides an example of the initial console output when running the Visual Studio setup.exe command to install components, showing installer version, command-line parsing, and telemetry setup. ```Powershell PS C:\Users\leet> & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" install --norestart --productId Microsoft.VisualStudio.Product.BuildTools --channelId VisualStudio.17.Release --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.Windows11SDK.22000 PS C:\Users\leet> [1d44:0001][2024-11-05T02:37:56] Saving the current locale (en-US) to user.json. [1d44:0001][2024-11-05T02:37:56] Setting the telemetry services [1d44:0005][2024-11-05T02:37:56] Creating a new telemetry service. [1d44:0001][2024-11-05T02:37:56] Visual Studio Installer Version: 3.11.2180 [1d44:0001][2024-11-05T02:37:56] Raw Command line: "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" install --passive --norestart --productId Microsoft.VisualStudio.Product.BuildTools --channelId VisualStudio.17.Release --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.Windows11SDK.22000 [1d44:0001][2024-11-05T02:37:56] Parsed command line options: install --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 Microsoft.VisualStudio.Component.VC.Redist.14.Latest Microsoft.VisualStudio.Component.Windows11SDK.22000 --channelId VisualStudio.17.Release --norestart --passive --productId Microsoft.VisualStudio.Product.BuildTools [1d44:0005][2024-11-05T02:37:56] Telemetry session ID: 8c0666e6-122f-43a2-8400-3c9a47d5d8d1 [1d44:0004][2024-11-05T02:37:56] Creating new ExperimentationService ``` -------------------------------- ### Install ledgerctl from Git Repository Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Installs the `ledgerctl` Python application directly from its Git repository, enabling control and management of Ledger devices. ```bash pip3 install git+https://github.com/LedgerHQ/ledgerctl ``` -------------------------------- ### Run Tari Ledger Demo Program Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Command to execute the `ledger_demo` example program from the main Tari project root. This Rust application interacts with the Ledger device and guides the user through necessary actions for testing. ```Rust cargo run --release --example ledger_demo ``` -------------------------------- ### Start Temporary Docker Container for Ledger Build (Windows) Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Starts a temporary Docker container with the `ledger-app-builder` image, mounting the current directory to `/app` for building Ledger applications. ```dos docker run --rm -it -v ".:/app" ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder ``` -------------------------------- ### Install Cargo Ledger from Git Repository Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Installs the `cargo-ledger` command-line tool directly from its Git repository, enabling the loading of BOLOS applications to Ledger devices. ```bash cargo install --git https://github.com/LedgerHQ/cargo-ledger cargo-ledger ``` -------------------------------- ### Install Core Python Packages for ledgerctl Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Installs or upgrades essential Python packages (`protobuf`, `setuptools`, `ecdsa`) required for the `ledgerctl` application to function correctly. ```bash pip3 install --upgrade protobuf setuptools ecdsa ``` -------------------------------- ### Install Node.js Project Dependencies Source: https://github.com/tari-project/tari/blob/development/clients/ffi_client/README.md This command installs all required Node.js packages and their dependencies as specified in the project's `package.json` file. It's a crucial first step to ensure all necessary modules are available for the client application. ```Shell npm install ``` -------------------------------- ### Start Minotari Base Node Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This command initiates the Minotari base node. It can be run with optional arguments such as `--help` for usage information or `-b ./path` to specify a custom base path for configuration files, which is particularly useful for creating distinct wallet configurations. ```Shell ./minotari_node ``` -------------------------------- ### Install Essential Linux System Tools Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md Installs common command-line utilities like `net-tools` and `git` using `apt-get`. These tools are fundamental for network diagnostics, system setup, and cloning source code repositories on Debian/Ubuntu-based Linux distributions. ```bash sudo apt-get install net-tools sudo apt-get install git ``` -------------------------------- ### Install Rust Source Component for Nightly Toolchain Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Installs the `rust-src` component for the Rust nightly toolchain, which is required for building Ledger applications that do not link against the standard library. ```bash rustup component add rust-src --toolchain nightly ``` -------------------------------- ### Run Node.js Client Application Source: https://github.com/tari-project/tari/blob/development/clients/ffi_client/README.md This command executes the main Node.js application. It typically invokes the 'start' script defined in the project's `package.json`, which in this context is configured to run the `index.js` file, initiating the FFI client. ```Shell npm start ``` -------------------------------- ### Install XCode Command Line Tools Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md Installs the XCode Command Line Tools, which provide essential development utilities like compilers, debuggers, and SDKs necessary for iOS application development and building related components. ```Shell Script xcode-select --install ``` -------------------------------- ### Sample Output for winget Build Tools Installation Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Illustrates the expected console output when successfully installing Visual Studio Build Tools 2022 using the winget command, showing download progress and verification. ```Powershell PS C:\Users\leet> winget install "Visual Studio BuildTools 2022 installer" Found Visual Studio BuildTools 2022 [Microsoft.VisualStudio.2022.BuildTools] Version 17.11.5 This application is licensed to you by its owner. Microsoft is not responsible for, nor does it grant any licenses to, third-party packages. Downloading https://download.visualstudio.microsoft.com/download/pr/69e24482-3b48-44d3-af65-51f866a08313/471c9a89fa8ba27d356748ae0cf25eb1f362184992dc0bb6e9ccf10178c43c27/vs_BuildTools.exe ██████████████████████████████ 4.22 MB / 4.22 MB Successfully verified installer hash Starting package install... Successfully installed ``` -------------------------------- ### Install mdbook via Cargo Source: https://github.com/tari-project/tari/blob/development/docs/README.md This command installs the `mdbook` tool, a utility for creating and serving books from Markdown files, using Rust's package manager, Cargo. Ensure Rust and Cargo are installed on your system before executing this command. ```bash cargo install mdbook ``` -------------------------------- ### Serve mdbook documentation locally Source: https://github.com/tari-project/tari/blob/development/docs/README.md This command starts a local web server to serve the mdbook documentation. It must be executed within the root directory of the mdbook project (e.g., the `/docs` folder). The documentation will typically be accessible via a web browser at `http://localhost:3000`. ```bash mdbook serve ``` -------------------------------- ### Install MinoTari Wallet Application Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Commands to install the MinoTari Wallet application onto a Ledger device using `ledgerctl`. The application's JSON manifest file must be specified, either directly or via its path within the project's target directory. ```Shell ledgerctl install app_nanosplus.json ``` ```Shell ledgerctl install ./target/nanosplus/release/app_nanosplus.json ledgerctl install ./target/stax/release/app_stax.json ``` -------------------------------- ### Install macOS Mojave SDK Headers Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md For macOS Mojave (10.14) users, this command opens an installer to add additional SDK headers. This step is necessary to resolve potential compilation errors related to missing system headers. ```Shell Script open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg ``` -------------------------------- ### Launch Monero Stagenet CLI Wallet Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md Starts the Monero command-line interface wallet, configured to connect to the stagenet. This provides an interactive console for creating new wallets, managing existing ones, and performing transaction operations within the stagenet environment. ```bash ./monero-wallet-cli --stagenet ``` -------------------------------- ### Start Tari Console Wallet Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This shell command is used to launch the Tari console wallet application. It should be executed after any configuration changes have been saved to ensure the wallet initializes with the updated settings. ```Shell minotari_console_wallet ``` -------------------------------- ### Install SQLite3 Library with vcpkg Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command uses vcpkg to install the SQLite3 library for 64-bit Windows, configured for static linking. It simplifies the process of acquiring and integrating SQLite3 into C/C++ projects. ```PowerShell vcpkg install sqlite3:x64-windows-static ``` -------------------------------- ### Example Tari Wallet FFI Build Configuration File Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md This snippet presents the typical content of the `build.sample.config` file. It defines various environment variables such as paths to SDKs, wallet repositories, and flags to enable/disable Android/iOS builds or cargo cleaning. Users must modify these values to match their development environment. ```Text BUILD_ANDROID=1 BUILD_IOS=1 CARGO_CLEAN=1 SQLITE_SOURCE=https://www.sqlite.org/snapshot/sqlite-snapshot-201911192122.tar.gz NDK_PATH=$HOME/android-ndk-r20 PKG_PATH=/usr/local/opt/openssl@1.1/lib/pkgconfig ANDROID_WALLET_PATH=$HOME/wallet-android IOS_WALLET_PATH=$HOME/wallet-ios TARI_REPO_PATH=$HOME/tari-main ``` -------------------------------- ### Install and Configure Rust Toolchain Source: https://github.com/tari-project/tari/blob/development/buildtools/build-notes.md Provides commands to install Rust via `rustup`, including an unattended installation option, and to add Rust's binary directory to the system's PATH for proper execution. ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh ``` ```bash curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y ``` ```bash export PATH="$HOME/.cargo/bin:$PATH" source "$HOME/.cargo/env" ``` -------------------------------- ### Manage Rust Cross-Compilation Toolchains Source: https://github.com/tari-project/tari/blob/development/buildtools/build-notes.md Adds specific target toolchains for cross-compilation (e.g., `aarch64-unknown-linux-gnu`) and lists installed targets and toolchains to verify the setup. ```bash rustup target add aarch64-unknown-linux-gnu rustup toolchain install stable-aarch64-unknown-linux-gnu --force-non-host ``` ```bash rustup target list --installed rustup toolchain list ``` -------------------------------- ### Install Core Development Dependencies via Homebrew Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md Installs essential build tools and libraries such as pkg-config, Git, Make, CMake, Autoconf, Automake, Libtool, and OpenSSL 1.1 using Homebrew. These packages are crucial for compiling the Tari Wallet FFI and its dependencies. ```Shell Script brew install pkgconfig brew install git brew install make brew install cmake brew install autoconf brew install automake brew install libtool brew install openssl@1.1 ``` -------------------------------- ### Verify winget and App Installer Installation Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This PowerShell command is used to check if `winget` and `App Installer` are installed and functioning correctly on a Windows system. It lists all installed packages managed by `winget`, helping to confirm its presence and version. ```powershell winget list ``` -------------------------------- ### Configure Rust Toolchain and Cross-Compilation Targets Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md Installs the stable Rust toolchain, sets it as the default, and adds essential components like `rustfmt` and `clippy`. It also adds necessary cross-compilation targets for iOS (iPhone and emulator) and Android (various architectures) to enable building for mobile platforms. ```Shell Script rustup toolchain add stable rustup default stable rustup component add rustfmt --toolchain nightly rustup component add clippy rustup target add x86_64-apple-ios aarch64-apple-ios # iPhone and emulator cross compiling rustup target add x86_64-linux-android aarch64-linux-android armv7-linux-androideabi # Android device cross compiling ``` -------------------------------- ### Prepare Speculos Emulator for M1 Devices Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Git and Docker commands to set up the Speculos Ledger emulator environment, specifically tailored for M1 Mac devices. This involves checking out a specific commit and building the necessary Docker images. ```Shell git checkout df84117d2ac300cd277d58913a9f56e061b5fb2f ``` ```Docker docker build -t speculos-builder:latest -f build.Dockerfile . docker build -t speculos:latest . ``` -------------------------------- ### Install Rust on Windows using winget Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Installs the Rust toolchain installer (rustup) on a Windows system using the winget package manager. This is a prerequisite for building Rust-based projects like Tari. ```PowerShell winget install --id Rustlang.Rustup ``` -------------------------------- ### Build Monero Mining Pool from Source Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md This section outlines the steps to install required development libraries for the Monero mining pool, set the `MONERO_ROOT` environment variable to locate the Monero source directory, and then compile the mining pool software. This prepares the pool executable for operation. ```bash sudo apt-get install liblmdb-dev libevent-dev libjson-c-dev uuid-dev export MONERO_ROOT=/path/to/cloned/monero/repository/root make release ``` -------------------------------- ### Verify vcpkg Installation Status Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command checks if vcpkg is correctly installed and accessible in the system's PATH. A successful execution will show installed packages or instructions for installation. ```PowerShell vcpkg list ``` -------------------------------- ### Run Speculos Ledger Emulator Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Docker command to launch the Speculos Ledger emulator. It maps necessary ports, mounts the application directory, and specifies display and API settings for running the MinoTari Wallet application in a simulated environment. ```Docker docker run --rm -it -v $(pwd):/speculos/apps -p 1234:1234 -p 3000:3000 -p 40000:40000 -p 41000:41000 speculos --display headless --api-port 3000 --vnc-port 41000 apps/target/nanosplus/release/minotari_ledger_wallet --model nanosp ``` -------------------------------- ### Listen for Incoming Tari Wallet Transactions via gRPC in JavaScript Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This code snippet demonstrates how to establish a gRPC connection to a Tari wallet and listen for a stream of completed transactions. It provides two examples: one using an insecure connection for development and another using SSL credentials for secure communication in production environments. The examples show how to load protobuf definitions, create a client, call the `GetCompletedTransactions` method, and handle the incoming data stream. ```javascript const grpc = require('@grpc/grpc-js'); const protoLoader = require('@grpc/proto-loader'); // Load the protobuf const PROTO_PATH = './proto/wallet.proto'; const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true }); const streamingProto = grpc.loadPackageDefinition(packageDefinition).tari.rpc; // Create a client console.log(streamingProto); const client = new streamingProto.Wallet('localhost:18143', grpc.credentials.createInsecure()); const request = {}; // Call the gRPC method const call = client.GetCompletedTransactions(request); // Handle the stream of responses call.on('data', (response) => { console.log('Received data:', response); // ..... Do business logic with transaction. E.g. compare the reference in payment_id to a reference provided to the exchange client and allocate // to their account // .... }); call.on('end', () => { console.log('Stream ended.'); }); call.on('error', (err) => { console.error('Stream error:', err); }); call.on('status', (status) => { console.log('Stream status:', status); }); ``` ```javascript // Load the protobuf definition const PROTO_PATH = './proto/wallet.proto'; const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true }); const streamingProto = grpc.loadPackageDefinition(packageDefinition).tari.rpc; // Read the server's certificate (server.crt) const serverCert = fs.readFileSync('path/to/server.crt'); // Specify the path to your server's certificate // Create secure credentials for the client using the server's certificate const credentials = grpc.credentials.createSsl(serverCert); // Create the gRPC client with the secure credentials const client = new streamingProto.Wallet('localhost:18143', credentials); // Prepare the request object (you can modify this based on the method's requirements) const request = {}; // Call the gRPC method with secure connection const call = client.GetCompletedTransactions(request); // Handle the stream of responses call.on('data', (response) => { console.log('Received data:', response); // Process transaction data here. Example: // Compare the reference in payment_id to a reference provided to the exchange client and allocate to their account }); call.on('end', () => { console.log('Stream ended.'); }); call.on('error', (err) => { console.error('Stream error:', err); }); call.on('status', (status) => { console.log('Stream status:', status); }); ``` -------------------------------- ### Set Up Cargo Ledger Build Targets Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Configures `cargo-ledger` to add new build targets specific to Ledger devices for the current Rust toolchain, as per its setup instructions. ```bash cargo ledger setup ``` -------------------------------- ### Start Monero Mining Pool Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md Launches the Monero mining pool application. For the pool to function correctly, both the Monero daemon (`monerod`) and the Monero wallet RPC (`monero-wallet-rpc`) must be running concurrently and accessible to the pool. ```bash ./monero-pool --forked ``` -------------------------------- ### Initialize Minotari Console Wallet Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This command starts the Minotari console wallet. By default, wallet data is stored in `~/.tari`, but a custom directory can be specified using the `--base-path` argument. This is the initial step for creating a new wallet, recovering an existing one, or setting up a read-only wallet. ```Shell minotari_console_wallet ``` -------------------------------- ### Install vcpkg Package Manager on Windows Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This snippet provides the commands to clone the vcpkg repository, navigate into it, run the bootstrap script, and integrate vcpkg with Visual Studio. It's essential for managing C/C++ libraries like OpenSSL. ```PowerShell git clone https://github.com/microsoft/vcpkg.git \vcpkg cd \vcpkg .\bootstrap-vcpkg.bat .\vcpkg integrate install ``` -------------------------------- ### Start Bitcoin Core Daemon for Testnet Source: https://github.com/tari-project/tari/blob/development/docs/src/btc_atomic_swap.md This command initiates the Bitcoin Core daemon in testnet mode. Running Bitcoin Core is a fundamental prerequisite for interacting with the Bitcoin network and performing atomic swaps. ```cli ./src/bitcoind -daemon -testnet ``` -------------------------------- ### Install OpenSSL Library with vcpkg Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command installs the OpenSSL library for 64-bit Windows via vcpkg, configured for static linking. OpenSSL is a critical dependency for many secure communication applications and cryptographic operations. ```PowerShell vcpkg install openssl:x64-windows-static ``` -------------------------------- ### Execute XMRig for Monero Solo Merge Mining Source: https://github.com/tari-project/tari/blob/development/README.md These commands demonstrate how to start the XMRig miner on Linux/OSX and Windows. Before execution, ensure the `config.json` file is placed in the XMRig build or install directory. This initiates the solo mining process, connecting XMRig to the Merge Mining Proxy. ```Shell # Linux/OSX ./xmrig # Windows xmrig ``` -------------------------------- ### Install Git on Windows via winget Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command installs Git, a distributed version control system, on Windows using the `winget` package manager. Git is essential for cloning and managing the Tari Project's source code. ```powershell winget install --id Git.Git -e --source winget ``` -------------------------------- ### Build Ledger Wallet and Exit Docker Container (Windows) Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Builds the Ledger wallet application for the specified target within the Docker container, then exits the container. ```dos cargo ledger build {TARGET} exit ``` -------------------------------- ### Install Chocolatey on Windows via winget Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command installs Chocolatey, a package manager for Windows, using `winget`. Chocolatey simplifies the installation of various development dependencies, including Protobuf, which is required for the Tari Project. ```powershell winget install --id chocolatey.chocolatey ``` -------------------------------- ### Build Onion Monero Blockchain Explorer from Source Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md This section describes how to install necessary build dependencies, clone the Onion Monero Blockchain Explorer repository, create a build directory, configure the build process with CMake (pointing to the Monero source directory), and finally compile the explorer application. ```bash sudo apt-get install build-essential cmake libcurl4-openssl-dev sudo apt install curl git clone https://github.com/moneroexamples/onion-monero-blockchain-explorer.git cd onion-monero-blockchain-explorer mkdir build && cd build cmake .. -DMONERO_DIR=/path/to/cloned/monero/repository/root make ``` -------------------------------- ### Simplified Node.js gRPC Client Authentication Example Source: https://github.com/tari-project/tari/blob/development/docs/src/API_GRPC_Explanation.md This Node.js example demonstrates a simplified approach to instantiating a gRPC client with authentication, assuming a custom `Client` class abstracts the underlying gRPC setup. It shows how to pass authentication details directly as part of the client constructor options. ```javascript const { Client } = require('./path/to/clients/nodejs/wallet_grpc_client'); // Replace './path/to/clients/nodejs/wallet_grpc_client' with the installed module name or relative path const client = new Client('localhost:18183', { authentication: { type: 'basic', username: 'my_username', password: 'my_password', }, }); console.log('Client created:', client); ``` -------------------------------- ### Minotari Wallet Hardware Device Usage Prompt Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This interactive prompt asks the user if they intend to integrate a connected hardware wallet, specifically mentioning Ledger as a supported type. For a standard software wallet setup, the user should decline this option by entering 'n'. ```Text Would you like to use a connected hardware wallet? (Supported types: Ledger) (Y/n) ``` -------------------------------- ### Install Visual Studio 2022 Components for Windows 11 Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This Powershell command executes the Visual Studio Installer's setup.exe to install specific components required for Windows 11 development, including C++ tools, redistributables, the Windows 11 SDK, and CMake project support. Ensure all Visual Studio applications are closed before running this command. ```Powershell & "C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe" install --force --focusedUi --productId Microsoft.VisualStudio.Product.BuildTools --channelId VisualStudio.17.Release --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.VisualStudio.Component.VC.Redist.14.Latest --add Microsoft.VisualStudio.Component.Windows11SDK.26100 --add Microsoft.VisualStudio.Component.VC.CMake.Project --add Microsoft.VisualStudio.Component.VC.CoreBuildTools --add Microsoft.VisualStudio.Component.VC.CoreIde --add Microsoft.VisualStudio.ComponentGroup.NativeDesktop.Core ``` -------------------------------- ### Create Minotari Wallet Data Directory using Bash Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This Bash command sequence creates a new directory named `tari_wallet_data` in the current location and then navigates into it. This directory is designated to temporarily store all Minotari wallet-related files during the initial setup phase, allowing for easy cleanup later. ```Bash mkdir tari_wallet_data cd tari_wallet_data ``` -------------------------------- ### Build Tari Ledger Wallet with Docker Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Builds the Tari Ledger wallet application for a specified target using the official `ledger-app-builder` Docker image. This command runs from the root of the Tari repository and outputs compiled resources to the target directory. ```bash docker run --rm -it \ -v ".:/app" \ -w /app/applications/minotari_ledger_wallet/wallet \ ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder \ cargo ledger build {TARGET} ``` ```dos docker run --rm -it -v ".:/app" -w /app/applications/minotari_ledger_wallet/wallet ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder cargo ledger build {TARGET} ``` -------------------------------- ### Run Tari P2P Examples Source: https://github.com/tari-project/tari/blob/development/base_layer/p2p/examples/README.md General instructions for running any example from the `tari_p2p` crate using `cargo run`. Replace `$name` with the specific example name and provide any necessary arguments. ```bash cargo run --example $name -- [args] ``` -------------------------------- ### Install Homebrew Package Manager Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md This command installs Homebrew, a popular package manager for macOS, which is a foundational dependency for installing various development tools required for the Tari Wallet FFI. ```Shell Script /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` -------------------------------- ### Delete MinoTari Wallet Application Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Command to delete a previously installed MinoTari Wallet application from a Ledger device using the `ledgerctl` utility. This step is often required before a fresh installation. ```Shell ledgerctl delete "MinoTari Wallet" ``` -------------------------------- ### Build Monero Daemon and Wallet from Source Source: https://github.com/tari-project/tari/blob/development/applications/minotari_merge_mining_proxy/monero_stagenet_setup.md This sequence installs all necessary build dependencies for Monero, clones the official Monero repository, checks out a specific release version (v0.17), initializes and updates Git submodules, and finally compiles the Monero binaries (daemon and wallet) from source. This prepares the core Monero components for stagenet operation. ```bash sudo apt update && sudo apt install build-essential cmake pkg-config libboost-all-dev libssl-dev libzmq3-dev libunbound-dev libsodium-dev libunwind8-dev liblzma-dev libreadline6-dev libldns-dev libexpat1-dev doxygen graphviz libpgm-dev qttools5-dev-tools libhidapi-dev libusb-1.0-0-dev libprotobuf-dev protobuf-compiler libudev-dev git clone https://github.com/monero-project/monero.git cd monero git checkout release-v0.17 git submodule init && git submodule update --force make release ``` -------------------------------- ### Install Custom Certificate Authority on Ledger Device Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Installs a custom certificate authority (CA) on a Ledger device for development purposes. The device must be in recovery mode before running this command. ```bash ledgerctl install-ca ``` -------------------------------- ### Navigate to Tari Wallet FFI and Open Build Configuration Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md This snippet shows the shell commands to navigate into the `base_layer/wallet_ffi` directory within the Tari repository and then open the `build.sample.config` file. This file needs to be customized with local paths and build preferences before proceeding with the build process. ```Shell Script cd base_layer/wallet_ffi open build.sample.config ``` -------------------------------- ### Example: Setting Network via Command-Line Override Source: https://github.com/tari-project/tari/blob/development/docs/guide/applications_overview.md Provides a practical example of how to use the `-p` command-line option to set the network for a base node application. ```bash # Set network -p "base_node.network=esmeralda" ``` -------------------------------- ### Minotari Console Wallet Initial Menu Options Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This text snippet displays the interactive main menu presented upon launching the Minotari console wallet. It offers three primary options: creating a new wallet, recovering an existing one from a seed phrase or hardware device, or setting up a read-only wallet using a view key. ```Text Console Wallet 1. Create a new wallet. 2. Recover wallet from seed words or hardware device. 3. Create a read-only wallet using a view key. >> ``` -------------------------------- ### Build All Tari Applications with Cargo Source: https://github.com/tari-project/tari/blob/development/docs/guide/applications_overview.md Instructions for building all Tari applications or specific applications using the `cargo build --release` command for optimized production binaries. ```bash # Build all applications cargo build --release # Build specific application cargo build --release --bin minotari_node cargo build --release --bin minotari_console_wallet cargo build --release --bin minotari_miner cargo build --release --bin minotari_merge_mining_proxy ``` -------------------------------- ### Switch XCode Path for Catalina Compilation Fix Source: https://github.com/tari-project/tari/blob/development/base_layer/wallet_ffi/README.md On macOS Catalina, if compilation errors like 'SDK "iphoneos" cannot be located' occur, this command switches the default XCode path to ensure the correct XCode installation is used for building. ```Shell Script sudo xcode-select --switch /Applications/Xcode.app ``` -------------------------------- ### Install Tari Binaries on Unix-like Systems Source: https://github.com/tari-project/tari/blob/development/README.md Steps to extract the Tari binary installation archive into the user's home directory on Unix-like operating systems. This makes the Tari applications available for execution via soft links. ```bash cd ~ tar -xf ``` -------------------------------- ### Set Custom Base Node for Tari Wallet Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This TOML configuration snippet demonstrates how to set a `custom_base_node` for the Tari wallet. It specifies the public key and address of a base node peer that the wallet will use to obtain metadata. Users should replace the example value with their own base node details. ```TOML # A custom base node peer that will be used to obtain metadata from, example # "0eefb45a4de9484eca74846a4f47d2c8d38e76be1fec63b0112bd00d297c0928::/ip4/13.40.98.39/tcp/18189" # (default = ) custom_base_node = "22d33b525d35d256674c5184c262b70d15275effcf5f6fe6dc0d359a18541d04::/onion3/6x54mmubphz5r3opswpuhseswivvlaxbohuqvwsn4o36zmtudq73dgid:18141" ``` -------------------------------- ### Export Tari Wallet View and Spend Keys Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This command exports the view and spend keys from the Minotari console wallet. It requires the wallet's base path and will prompt for the wallet password. These keys are essential for setting up read-only wallets or for recovery, as demonstrated by the example output showing the extracted keys. ```Shell minotari_console_wallet --base-path ~/tari_wallet_data export-view-key-and-spend-key ``` -------------------------------- ### Build and Deploy Rust FFI Library Source: https://github.com/tari-project/tari/blob/development/clients/ffi_client/README.md These commands compile the `minotari_wallet_ffi` Rust library in release mode, generating an optimized dynamic library. Following compilation, the resulting library file (e.g., .dylib, .so, or .dll depending on the OS) is copied into the specified project directory for the Node.js client to access. ```Shell cargo build -p minotari_wallet_ffi --release --lib cp target/release/libminotari_wallet_ffi.dylib /path/to/here ``` -------------------------------- ### Install and Run Tari Tests with Nextest Source: https://github.com/tari-project/tari/blob/development/README.md Instructions to install the `cargo-nextest` tool and then execute the Tari project's continuous integration tests using the nightly Rust toolchain. This ensures the codebase meets quality standards. ```bash cargo install cargo-nextest ``` ```bash cargo +nightly ci-test ``` -------------------------------- ### Build Tari Applications with Specific Features Source: https://github.com/tari-project/tari/blob/development/docs/guide/applications_overview.md Examples demonstrating how to build Tari applications with optional features enabled or disabled using `cargo build --features` and `--no-default-features` flags. ```bash # Build node with metrics cargo build --release --bin minotari_node --features metrics # Build wallet without ledger support cargo build --release --bin minotari_console_wallet --no-default-features --features grpc,libtor ``` -------------------------------- ### Build Tari Applications on Windows Source: https://github.com/tari-project/tari/blob/development/README.md Compiles the Tari project from source using Cargo in release mode within the Microsoft Visual Studio x64/x86 Native Tools Command Prompt environment. Executables are created in the user's target/release directory. ```powershell cd %USERPROFILE%\Code\tari cargo build --release ``` -------------------------------- ### Run a built Tari binary Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Executes a specific Tari binary (e.g., `minotari_miner`) from the release build using `cargo run`. This demonstrates how to run compiled applications and can be used to check versions or retrieve documentation. ```PowerShell cargo run --bin minotari_miner --release -- --version ``` -------------------------------- ### Install Visual Studio Build Tools 2022 via winget Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This Powershell command uses the winget package manager to install the Visual Studio Build Tools 2022. This is the initial step to acquire the core build environment. ```Powershell winget install --id=Microsoft.VisualStudio.2022.BuildTools -e ``` -------------------------------- ### Install Ubuntu 18.04 Development Dependencies Source: https://github.com/tari-project/tari/blob/development/buildtools/build-notes.md Updates package lists and installs essential development tools and libraries required for building the Tari project on Ubuntu 18.04. This includes compilers, build tools, and various development headers. ```bash sudo apt-get update sudo apt-get install --no-install-recommends --assume-yes \ apt-transport-https \ ca-certificates \ curl \ gpg \ bash \ less \ openssl \ libssl-dev \ pkg-config \ libsqlite3-dev \ libsqlite3-0 \ libreadline-dev \ git \ cmake \ dh-autoreconf \ clang \ g++ \ libc++-dev \ libc++abi-dev \ libprotobuf-dev \ protobuf-compiler \ libncurses5-dev \ libncursesw5-dev \ libudev-dev \ libhidapi-dev \ zip ``` -------------------------------- ### Tari P2P Ping-Pong Communication with Ncurses UI Source: https://github.com/tari-project/tari/blob/development/base_layer/p2p/examples/README.md This example demonstrates basic peer-to-peer communication using the `tari_p2p` library, featuring an ncurses UI. It allows sending ping messages and receiving pong messages to a single peer. Users can press 'p' to initiate a ping. ```bash cargo run --example pingpong --features pingpong-example -- --help cargo run --example pingpong --features pingpong-example -- --node-identity examples/sample_identities/node-identity1.json --peer-identity examples/sample_identities/node-identity2.json ``` -------------------------------- ### Install Tari Executables Globally with Cargo Source: https://github.com/tari-project/tari/blob/development/README.md Installs the compiled Tari application executables into Cargo's binary directory (~/.cargo/bin on Linux/macOS, %USERPROFILE%\.cargo\bin on Windows), making them accessible from any command line location. ```rust cargo install --path=applications/minotari_node --force cargo install --path=applications/minotari_console_wallet --force cargo install --path=applications/minotari_merge_mining_proxy --force cargo install --path=applications/minotari_miner --force ``` -------------------------------- ### Install or Upgrade Protobuf using Chocolatey Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md This command installs or upgrades Protobuf (Protocol Buffers) using the Chocolatey package manager. Protobuf is used for serializing structured data within the Tari Project. This command should be executed in an Administrator PowerShell console. ```powershell choco upgrade protoc -y ``` -------------------------------- ### Implement Tari PayRef Verification Service in JavaScript Source: https://github.com/tari-project/tari/blob/development/docs/src/09_adding_tari_to_your_exchange.md This JavaScript code defines a `PayRefVerificationService` class that interacts with a Tari wallet via gRPC to verify payment references (PayRefs). It handles service initialization, PayRef format validation, asynchronous gRPC calls to `GetPaymentByReference`, and processes the response to determine payment status (VERIFIED, INSUFFICIENT_CONFIRMATIONS, NOT_FOUND, INVALID_FORMAT, ERROR). It also includes a usage example demonstrating how to handle different verification outcomes. ```javascript const grpc = require('@grpc/grpc-js'); const protoLoader = require('@grpc/proto-loader'); // PayRef verification service class PayRefVerificationService { constructor(walletGrpcEndpoint) { // Load the protobuf const PROTO_PATH = './proto/wallet.proto'; const packageDefinition = protoLoader.loadSync(PROTO_PATH, { keepCase: true, longs: String, enums: String, defaults: true, oneofs: true }); const walletProto = grpc.loadPackageDefinition(packageDefinition).tari.rpc; // Create secure gRPC client this.client = new walletProto.Wallet(walletGrpcEndpoint, grpc.credentials.createInsecure()); } /** * Verify a PayRef provided by a customer * @param {string} payrefHex - 64-character hex PayRef from customer * @param {number} requiredConfirmations - Minimum confirmations needed (default: 10) * @returns {Promise} */ async verifyPayRef(payrefHex, requiredConfirmations = 10) { // Validate PayRef format if (!this.isValidPayRefFormat(payrefHex)) { return { status: 'INVALID_FORMAT', message: 'PayRef must be 64-character hexadecimal string' }; } try { // Call wallet gRPC to verify PayRef const response = await this.callGrpcMethod('GetPaymentByReference', { payment_reference_hex: payrefHex }); if (!response.payment_details) { return { status: 'NOT_FOUND', message: 'PayRef not found in received payments' }; } const payment = response.payment_details; const confirmations = parseInt(payment.confirmations); if (confirmations >= requiredConfirmations) { return { status: 'VERIFIED', paymentReference: payrefHex, amount: parseFloat(payment.amount), blockHeight: parseInt(payment.block_height), confirmations: confirmations, receivedTimestamp: new Date(parseInt(payment.mined_timestamp) * 1000), sufficientConfirmations: true }; } else { const blocksRemaining = requiredConfirmations - confirmations; return { status: 'INSUFFICIENT_CONFIRMATIONS', paymentReference: payrefHex, amount: parseFloat(payment.amount), confirmations: confirmations, requiredConfirmations: requiredConfirmations, blocksRemaining: blocksRemaining, message: `Payment found but needs ${blocksRemaining} more confirmations` }; } } catch (error) { console.error('PayRef verification error:', error); return { status: 'ERROR', message: 'Internal verification error' }; } } /** * Validate PayRef format */ isValidPayRefFormat(payrefHex) { return /^[0-9a-fA-F]{64}$/.test(payrefHex); } /** * Helper to call gRPC methods with promises */ callGrpcMethod(methodName, request) { return new Promise((resolve, reject) => { this.client[methodName](request, (error, response) => { if (error) { reject(error); } else { resolve(response); } }); }); } } // Usage example async function handleCustomerPayRefInquiry(customerId, payrefHex) { const verifier = new PayRefVerificationService('localhost:18143'); try { const result = await verifier.verifyPayRef(payrefHex); switch (result.status) { case 'VERIFIED': // Credit customer account await creditCustomerAccount(customerId, result.amount, payrefHex); console.log(`Payment verified: ${result.amount} XTR credited to customer ${customerId}`); return { success: true, message: 'Payment verified and account credited', details: result }; case 'INSUFFICIENT_CONFIRMATIONS': console.log(`Payment found but needs ${result.blocksRemaining} more confirmations`); return { success: false, message: `Payment found but needs ${result.blocksRemaining} more confirmations`, details: result }; ``` -------------------------------- ### Minotari Default Installation Artefacts File Structure Source: https://github.com/tari-project/tari/blob/development/applications/minotari_node/windows/README.md This snippet details the file and directory layout established by the Minotari installer within the user's profile directory. It outlines the locations for licenses, shortcuts, configuration files, runtime scripts, and executables, providing a clear overview of the installed components. ```text %USERPROFILE% |---.tari-testnet | LICENSE.md | LICENSE.txt | README.md | README.txt | start_all.lnk | start_minotari_node.lnk | start_minotari_console_wallet.lnk | start_minotari_merge_mining_proxy.lnk | start_minotari_miner.lnk | start_xmrig.lnk | start_tor.lnk | unins000.dat | unins000.exe |---config | config.toml |---runtime get_xmrig_win.ps1 install_sqlite.bat install_tor_services.bat install_vs2019_redist.bat install_xmrig.bat source_minotari_node_env.bat source_console_wallet_env.bat source_merge_mining_proxy_env.bat source_miner_env.bat source_xmrig_env.bat start_all.bat start_minotari_node.bat start_minotari_console_wallet.bat start_minotari_merge_mining_proxy.bat start_minotari_miner.bat start_tor.bat start_xmrig.bat minotari_node.exe minotari_console_wallet.exe minotari_merge_mining_proxy.exe minotari_miner.exe ``` -------------------------------- ### Clone Tari Project Source Code Source: https://github.com/tari-project/tari/blob/development/buildtools/build-notes.md Commands to create a source directory, navigate into it, and clone the Tari project repository from GitHub. ```bash mkdir -p ~/src cd ~/src git clone git@github.com:tari-project/tari.git cd tari ``` -------------------------------- ### Navigate to Ledger Wallet Directory in Docker (Windows) Source: https://github.com/tari-project/tari/blob/development/applications/minotari_ledger_wallet/wallet/README.md Changes the current directory inside the Docker container to the Ledger wallet application's source code location. ```dos cd /app/applications/minotari_ledger_wallet/wallet ``` -------------------------------- ### Build entire Tari project Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Initializes the Visual Studio build environment and then compiles the entire Tari project in release mode using Rust's cargo. This command builds all components of the Tari suite, which can be time-consuming. ```PowerShell & "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Auxiliary\Build\vcvars64.bat" cargo build --release ``` -------------------------------- ### Clone Tari project repository Source: https://github.com/tari-project/tari/blob/development/buildtools/windows-dev-environment-notes.md Navigates to a specified source directory, clones the official Tari project repository from GitHub, and then changes into the newly cloned directory. This command sequence prepares the local environment for building the Tari project. ```PowerShell cd src git clone https://github.com/tari-project/tari.git cd tari ``` -------------------------------- ### Update and Start Supervisord Services Source: https://github.com/tari-project/tari/blob/development/applications/minotari_node/linux/supervisord.md Commands Supervisord to reread its configuration files, apply any detected updates, and then initiate the `minotari_node` service. This brings the Tari node daemon online and under Supervisord's management. ```bash sudo supervisorctl reread sudo supervisorctl update sudo supervisorctl start minotari_node ```