Monero Project Documentation

repository·master·Indexed 27 days ago

https://github.com/monero-project/monero

Core software implementation for Monero, a private, secure, and decentralized digital currency. This documentation covers the build process for nodes, wallets, and protocol logic, including dependency management via contrib/depends, bootstrappable builds using Guix, and platform-specific installation instructions for Debian/Ubuntu, Arch Linux, and Fedora.

Tokens
19.7K
Snippets
66
Records
123
Agent score
95%

What's inside Monero

  1. Use the wallet2_basic library to load and store historic wallet2 files

    master
    The wallet2_basic library provides a minimalistic interface specifically designed for the purpose of loading and storing historic wallet2 format wallet files. It is intended for use cases where full wallet functionality is not required, but access to the legacy wallet2 data format is necessary.
  2. Understand the Monero dependency build and caching system

    master

    Monero uses a specialized system for building and caching the dependencies required for the project. This system is designed to be builder and host agnostic, allowing binaries for various target OS/architectures to be created from different builder environments.

    Key characteristics include:

    • Deterministic Builds: The sysroot is wiped before each build, and only specified dependencies are installed, preventing side-effects from unknown files.
    • Timestamp Independence: Build requirements are determined by file presence rather than timestamps, making results easily distributable for automated builders.
    • Automated Verification: Sources are fetched and verified against defined checksums; the build will fail if they do not match.
    • Efficient Caching: A unique build-id is generated for each package based on a hash of its build recipe (Makefiles, package files, etc.) and its recursive dependencies. Packages are only rebuilt if their recipe or a dependency changes. Results are cached as tarballs for reuse.
    • Self-Cleaning: Build and staging directories are wiped after use, and old cached results are removed following successful builds.
  3. Install dependencies on Arch Linux

    master

    Install all required dependencies for Monero on Arch Linux using pacman.

    sudo pacman -Syu --needed base-devel cmake boost boost-libs openssl zeromq unbound libsodium libunwind readline python ccache doxygen graphviz qt5-tools hidapi libusb protobuf
  4. Install Guix using the official shell installer script or binary tarball

    master

    You can install Guix using the official methods maintained by Guix developers.

    • Shell installer script: The easiest method. It automatically performs most setup and works on nearly all Linux distributions. It only installs the latest release and requires root privileges. Note: Inspect the script before running it.
    • Binary tarball: A manual setup process that works on nearly all Linux distributions and allows you to install any release.

    Both methods are binary installations and require a high level of trust. For detailed instructions, refer to the GNU Guix Manual's Binary Installation section.

    Important: If you use the binary tarball, you may need to manually create an /etc/profile.d/guix.sh entry for better desktop integration (the shell script does this automatically). Changes to /etc/profile.d require logging out and back in to take effect.

  5. Build Monero on Raspberry Pi

    master

    For Raspberry Pi (tested on 5B with 64-bit OS), it is recommended to increase swap size before building. Use USE_SINGLE_BUILDDIR=1 make release to build.

    # Increase swap (optional but recommended)
    sudo /etc/init.d/dphys-swapfile stop
    sudo nano /etc/dphys-swapfile
    CONF_SWAPSIZE=2048
    sudo /etc/init.d/dphys-swapfile start
    
    # Build
    cd monero
    git checkout v0.18.5.1
    USE_SINGLE_BUILDDIR=1 make release
  6. Purge and uninstall Guix from the system

    master

    To completely remove Guix if an installation becomes unrecoverable:

    1. Uninstall the binary: Use the method used for installation (e.g., sudo apt purge guix or sudo make uninstall).
    2. Remove users and groups: Identify Guix users/groups with getent and remove them with userdel and groupdel.
    3. Clean up directories: Manually remove all Guix-related directories in /var/, /gnu/, /etc/, and user home directories.
  7. Install Monero via package managers

    master

    Monero can be installed using various distribution-specific package managers.

    Note: These packages are not maintained by Monero project contributors and have not undergone the same security review process.

    • Debian 12 (Bookworm) or later: sudo apt install monero
    • Arch Linux: sudo pacman -S monero
    • NixOS: nix-shell -p monero-cli
    • Guix: guix package -i monero
    • Alpine Linux: apk add monero
    • macOS (Homebrew): brew install monero
    sudo apt install monero
  8. Configure inbound anonymity connections

    master

    To allow other peers to connect to your node via Tor or I2P, use the --anonymous-inbound option. This requires that you have already configured the hidden service (e.g., in torrc) to forward traffic to your local monerod instance.

    Warning: The specified port for anonymous-inbound must be unique and is not used for blockchain sync.

    Syntax: --anonymous-inbound <hidden_service_address>:<local_port>,<local_ip>:<local_port>

  9. Prune the Monero blockchain

    master

    Pruning allows you to store a smaller version of the blockchain (approx. 95 GB) instead of the full version (approx. 280 GB). A pruned blockchain is functionally identical but can only serve part of the historical chain data to peers.

    • Initial Sync: Start the sync with the --prune-blockchain flag.
    • Existing Chain: Use the monero-blockchain-prune tool or run monerod with the --prune-blockchain option.

    Warning: Pruning an existing chain temporarily requires enough disk space to hold both the full and the pruned versions simultaneously.

    --prune-blockchain
  10. Perform `guix pull` as root for source builds

    master

    When building Guix from source, you must perform an initial guix pull as root to populate ${localstatedir}/guix/profiles/per-user/root/current-guix.

    Warning: Before running this, review your security model and adjust guix and guix-daemon flags, as guix pull may attempt to pull substitutes from servers.

    If you encounter the error error: while creating symlink '/root/.config/guix/current' No such file or directory, run sudo mkdir -p /root/.config/guix before retrying.

    sudo --login guix pull --branch=version-<latest-release-version>
    # or
    sudo --login guix pull --commit=<particular-commit>
  11. Install dependencies on Fedora

    master

    Install all required dependencies for Monero on Fedora using dnf.

    sudo dnf install gcc gcc-c++ cmake pkgconf boost-devel openssl-devel zeromq-devel unbound-devel libsodium-devel libunwind-devel readline-devel ccache doxygen graphviz qt5-linguist hidapi-devel libusb1-devel protobuf-devel protobuf-compiler