Thank you for contributing to Cortex Staking API.
The main branch is protected.
All changes must be submitted through a Pull Request.
Direct commits to main are not permitted.
Before merging:
- All tests must pass.
cargo checkmust pass.cargo testmust pass.- Database migrations must be reviewed.
- OpenAPI documentation must be updated if routes change.
- Version numbers must be updated according to Semantic Versioning.
A review from jhuhnke is required before merging into main.
The project follows:
MAJOR.MINOR.PATCH
Examples:
0.1.0
0.2.0
1.0.0
1.1.1
Increment when:
- Existing API routes change behavior
- Request schemas change incompatibly
- Response schemas change incompatibly
- Authentication behavior changes incompatibly
Example:
1.2.0 -> 2.0.0
Increment when:
- New routes are added
- New blockchain support is added
- New features are added
- Changes are backwards compatible
Example:
1.2.0 -> 1.3.0
Increment when:
- Bugs are fixed
- Tests are added
- Documentation changes
- Refactors
- Dependency updates
- Performance improvements
Example:
1.2.0 -> 1.2.1
- Rust
- Docker Desktop
- SQLx CLI
Start Postgres:
docker compose -f docker-compose.local.yml up -dRun migrations:
sqlx migrate runRun development seed:
Get-Content dev\seed_dev.sql | docker exec -i cortex-staking-postgres psql -U cortex -d cortex_staking_apiRun the API:
cargo run -p cortex-staking-apiRun tests:
cargo testStart Postgres:
docker compose -f docker-compose.local.yml up -dRun migrations:
sqlx migrate runRun development seed:
docker exec -i cortex-staking-postgres psql -U cortex -d cortex_staking_api < dev/seed_dev.sqlRun the API:
cargo run -p cortex-staking-apiRun tests:
cargo test- Create feature branch
- Implement changes
- Add or update tests
- Update OpenAPI documentation
- Update version number
- Open Pull Request
- Request review from jhuhnke
- Merge into main after approval