Skip to content

Latest commit

 

History

History
173 lines (124 loc) · 3.79 KB

File metadata and controls

173 lines (124 loc) · 3.79 KB

Contributing

Thanks for your interest in contributing to Distributed Computer. All contributions earn Hogwarts Coin (HWC) based on our fair compensation model.

Please take a moment to review this document before submitting your first pull request. We also strongly recommend checking for open issues and pull requests to see if someone else is working on something similar.

If you need any help, feel free to open a discussion.

About this repository

This repository is a Cargo workspace with multiple crates.

crates/
├── dc-core/       # Core types and traits
├── dc-network/    # P2P networking (libp2p)
├── dc-consensus/  # Proof of Contribution + Resource
├── dc-storage/    # RocksDB persistence
├── dc-oracle/     # GitHub/Git integration
└── dc-node/       # CLI binary

Structure

Path Description
crates/ Rust crates (workspace members)
docs/ Documentation, epics, stories
.claude/commands/ AI agent commands
CLAUDE.md Project orchestration
PROMPT.md Session documentation

Development

Prerequisites

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install protobuf (for libp2p)
brew install protobuf  # macOS
apt install protobuf-compiler  # Ubuntu

Setup

  1. Clone the repository:
git clone https://github.com/databayt/distributed-computer.git
cd distributed-computer
  1. Build all crates:
cargo build
  1. Run tests:
cargo test --all

Commands

# Build release
cargo build --release

# Run all tests
cargo test --all

# Lint with clippy
cargo clippy --all-targets --all-features -- -D warnings

# Format code
cargo fmt --all

# Check without building
cargo check --all

# Generate docs
cargo doc --no-deps --open

Contribution Model

Categories & Weights

Category Weight Examples
Technical 40% Code, bugs, architecture
Community 30% Tutorials, translations
Strategy 20% Proposals, research
Ecosystem 10% Blog posts, integrations

Point Formula

Final Value = (Base Points × Quality × Impact) ÷ Hours
Minimum: $45/hour equivalent

Quality Multipliers

  • Has tests: +0.5x
  • Has documentation: +0.3x
  • Review approvals: +0.2x each
  • CI passes: +0.2x

Commit Convention

This project uses Conventional Commits.

# Format
<type>(<scope>): <message>

# Examples
feat(network): implement peer discovery
fix(consensus): correct point calculation
docs(readme): update crate descriptions
test(core): add contribution validation tests
refactor(storage): optimize RocksDB queries
chore(deps): update libp2p to 0.54

Types

  • feat – New feature
  • fix – Bug fix
  • docs – Documentation only
  • style – Formatting, no code change
  • refactor – Code change, no feature/fix
  • test – Adding tests
  • chore – Maintenance tasks

Pull Request Process

  1. Fork the repository
  2. Create a branch: git checkout -b feat/your-feature
  3. Make changes following code standards
  4. Run tests: cargo test --all
  5. Run lints: cargo clippy --all-targets
  6. Commit with conventional format
  7. Push and create pull request
  8. Wait for review

Code Standards

Follow the Rust API Guidelines:

  • All public types implement Debug
  • Use thiserror for error types
  • Use tracing for logging
  • Document all public APIs
  • Write tests for new functionality

Claiming Points

After your PR is merged:

  1. Create a Contribution Claim issue
  2. Link your PR
  3. Provide metrics (lines, hours)
  4. Receive HWC after validation

License

By contributing, you agree that your contributions will be licensed under the MIT License.