Thank you for your interest in contributing to Trace Protocol. This guide will help you get started.
- Node.js >= 18.0.0
- pnpm >= 8.0.0
- Rust >= 1.75.0 (for Foundry contract development)
- Python >= 3.10 (for ML training and inference)
- Ethereum CLI >= 1.17.0
- Foundry CLI >= 0.29.0
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/<your-username>/trace-protocol.git cd trace-protocol - Install dependencies:
pnpm install - Copy the environment template:
cp .env.example .env - Run the test suite to verify your setup:
pnpm test
trace-protocol/
packages/
scanner/ - Ethereum transaction listener and signal extraction
classifier/ - ML feature extraction and ONNX inference
verdict-engine/ - Verdict computation from classification output
api/ - REST and WebSocket API server
sdk/ - Client SDK for consumers
contracts/
trace-attestation/ - Foundry contract for on-chain verdicts
models/
training/ - Python training pipeline
inference/ - FastAPI inference server
tests/ - Integration and unit tests
docs/ - Architecture and API documentation
- Create a feature branch from
main:git checkout -b feat/your-feature - Use conventional prefixes:
feat/,fix/,docs/,refactor/,test/,chore/ - Keep branches focused on a single concern
- Make your changes in the appropriate package(s)
- Add or update tests for your changes
- Run linting:
pnpm lint - Run type checking:
pnpm typecheck - Run tests:
pnpm test - For Rust changes:
cargo clippyandcargo test - For Python changes:
pytest models/training/ models/inference/
Follow the Conventional Commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types: feat, fix, docs, refactor, test, chore, perf, ci
Scopes: scanner, classifier, verdict-engine, api, sdk, attestation, models, docs
Examples:
feat(classifier): add temporal drift detection features
fix(scanner): handle reconnection on RPC node failover
docs(api): update batch query endpoint documentation
- Push your branch to your fork
- Open a pull request against
main - Fill out the pull request template completely
- Ensure all CI checks pass
- Request review from relevant maintainers (see CODEOWNERS)
- Address review feedback with new commits (do not force-push during review)
PRs require approval from at least two maintainers before merging.
- Strict mode enabled
- No
anytypes without explicit justification in a comment - Prefer
interfaceovertypefor object shapes - Use named exports, not default exports
- Maximum line length: 100 characters
- Follow the Foundry framework conventions
- Run
cargo fmtbefore committing - All public functions must have doc comments
- Use
Resulttypes for fallible operations
- Follow PEP 8
- Use type hints for all function signatures
- Format with
blackand sort imports withisort - Docstrings in Google style
- Unit tests go in
tests/at the repo root - Each package should have meaningful test coverage
- Test file naming:
<package-name>.test.ts - Use descriptive test names that explain the expected behavior
- Use the GitHub issue templates for bug reports and feature requests
- Search existing issues before creating a new one
- Provide as much context as possible, including reproduction steps
Be respectful and constructive in all interactions. We are building open-source software together and value diverse perspectives. Harassment, discrimination, and bad-faith behavior will not be tolerated.
Open a discussion on GitHub or reach out to any of the maintainers listed in MAINTAINERS.md.