Thank you for your interest in contributing to StellarStream! This guide will help you get started with our development process.
Check out the FAQ.md for common contributor questions and troubleshooting tips.
Follow these steps to go from zero to a running local environment with passing tests.
- Node.js 18+ and npm 9+
- Git
- Rust toolchain (only needed for contract work) — install via rustup.rs
-
Fork the repository — Click the Fork button at the top of the StellarStream repo on GitHub.
-
Clone your fork
git clone https://github.com/YOUR_USERNAME/stellar-stream.git cd stellar-stream -
Install all dependencies (backend + frontend)
npm run install:all
-
Set up environment variables
cp backend/.env.example backend/.env
Edit
backend/.envand fill in required values. For local-only development (no deployed contract), set:SOROBAN_DISABLED=true -
Start the development servers
# Start both backend and frontend npm run dev # Or start individually: npm run dev:backend # API on http://localhost:3001 npm run dev:frontend # UI on http://localhost:3000
-
Run backend tests
cd backend && npm test
-
Run frontend tests
cd frontend && npm test
-
Run contract tests (requires Rust toolchain)
cd contracts && cargo test
-
Run all contract tests including snapshot updates
cd contracts && cargo insta review
If you need to work with on-chain stream operations, set up a local Soroban testnet environment.
- Rust toolchain with
wasm32-unknown-unknowntarget:rustup target add wasm32-unknown-unknown
- soroban-cli (Stellar CLI):
cargo install soroban-cli
- Stellar testnet account funded with testnet XLM
-
Fund a testnet account using Friendbot:
curl "https://friendbot.stellar.org/?addr=YOUR_PUBLIC_KEY"Replace
YOUR_PUBLIC_KEYwith your testnet account's public key (G...). -
Deploy the contract to testnet:
SECRET_KEY="S..." npm run deploy:contractThis builds the contract with
wasm-opt -O4optimization and deploys it to Stellar testnet. The contract ID is saved tocontracts/contract_id.txt. -
Copy the contract ID to your backend
.env:CONTRACT_ID=<paste-contract-id-here> -
Set your server private key in
.env:SERVER_PRIVATE_KEY=S... -
Generate TypeScript bindings for the frontend:
CONTRACT_ID=$(cat contracts/contract_id.txt) npm run gen:bindings -
Verify everything works — restart the backend and run the full test suite:
cd backend && npm test
For frontend or API-only development without a contract, set SOROBAN_DISABLED=true in your backend .env. Never use this mode in production.
Error: EADDRINUSE: address already in use :::3001
Fix: Stop the process using the port, or configure a different port via the PORT env var:
# Find and kill the process
netstat -ano | findstr :3001
taskkill /PID <PID> /F
# Or use a different port
# macOS / Linux:
PORT=3002 npm run dev:backend
# Windows (PowerShell):
$env:PORT=3002; npm run dev:backendError: FATAL: Missing required environment variable: XXX
Fix: Copy the example env file and fill in the values:
cp backend/.env.example backend/.envSet SOROBAN_DISABLED=true if you're not deploying the contract locally.
Error: tx_bad_seq or Account not found when deploying
Fix: Ensure the account has been funded before deploying. Verify using Horizon:
curl "https://horizon-testnet.stellar.org/accounts/YOUR_PUBLIC_KEY"The response should show a balances array with a positive XLM balance. If the account exists but isn't funded, use Friendbot again.
Error: [Circuit Breaker] State Transition: OPEN
Fix: The circuit breaker prevents flooding a failing Stellar RPC node. Wait 60 seconds for automatic recovery. If it persists:
- Check your internet connection to Stellar testnet
- Verify
STELLAR_RPC_URLin your.env - Set
SOROBAN_DISABLED=truefor local-only development
Error: error[E0463]: can't find crate for core
Fix: Add the WebAssembly target and rebuild:
rustup target add wasm32-unknown-unknown
cargo build -p stellar-stream-contract --releaseBefore submitting a pull request, ensure your changes meet the following criteria:
- Code follows existing patterns and conventions in the repository
- No debug logs,
console.log, orTODOcomments left in production code - Error handling follows the
sendApiErrorpattern (consistent error responses) - New environment variables are documented in
.env.example(if applicable) - Database migrations use the
addColumnIfMissingpattern indb.ts(if applicable)
- Backend tests pass:
cd backend && npm test - Frontend tests pass:
cd frontend && npm test - Contract tests pass (if applicable):
cd contracts && cargo test - New features include test coverage
- Snapshot tests updated (if contract events changed):
cargo insta review - Manual testing done in a local environment
- Public API changes are reflected in the OpenAPI/Swagger spec
-
FAQ.mdupdated if adding new common questions or errors -
README.mdupdated if changing setup instructions or architecture
- Linting passes:
npx eslint .(backend) andcd frontend && npm run lint - CI workflows pass (triggered automatically on push)
- No new secrets or credentials committed (checked by gitleaks)
- PR title follows conventional commit format:
type(scope): description - PR description explains the motivation and approach
- Related issue(s) referenced in the description using
Fixes: #<issue>orCloses: #<issue> - Changes scoped to a single logical feature or fix (avoid unrelated changes)