Development Setup
This guide will help you set up your development environment for contributing to Zoe Relay.
Prerequisites
Required Tools
- Rust: Version 1.85.0 or later
- Git: For version control
- SQLCipher: For encrypted database support
- Protobuf Compiler: For protocol buffer compilation
System Dependencies
Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libsqlcipher-dev protobuf-compiler cmake build-essential
macOS
brew install sqlcipher protobuf cmake
Windows
Use vcpkg or install dependencies manually.
Getting Started
1. Clone the Repository
git clone https://github.com/acter/zoe-relay.git
cd zoe-relay
2. Install Rust Dependencies
cargo fetch
3. Build the Project
cargo build
4. Run Tests
cargo test
Development Workflow
Code Formatting
We use rustfmt for consistent code formatting:
cargo fmt
Linting
Use clippy for additional linting:
cargo clippy
Documentation
Generate and view documentation:
cargo doc --open
Project Structure
zoe-relay/
├── crates/
│ ├── app-primitives/ # Core utilities and primitives
│ ├── client/ # Client library
│ ├── relay/ # Relay server implementation
│ ├── wire-protocol/ # Message formats and serialization
│ └── ...
├── docs/ # Documentation (this site)
└── target/ # Build artifacts
Environment Variables
Create a .env file based on env.example:
cp env.example .env
# Edit .env with your configuration
Running the Relay Server
cargo run --bin zoe-relay
IDE Setup
VS Code
Recommended extensions:
- rust-analyzer
- CodeLLDB (for debugging)
- Better TOML
Other IDEs
The project works with any IDE that supports Rust via rust-analyzer.
Troubleshooting
Common Issues
- SQLCipher not found: Ensure libsqlcipher-dev is installed
- Protobuf errors: Install protobuf-compiler
- Build failures: Try
cargo cleanand rebuild
For more help, see the Contributing Guide or open an issue on GitHub.