Get CarbonLedger running locally in under 30 minutes.
Before starting, ensure you have:
- Node.js 18+ installed
- Rust 1.74+ installed
- Python 3.10+ installed
- PostgreSQL 14+ installed and running
- Git installed
Not sure? Run the verification script:
# Linux/macOS
./scripts/verify-setup.sh
# Windows
.\scripts\verify-setup.ps1# Clone repository
git clone https://github.com/YOUR_USERNAME/carbonledger.git
cd carbonledger
# Copy environment file
cp .env.example .env
# Edit .env and set these minimum values:
# - DATABASE_URL=postgresql://carbonledger:changeme@localhost:5432/carbonledger
# - JWT_SECRET=your-random-secret-key# Add WebAssembly target
rustup target add wasm32-unknown-unknown
# Install Stellar CLI (optional, for deployment)
cargo install --locked stellar-cli --version 21.0.0# Create database
createdb carbonledger
# Or on Linux with sudo:
sudo -u postgres createdb carbonledger
sudo -u postgres psql -c "CREATE USER carbonledger WITH PASSWORD 'changeme';"
sudo -u postgres psql -c "GRANT ALL PRIVILEGES ON DATABASE carbonledger TO carbonledger;"# Backend
cd backend
npm install
npx prisma generate
npx prisma migrate dev
cd ..
# Frontend
cd frontend
npm install
cd ..
# Oracle (Python)
cd oracle
pip3 install -r requirements.txt
cd ..
# Contracts (Rust)
cd contracts
cargo build --target wasm32-unknown-unknown --release
cd ..# All tests
./scripts/test-all.sh
# Or individually:
cd contracts && cargo test # Rust tests (30 tests)
cd backend && npm test # Backend tests
cd frontend && npm test # Frontend testsYou should see:
✓ Carbon Registry Tests passed
✓ Carbon Credit Tests passed
✓ Carbon Marketplace Tests passed
✓ Carbon Oracle Tests passed
✓ Backend Unit Tests passed
✓ Frontend Unit Tests passed
All tests passed! ✓
You're ready to contribute! 🚀
# Terminal 1: Backend
cd backend
npm run start:dev
# → http://localhost:3001
# Terminal 2: Frontend
cd frontend
npm run dev
# → http://localhost:3000
# Terminal 3: Database (if using Docker)
docker-compose up postgres redis-
Get testnet XLM:
stellar keys generate alice --network testnet --fund
-
Deploy contracts:
cd contracts stellar contract deploy \ --wasm target/wasm32-unknown-unknown/release/carbon_registry.wasm \ --source alice \ --network testnet -
Save contract IDs to
.env
- Install Freighter extension
- Create wallet or import existing
- Switch to Testnet in settings
- Visit
http://localhost:3000
If you prefer Docker:
# Copy environment file
cp .env.example .env
# Start all services
docker-compose up --build
# Services will be available at:
# - Frontend: http://localhost:3000
# - Backend: http://localhost:3001
# - PostgreSQL: localhost:5432
# - Redis: localhost:6379Note: You still need Rust toolchain for contract development.
- Full Setup Guide: CONTRIBUTING.md
- Troubleshooting: docs/TROUBLESHOOTING.md
- Architecture: docs/adr/
- API Documentation: backend/docs/PROJECTS_API.md
# macOS
brew services start postgresql@16
# Linux
sudo systemctl start postgresql
# Windows
net start postgresql-x64-16# Update Rust
rustup update
# Install build tools
# macOS: xcode-select --install
# Linux: sudo apt install build-essential
# Windows: Install Visual Studio Build Tools# Clean and rebuild
cd contracts
cargo clean
cargo build --target wasm32-unknown-unknown --release
cargo test- Run:
./scripts/verify-setup.sh(or.ps1on Windows) - Check: docs/TROUBLESHOOTING.md
- Ask: GitHub Discussions
| Step | Time | What's Happening |
|---|---|---|
| Clone & Configure | 2 min | Download code, setup .env |
| Rust Toolchain | 3 min | Install wasm32 target, Stellar CLI |
| Database Setup | 2 min | Create PostgreSQL database |
| Install Dependencies | 5 min | npm install, cargo build, pip install |
| Run Tests | 10 min | 30 Rust tests + Backend + Frontend |
| Total | ~22 min | Ready to contribute! |
Times are approximate and depend on internet speed and hardware.
Once all tests pass, you can:
- Browse good first issues
- Read the architecture decisions
- Start building features
- Submit your first PR
Welcome to CarbonLedger! 🌍