This guide will help you get the Aframp backend server up and running quickly.
-
Install Rust (if not already installed):
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env
-
Install PostgreSQL:
# Ubuntu/Debian sudo apt update sudo apt install postgresql postgresql-contrib # macOS brew install postgresql # Start PostgreSQL service sudo systemctl start postgresql # Linux brew services start postgresql # macOS
-
Install Redis:
# Ubuntu/Debian sudo apt install redis-server # macOS brew install redis # Start Redis service sudo systemctl start redis # Linux brew services start redis # macOS
-
Clone the repository:
git clone https://github.com/yourusername/aframp-backend.git cd aframp-backend -
Create database:
sudo -u postgres createdb aframp sudo -u postgres createuser -s $USER -
Configure environment:
cp .env.example .env
Edit
.envto match your setup:# For local development, these should work: STELLAR_NETWORK=testnet STELLAR_REQUEST_TIMEOUT=15 STELLAR_MAX_RETRIES=3 STELLAR_HEALTH_CHECK_INTERVAL=30 REDIS_URL=redis://127.0.0.1:6379 RUST_LOG=info -
Run the server:
cargo run
The server should start and show output like:
Starting Aframp backend service
Stellar client initialized successfully
Stellar Horizon is healthy - Response time: 123ms
=== Demo: Testing Stellar functionality ===
Account GCJRI5CIWK5IU67Q6DGA7QW52JDKRO7JEAHQKFNDUJUPEZGURDBX3LDX does not exist (this is expected for test addresses)
Aframp backend service started successfully
Once running, you can test:
-
Health check:
curl http://localhost:8000/health
-
Stellar account info (if you have a Stellar account):
curl "http://localhost:8000/api/stellar/account/GXXX..."
# Check if PostgreSQL is running
sudo systemctl status postgresql
# Create database if missing
sudo -u postgres createdb aframp# Check if Redis is running
redis-cli ping
# If not running, start it:
sudo systemctl start redis # Linux
brew services start redis # macOS# Update Rust
rustup update
# Clear build cache
cargo clean-
Run with auto-reload:
cargo install cargo-watch cargo watch -x run
-
Run tests:
cargo test -
Check code quality:
cargo clippy cargo fmt --check
- Explore the API endpoints in
src/main.rs - Check the database schema in
migrations/ - Review the Stellar integration in
src/chains/stellar/ - Look at the cache implementation in
src/cache/
- Check the full README.md for detailed documentation
- Review the CONTRIBUTING.md for development guidelines
- Look at the STELLAR_INTEGRATION.md for blockchain specifics