Prerequisites
Before you begin, ensure you have the following tools installed:Install Rust
Install Rustup, the Rust toolchain installer:
Install Docker
Install Docker Desktop to run the XMTP node and other services.After installation, make sure Docker Desktop is running.
Install Foundry
Install Foundry for Ethereum development tools:
Environment Setup Options
You can set up your development environment using one of three methods:Method 1: Standard Setup
Start Docker Desktop, then install dependencies and start background services:- Installs required dependencies
- Creates and runs an XMTP node in Docker Desktop
- Sets up other necessary services
Method 2: Nix Setup (Recommended)
LibXMTP supports Determinate Nix for reproducible development environments with pinned toolchains for Rust, Android, iOS, WebAssembly, and Node.js.To temporarily disable/enable direnv:
Method 3: Dev Containers
For containerized development using Visual Studio Code:- Install the Dev Containers extension
- Open the command palette and select “Reopen in Container”
- Select the Dockerfile as the target
Managing Dependencies
When adding Rust dependencies, you must regenerate theworkspace-hack crate:
Optionally verify correctness:
Managing Backend Services
Start Services
Stop Services
Using Just Command Runner
LibXMTP usesjust as a command runner for common development tasks.
List all available commands:
Next Steps
Now that your environment is set up:- Learn about Testing
- Explore Benchmarks
- Read the Contributing Guidelines
