2.2 KiB
2.2 KiB
Contributing
Contributions are welcome! Here's how to get involved.
Getting Started
- Fork the repository
- Clone your fork
- Create a feature branch
- Make your changes
- Submit a pull request
Development Setup
Prerequisites
- Go 1.21+
- Node.js 20+
- Make
Clone and Build
git clone https://github.com/yourusername/Mining.git
cd Mining
# Build backend
make build
# Build frontend
cd ui && npm install && ng build
Code Style
Go
- Run
make lintbefore committing - Follow standard Go conventions
- Use meaningful variable names
- Add comments for exported functions
TypeScript/Angular
- Use standalone components
- Follow Angular style guide
- Use TypeScript strict mode
Testing
Backend Tests
make test # All tests
go test -v ./pkg/mining/... # Specific package
go test -run TestName ./... # Single test
E2E Tests
cd ui
npm run e2e # All E2E tests
npm run e2e:api # API tests only
npm run e2e:ui # Interactive mode
Pull Request Guidelines
- One feature per PR - Keep changes focused
- Write tests - Add tests for new functionality
- Update docs - Update relevant documentation
- Describe changes - Clear PR description
- Pass CI - All tests must pass
Adding a New Miner
To add support for a new miner:
- Create
pkg/mining/newminer.go - Implement the
Minerinterface - Register in
manager.go - Add UI support if needed
- Write tests
- Document the miner
Example structure:
type NewMiner struct {
*BaseMiner
// miner-specific fields
}
func NewNewMiner() *NewMiner {
return &NewMiner{
BaseMiner: NewBaseMiner("newminer", "newminer"),
}
}
func (m *NewMiner) Start(cfg *Config) error {
// Implementation
}
func (m *NewMiner) GetStats() (*PerformanceMetrics, error) {
// Implementation
}
Reporting Issues
When reporting bugs:
- Check existing issues first
- Include system information
- Provide steps to reproduce
- Include relevant logs
- Attach screenshots if UI-related
License
By contributing, you agree that your contributions will be licensed under the project's license.