Thank you for your interest in contributing to AnchorKit! This document provides guidelines and instructions for contributing to this project.
- Code of Conduct
- Getting Started
- Development Environment Setup
- Makefile Shortcuts
- Running Tests
- Code Style Guidelines
- Branch Naming Conventions
- Pull Request Process
- Issue and PR Templates
- Documentation
By participating in this project, you agree to abide by our Code of Conduct. Please be respectful and constructive in all interactions.
- Fork the repository on GitHub
- Clone your fork locally:
git clone https://github.com/YOUR_USERNAME/AnchorKit.git cd AnchorKit - Add upstream remote:
git remote add upstream https://github.com/Haroldwonder/AnchorKit.git
- Create a feature branch (see Branch Naming Conventions)
AnchorKit is built using Rust and the Soroban SDK for Stellar smart contracts.
-
Install Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source $HOME/.cargo/env
-
Install Soroban CLI:
cargo install --locked soroban-cli
-
Add WASM target:
rustup target add wasm32-unknown-unknown
-
Verify installation:
rustc --version soroban --version
The UI components are built with React and TypeScript.
-
Install Node.js (v18 or later recommended):
# Using nvm (recommended) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash nvm install 18 nvm use 18
-
Install UI dependencies:
cd ui npm install -
Verify installation:
node --version npm --version
A Makefile is provided at the project root for common tasks:
make build # cargo build --release
make test # cargo test
make lint # cargo clippy -- -D warnings
make fmt # cargo fmt
make clean # cargo clean
make deploy-testnet # deploy to Stellar testnet
make help # list all targetsNote: Requires
make(available by default on Linux and macOS).
Run the complete test suite for the Rust crate:
# Run all tests
cargo test
# Run tests with verbose output
cargo test --verbose
# Run specific test module
cargo test domain_validator
# Run tests with output
cargo test -- --nocaptureRun the test suite for the UI components:
cd ui
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage
npm run test:coverageValidate configuration files:
# Linux/macOS
./validate_all.sh
# Windows
.\validate_all.ps1- Formatting: Use
rustfmtto format your codecargo fmt
- Linting: Use
clippyto catch common issuescargo clippy -- -D warnings
- Documentation: Add doc comments for public APIs
- Error Handling: Use the
AnchorKitErrortype for error handling
- Linting: Use ESLint with the project configuration
cd ui npm run lint - Type Checking: Ensure TypeScript compilation passes
cd ui npm run type-check - Formatting: Follow the project's ESLint configuration
- Write clear, descriptive commit messages
- Keep commits focused and atomic
- Add tests for new functionality
- Update documentation as needed
- Follow existing code patterns and conventions
Use descriptive branch names with the following prefixes:
feature/- New featuresfix/- Bug fixesdocs/- Documentation updatesrefactor/- Code refactoringtest/- Test additions or modificationschore/- Maintenance tasks
Examples:
feature/add-session-managementfix/domain-validation-edge-casedocs/update-api-specification
-
Update your branch with the latest upstream changes:
git fetch upstream git rebase upstream/main
-
Ensure all tests pass:
cargo test cd ui && npm test
-
Run linters:
cargo fmt cargo clippy -- -D warnings cd ui && npm run lint
-
Commit your changes:
git add . git commit -m "feat: descriptive commit message"
-
Push to your fork:
git push origin feature/your-feature-name
-
Create a Pull Request on GitHub
-
Fill out the PR template with:
- Description of changes
- Related issue numbers
- Testing performed
- Screenshots (if applicable)
- All PRs require at least one approval
- Address review feedback promptly
- Keep PRs focused and reasonably sized
- Update documentation if needed
- Ensure CI checks pass
When creating an issue, please include:
- Description: Clear description of the issue or feature
- Steps to Reproduce: For bugs, provide steps to reproduce
- Expected Behavior: What should happen
- Actual Behavior: What actually happens
- Environment: OS, Rust version, Node version
- Screenshots: If applicable
When creating a PR, please include:
- Description: What does this PR do?
- Related Issues: Link to related issues (e.g., "Closes #123")
- Type of Change: Bug fix, feature, documentation, etc.
- Testing: How was this tested?
- Checklist:
- Tests added/updated
- Documentation updated
- Code formatted with rustfmt/prettier
- Linter passes
- QUICK_START.md - Quick reference guide with examples
- README.md - Main project documentation
- API_SPEC.md - API specification and error codes
- IMPLEMENTATION_GUIDE.md - Technical implementation details
- Use clear, concise language
- Include code examples
- Keep documentation up-to-date with code changes
- Use Markdown formatting
If you have questions or encounter issues:
- Check the documentation
- Search existing issues
- Create a new issue if needed
Thank you for contributing to AnchorKit!