Thank you for your interest in contributing to Fula Storage! This document provides guidelines and information for contributors.
- Rust 1.83 or later
- Docker and Docker Compose (for running IPFS locally)
- Git
-
Clone the repository
git clone https://github.com/functionland/fula-api cd fula-api -
Start the development stack
docker-compose up -d ipfs cluster
-
Build the project
cargo build
-
Run tests
cargo test -
Run the gateway locally
cargo run --package fula-cli -- --no-auth --debug
fula-api/
├── crates/
│ ├── fula-crypto/ # Cryptographic primitives
│ ├── fula-blockstore/ # IPFS block storage
│ ├── fula-core/ # Storage engine
│ ├── fula-cli/ # Gateway server
│ └── fula-client/ # Client SDK
├── examples/ # Usage examples
├── docs/ # Documentation
└── tests/ # Integration tests
- Follow the Rust API Guidelines
- Run
cargo fmtbefore committing - Run
cargo clippyand address warnings - Add documentation for public APIs
Use conventional commit format:
type(scope): description
[optional body]
[optional footer]
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Build/tooling changes
Examples:
feat(core): add Prolly Tree diff algorithm
fix(gateway): handle multipart upload timeout
docs(readme): add S3 compatibility examples
- Fork the repository
- Create a feature branch:
git checkout -b feat/my-feature - Make your changes
- Add tests for new functionality
- Ensure all tests pass:
cargo test - Run lints:
cargo fmt && cargo clippy - Push and create a Pull Request
- Write unit tests for all new functions
- Add integration tests for API endpoints
- Test with real IPFS nodes when possible
- Aim for >80% code coverage
# Run all tests
cargo test
# Run with logging
RUST_LOG=debug cargo test
# Run specific test
cargo test test_prolly_tree
# Run benchmarks
cargo benchfula-crypto: Pure cryptographic functions, no I/Ofula-blockstore: Block-level operations, IPFS interactionfula-core: Business logic, bucket/object managementfula-cli: HTTP layer, S3 API translation
- Use
thiserrorfor error types - Propagate errors with context
- Map internal errors to S3 error codes at the gateway layer
- Use
tokiofor async runtime - Prefer
async_traitfor async trait methods - Avoid blocking operations in async contexts
- Add rustdoc comments for public APIs
- Include examples in documentation
- Update README.md for user-facing changes
- Update OpenAPI spec for API changes
Please report security vulnerabilities privately to security@fx.land. Do not create public issues for security problems.
- Never log sensitive data (keys, tokens)
- Validate all user input
- Use constant-time comparison for secrets
- Follow cryptographic best practices
- Open a GitHub issue for bugs or features
- Join our Discord for discussions
- Check existing issues before creating new ones
By contributing, you agree that your contributions will be licensed under the MIT/Apache-2.0 dual license.