The Bastyon project operates an open contributor model where anyone is welcome to contribute towards development in the form of peer review, testing, and patches. This document explains the practical process and guidelines for contributing.
First, in terms of structure, there is no particular concept of "Bastyon developers" in the sense of privileged people. Open source often naturally revolves around a meritocracy where contributors earn trust from the developer community over time. Nevertheless, some hierarchy is necessary for practical purposes. As such, there are repository maintainers who are responsible for merging pull requests, the release cycle, and moderation.
New contributors are very welcome and needed.
Reviewing and testing is highly valued and the most effective way you can contribute as a new contributor. It also will teach you much more about the code and process than opening pull requests. Please refer to the peer review section below.
Before you start contributing, familiarize yourself with the Bastyon build system and tests:
- Browser-based application architecture
- Proxy server SSL handling
- Blockchain node operation
- Content validation and consensus mechanisms
The codebase is maintained using the "contributor workflow" where everyone without exception contributes patch proposals using "pull requests" (PRs). This facilitates social contribution, easy testing, and peer review.
To contribute a patch, the workflow is as follows:
- Fork repository
- Create topic branch
- Commit patches
For different types of contributions, use the appropriate repository:
- Frontend changes: browser-based Bastyon app repository
- Proxy server changes: SSL proxy repository
- Node changes: blockchain node repository
- Core protocol changes: main protocol repository
In general, commits should be atomic and diffs should be easy to read. For this reason, do not mix any formatting fixes or code moves with actual code changes.
Commit messages should be verbose by default consisting of:
- Short subject line (50 chars max)
- Blank line
- Detailed explanatory text
Example:
consensus: Update content validation rules for multimedia
This commit implements new validation rules for multimedia content
in the blockchain nodes. The changes include:
- Enhanced format verification
- Size limit enforcement
- Metadata validation
The title of the pull request should be prefixed by the component or area that the pull request affects. Valid areas are:
consensus
for changes to consensus critical codefrontend
for changes to the browser appdesktop
for changes to the desktop appios
for changes to the iOS appandrid
for changes to the android appmessenger
for changes to messengernode
for changes to blockchain nodesprotocol
for changes to the network protocoldoc
for changes to documentationtest
for changes to test suitebuild
for build system changessraking
for changes to staking protocol
When making changes, consider the content flow architecture:
- Browser-based content creation
- HTTPS transmission to proxy
- Proxy processing
- Node validation
- Network consensus
- Confirmation flow
Anyone may participate in peer review which is expressed by comments in the pull request. Project maintainers take into account the peer review when determining if there is consensus to merge a pull request.
Concept ACK
- Agrees with the general goalConcept NACK
- Disagrees with the general goal (must provide reasoning)Approach ACK/NACK
- Agrees/disagrees with implementation approach
After conceptual agreement, reviewers should:
- Test the code (manual + automated tests)
- Review the code quality
- Verify consensus compliance
- Check documentation
- Look for previous contributors in the area you're changing
- Ask in development channels
- Be patient and respect maintainers' time
- Contribute reviews to others while waiting
- Follow existing code style
- Write clear documentation
- Include comprehensive tests
- Handle errors appropriately
- Consider performance implications
- Unit tests for new functionality
- Integration tests for system interactions
- Consensus validation tests
- Network propagation tests
- Performance benchmarks
- Follow security best practices
- Validate all inputs
- Protect user privacy
- Consider network attack vectors
- Implement proper encryption
Whether a pull request is merged into Bastyon rests with the project maintainers. Pull requests must:
- Have a clear use case
- Be well peer-reviewed
- Include appropriate tests
- Follow code style guidelines
- Not break existing tests
- Include relevant documentation
Changes affecting consensus rules require:
- Extensive discussion
- Formal proposal
- Network-wide consideration
- Careful security review
This contribution guidelines have been largerly based on the Bitcoin's Contributing document
By contributing to this repository, you agree to license your work under the project's license unless specified otherwise. Any work contributed where you are not the original author must contain its license header with the original author(s) and source.