Skip to content

Developer Setup

Vinod Sathyaseelan edited this page Aug 14, 2025 · 3 revisions

Developer Setup

This guide details the development environment setup for working with Ripple, including required tools, IDE configuration, and best practices.

Development Environment

Required Tools

  1. Rust Toolchain

    • Rust version 1.82.0 (current stable)
    • Install using rustup
    • Set default version:
      rustup default 1.82.0
  2. IDE Options

    • Visual Studio Code (recommended)
    • Neovim (alternative)
  3. Essential Extensions

    • Rust Analyzer
    • LLDB Debugger
    • GitLens (recommended)
  4. Code Quality Tools

    • clippy (Rust linter)
    • rustfmt (code formatter)
    • pre-commit hooks

SSH Configuration

For secure repository access, configure SSH keys:

  1. Create separate SSH key pairs for different environments

  2. Configure ~/.ssh/config:

     Host github.com
     Hostname github.com
     IdentityFile ~/.ssh/<private-key-oss>
     IdentitiesOnly yes
     User <github-username>
    
  3. Set environment variables:

    export GH_OSS_NAME="<your-github-username>"
    export GH_OSS_EMAIL="<your-github-email>"

IDE Configuration

VS Code Setup

  1. Rust Analyzer Settings Add to your user settings.json:

    {
      "rust-analyzer.check.command": "clippy",
      "rust-analyzer.checkOnSave.enable": true,
      "rust-analyzer.checkOnSave.command": "clippy"
    }
  2. Recommended Extensions

    • rust-analyzer
    • Better TOML
    • CodeLLDB
    • GitLens
    • Error Lens

Code Quality Tools

  1. Pre-commit Hooks

    # macOS
    brew install pre-commit
    # or using pip
    pip install pre-commit
    
    # Install hooks
    pre-commit install
  2. Code Coverage Run before pushing changes:

    ./coverage.sh

Testing Environment

Local Testing

  1. Mock Device Testing

    ./run.sh mock
  2. Sanity Tests

    ./run_sanity_on_mock_device.sh

Port Forwarding

For device testing, use the socat wrapper:

./socat.sh <device-ip> [as-host-ip]

Best Practices

  1. Code Quality

    • Run cargo fmt before commits
    • Address all clippy warnings
    • Maintain test coverage
    • Follow Rust API Guidelines
  2. Git Workflow

    • Use meaningful commit messages
    • Keep changes focused and atomic
    • Update documentation with code changes
    • Run tests before pushing
  3. Documentation

    • Document public APIs
    • Keep README files updated
    • Include examples for complex features

Clone this wiki locally