This guide will help you set up your development environment for StellarRoute.
- Rust 1.70+ (install via rustup)
- Docker and Docker Compose
- Git
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/envrustup target add wasm32-unknown-unknownOption 1: Install via Cargo (Recommended)
cargo install --locked soroban-cliOption 2: Install via Official Installer Script
# For macOS/Linux
curl -sSfL https://github.com/stellar/soroban-tools/releases/latest/download/soroban-install.sh | shOption 3: Manual Binary Download
- Visit Soroban Tools Releases
- Download the appropriate binary for your platform
- Extract and add to your PATH
Verify Installation:
soroban --versionNote: The Homebrew tap stellar/soroban/soroban is not currently available. Use one of the methods above instead.
git clone https://github.com/stellarroute/stellarroute.git
cd stellarroutedocker-compose up -dThis will start:
- PostgreSQL on port 5432
- Redis on port 6379
cargo buildcargo testCreate a .env file in the project root:
DATABASE_URL=postgresql://stellarroute:stellarroute_dev@localhost:5432/stellarroute
REDIS_URL=redis://localhost:6379
STELLAR_HORIZON_URL=https://horizon.stellar.org
SOROBAN_RPC_URL=https://soroban-rpc.testnet.stellar.org- See Architecture Documentation for system design
- See API Documentation for API reference
- See Contract Documentation for smart contract details
Symptoms: curl: (60) SSL certificate problem or error: could not download file
Linux fix:
sudo apt-get update && sudo apt-get install -y ca-certificates libssl-dev pkg-config
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shmacOS fix:
brew install openssl
export OPENSSL_DIR=$(brew --prefix openssl)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shWindows fix: Download the rustup-init.exe installer directly from https://rustup.rs and run it.
Behind a corporate proxy:
export HTTPS_PROXY=http://your-proxy:port
export HTTP_PROXY=http://your-proxy:port
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shThe installer modifies your shell profile but the current session may not have reloaded it.
source $HOME/.cargo/env # bash / zsh
# or restart your terminalrustup update stable
rustup default stable
rustc --version # should print 1.70 or higherLinux (Debian/Ubuntu):
sudo apt-get install -y build-essential gcc libssl-dev pkg-config
cargo install --locked soroban-climacOS:
xcode-select --install # installs Apple Command Line Tools
cargo install --locked soroban-clirustup target add wasm32-unknown-unknown
rustup target list --installed # verify it appearsCargo-installed binaries live in ~/.cargo/bin. Make sure this directory is on your PATH:
echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc # or ~/.zshrc
source ~/.bashrc
soroban --versionIf you previously installed an older version, force a reinstall:
cargo install --locked --force soroban-cli
soroban --versionLinux:
sudo systemctl start docker
sudo systemctl enable docker # start on bootmacOS/Windows: Open Docker Desktop from your Applications folder.
sudo usermod -aG docker $USER
newgrp docker # apply without logging out
docker ps # verifyFind and stop the conflicting process:
# Find the PID using the port
sudo lsof -i :5432
sudo lsof -i :6379
# Kill it (replace PID)
kill -9 <PID>
# Then start services again
docker-compose up -dAlternatively, override the host port in docker-compose.yml:
ports:
- "5433:5432" # use 5433 on the hostand update your .env:
DATABASE_URL=postgresql://stellarroute:stellarroute_dev@localhost:5433/stellarroutedocker-compose down --volumes --remove-orphans
docker-compose up -dThe container may still be starting. Wait for the health check to pass:
docker-compose ps # STATUS should show "(healthy)"
# or wait explicitly
until docker-compose exec postgres pg_isready -U stellarroute; do sleep 1; done- Verify the container is healthy:
docker-compose ps - Verify you can connect manually:
psql postgresql://stellarroute:stellarroute_dev@localhost:5432/stellarroute
- Confirm your
.envfile exists in the project root andDATABASE_URLmatches the credentials indocker-compose.yml.
cargo clean
cargo buildIf that fails, update your toolchain and retry:
rustup update stable
cargo buildLinux:
sudo apt-get install -y build-essential libssl-dev pkg-configmacOS:
xcode-select --install# Linux
sudo apt-get install -y libssl-dev pkg-config
# macOS
brew install openssl
export PKG_CONFIG_PATH=$(brew --prefix openssl)/lib/pkgconfig
cargo buildMake sure .env exists in the project root with all required variables:
DATABASE_URL=postgresql://stellarroute:stellarroute_dev@localhost:5432/stellarroute
REDIS_URL=redis://localhost:6379
STELLAR_HORIZON_URL=https://horizon.stellar.org
SOROBAN_RPC_URL=https://soroban-rpc.testnet.stellar.orgThe project reads environment variables at runtime. If you omit a required variable the service will refuse to start with a descriptive error.
| Variable | Default | Notes |
|---|---|---|
DATABASE_URL |
— | Required. Full PostgreSQL connection string. |
REDIS_URL |
— | Required. Redis connection string. |
STELLAR_HORIZON_URL |
https://horizon.stellar.org |
Stellar public Horizon API |
SOROBAN_RPC_URL |
https://soroban-rpc.testnet.stellar.org |
Soroban RPC endpoint |
Q: Do I need a Stellar account to run the project locally?
A: No. The indexer pulls public data from Horizon. A Stellar account is only needed if you plan to submit transactions.
Q: Why does cargo test fail with a database error?
A: Integration tests require a running PostgreSQL instance. Start it with docker-compose up -d and ensure DATABASE_URL is set.
Q: The API returns 429 Too Many Requests during testing.
A: The server enforces 100 req/min per IP. In tests, use a different IP or increase the rate limit in the test configuration.
Q: docker-compose up pulls images every time — how do I speed it up?
A: Images are cached locally after the first pull. Subsequent starts will be instant unless you run docker-compose pull.
Q: How do I reset the database to a clean state?
docker-compose down -v # removes volumes
docker-compose up -d # fresh database
cargo run --bin stellarroute-indexer -- migrate # re-run migrationsQ: Where do I report a bug or ask for help?
Open an issue on GitHub or join the discussion in the repository's Discussions tab.
After completing setup, confirm everything works:
# 1. Rust toolchain
rustc --version # e.g. rustc 1.77.0
cargo --version
soroban --version
# 2. Services healthy
docker-compose ps # both postgres and redis show "(healthy)"
# 3. Build succeeds
cargo build
# 4. Unit + integration tests pass
cargo test
# 5. API starts
cargo run --bin stellarroute-api
# In another terminal:
curl http://localhost:8080/health # should return {"status":"healthy",...}