Added comprehensive documentation including: - API.md: REST API reference. - CLI.md: Command Line Interface usage. - ARCHITECTURE.md: System design and components. - DEVELOPMENT.md: Developer guide. - README.md: Index for the documentation.
1.6 KiB
1.6 KiB
Mining Development Guide
This guide is for developers contributing to the Mining project.
Prerequisites
- Go: Version 1.24 or higher.
- Make: For running build scripts.
- Node.js/npm: For building the frontend (optional).
Common Tasks
The project uses a Makefile to automate common tasks.
Building
Build the CLI binary for the current platform:
make build
Build for all supported platforms (cross-compile):
make build-all
The binaries will be placed in the dist/ directory.
Testing
Run all Go tests:
make test
Run tests with race detection and coverage:
make test-release
Generate and view HTML coverage report:
make coverage
Linting & Formatting
Format code:
make fmt
Run linters (requires golangci-lint):
make lint
Documentation
Generate Swagger documentation from code annotations:
make docs
(Requires swag tool: make install-swag)
Release
The project uses GoReleaser for releases. To create a local snapshot release:
make package
Project Structure
pkg/mining: This is where the core logic resides. If you are adding a new feature, you will likely work here.cmd/mining: If you are adding a new CLI command, look here.ui: Frontend code.
Contribution Workflow
- Fork the repository.
- Create a feature branch.
- Make your changes.
- Ensure tests pass (
make test). - Submit a Pull Request.
CodeRabbit
This project uses CodeRabbit for automated code reviews. Please address any feedback provided by the bot on your PR.