Welcome to CarbonLedger! This guide will help you go from zero to running tests locally in under 30 minutes.
We've created comprehensive guides to help you get started:
Quick Start Guide - Fastest path to running tests
- 5-step setup process
- Automated verification scripts
- Time breakdown for each step
- Success criteria checklist
Contributing Guide - Detailed setup with troubleshooting
- Exact version requirements for all tools
- Platform-specific instructions (macOS, Linux, Windows)
- Common setup errors with fixes
- Code style guidelines
- Development workflow
Setup Checklist - Step-by-step verification
- 30+ checkpoints to verify setup
- Commands to test each component
- Automated verification scripts
- Troubleshooting references
Troubleshooting Guide - Solutions to common issues
- Installation problems
- Build errors
- Database issues
- Test failures
- Platform-specific fixes
Testnet Guide - Complete testnet instructions
- Multiple faucet methods
- Freighter wallet setup
- Contract deployment
- Getting testnet USDC
- Testing interactions
-
Verify installed software:
# Run verification script ./scripts/verify-setup.sh # Linux/macOS .\scripts\verify-setup.ps1 # Windows
-
Install missing tools:
- Node.js 18+: nodejs.org
- Rust 1.74+: rustup.rs
- Python 3.10+: python.org
- PostgreSQL 14+: postgresql.org
# Clone repository
git clone https://github.com/YOUR_USERNAME/carbonledger.git
cd carbonledger
# Configure environment
cp .env.example .env
# Edit .env: Set DATABASE_URL and JWT_SECRET
# Setup Rust toolchain
rustup target add wasm32-unknown-unknown# Create database
createdb carbonledger
# Run migrations
cd backend
npx prisma migrate dev
cd ..# Backend
cd backend && npm install && cd ..
# Frontend
cd frontend && npm install && cd ..
# Oracle
cd oracle && pip3 install -r requirements.txt && cd ..
# Contracts
cd contracts && cargo build --target wasm32-unknown-unknown --release && cd ..# Run all tests
./scripts/test-all.sh
# Expected: All tests pass ✓You're ready to contribute when:
- ✅ All prerequisite software installed
- ✅ Database created and migrations applied
- ✅ All dependencies installed (npm, pip, cargo)
- ✅ Contracts built successfully
- ✅ All 30+ tests pass
- ✅ Development servers start without errors
# Verify setup
./scripts/verify-setup.sh
# Run all tests
./scripts/test-all.sh
# Start backend
cd backend && npm run start:dev
# Start frontend
cd frontend && npm run dev
# Build contracts
cd contracts && cargo build --target wasm32-unknown-unknown --release
# Run contract tests
cd contracts && cargo test| Issue | Solution |
|---|---|
| PostgreSQL not running | brew services start postgresql@16 (macOS)sudo systemctl start postgresql (Linux) |
| Rust build fails | xcode-select --install (macOS)sudo apt install build-essential (Linux) |
| npm permission errors | Use nvm or fix permissions |
| Database connection fails | Check DATABASE_URL in .env |
| Tests fail | Run ./scripts/verify-setup.sh |
Full troubleshooting: TROUBLESHOOTING.md
carbonledger/
├── contracts/ # Soroban smart contracts (Rust)
│ ├── carbon_registry/
│ ├── carbon_credit/
│ ├── carbon_marketplace/
│ └── carbon_oracle/
├── backend/ # NestJS API server
│ ├── src/
│ └── prisma/
├── frontend/ # Next.js 14 web app
│ ├── app/
│ ├── components/
│ └── lib/
├── oracle/ # Python oracle services
├── docs/ # Documentation
│ ├── QUICK_START.md
│ ├── TROUBLESHOOTING.md
│ ├── TESTNET_GUIDE.md
│ └── adr/ # Architecture decisions
└── scripts/ # Helper scripts
├── verify-setup.sh
└── test-all.sh
./scripts/test-all.sh# Rust contracts (30 tests)
cd contracts && cargo test
# Backend (NestJS)
cd backend && npm test
# Frontend (Next.js)
cd frontend && npm test| Component | Tests | Coverage |
|---|---|---|
| carbon_registry | 7 tests | Core functionality |
| carbon_credit | 10 tests | Mint, retire, transfer |
| carbon_marketplace | 7 tests | List, buy, sell |
| carbon_oracle | 6 tests | Monitoring, prices |
| Backend | Multiple | API endpoints |
| Frontend | Multiple | Components |
# 1. Generate and fund account
stellar keys generate alice --network testnet --fund
# 2. Deploy contracts
cd contracts
stellar contract deploy \
--wasm target/wasm32-unknown-unknown/release/carbon_registry.wasm \
--source alice \
--network testnet
# 3. Update .env with contract IDsFull guide: TESTNET_GUIDE.md
Browse Good First Issues
git checkout -b feat/your-feature-name- Write code
- Add tests
- Update documentation
./scripts/test-all.shgit commit -m "feat: add serial number validation"Follow Conventional Commits
git push origin feat/your-feature-nameCreate Pull Request on GitHub
- Architecture Decision Records - Why we made key decisions
- API Documentation - Backend API reference
- Smart Contracts - Contract functions
- NestJS - Backend framework
- Next.js - Frontend framework
- Prisma - Database ORM
- Rust - Smart contract language
- Check Troubleshooting Guide
- Review Contributing Guide
- Read Architecture Decisions
- GitHub Issues - Bug reports
- GitHub Discussions - Questions
- Discord - Real-time chat (if available)
Include:
- Operating system and version
- Node.js, Rust, Python versions
- Full error message
- Steps to reproduce
- Output of
./scripts/verify-setup.sh
Perfect for new contributors:
- Documentation improvements
- Test coverage additions
- Bug fixes with clear reproduction steps
- UI/UX enhancements
- Smart Contracts - Rust/Soroban development
- Backend API - NestJS/TypeScript
- Frontend - Next.js/React
- Oracle Services - Python
- Documentation - Markdown
- Testing - Jest, Cargo test
Once you've completed the setup:
- ✅ All tests pass
- ✅ Development servers start
- ✅ You understand the project structure
- ✅ You've read the contributing guidelines
Next steps:
- Browse open issues
- Join discussions
- Make your first contribution!
Verified on:
- ✅ macOS 13+ (Intel and Apple Silicon)
- ✅ Ubuntu 22.04 LTS
- ✅ Windows 11 with WSL2
- ✅ Windows 11 native (PowerShell)
Average setup time:
- Experienced developers: 15-20 minutes
- First-time setup: 25-30 minutes
- With troubleshooting: 30-45 minutes
Thank you for contributing to CarbonLedger! Every contribution helps build a more transparent and trustworthy carbon credit market.
Questions? Don't hesitate to ask in Discussions
Welcome to the team! 🌍