Contributing to Equilink
Thank you for your interest in contributing to Equilink! This document provides guidelines and best practices for contributing to the project.
Getting Started
Fork the repository
Clone your fork:
git clone https://github.com/yourusername/equilink.git
cd equilink
Create a new branch:
git checkout -b feature/your-feature-name
Development Environment Setup
Install development dependencies:
pip install -r requirements-dev.txt
Install pre-commit hooks:
pre-commit install
Coding Standards
We follow these coding standards:
Python
Follow PEP 8 style guide
Use type hints for function arguments and return values
Maximum line length of 88 characters (Black formatter)
Docstrings for all public methods and classes (Google style)
Example:
from typing import List, Optional
def process_transaction(
amount: float,
token_address: str,
recipient: Optional[str] = None
) -> List[dict]:
"""Process a blockchain transaction.
Args:
amount: The transaction amount.
token_address: The token contract address.
recipient: Optional recipient address.
Returns:
List of transaction receipts.
Raises:
TransactionError: If the transaction fails.
"""
# Implementation
JavaScript/TypeScript
Use ESLint with Airbnb configuration
Use Prettier for formatting
Use TypeScript for type safety
Testing
Writing Tests
Write unit tests for all new features
Maintain test coverage above 85%
Use pytest for Python tests
Use Jest for JavaScript tests
Example test:
import pytest
from equilink.core import Transaction
def test_transaction_validation():
tx = Transaction(amount=1.0, token="ETH")
# Test valid transaction
assert tx.validate() is True
# Test invalid amount
with pytest.raises(ValueError):
Transaction(amount=-1.0, token="ETH")
Pull Request Process
Update documentation if needed
Add tests for new features
Run the test suite:
pytest
npm test
Push to your fork:
git push origin feature/your-feature-name
Open a Pull Request with:
Clear title and description
Link to any related issues
Screenshots/videos for UI changes
List of testing steps
Commit Messages
Follow conventional commits specification:
<type>(<scope>): <description>
[optional body]
[optional footer]
Types:
feat: New feature
fix: Bug fix
docs: Documentation changes
style: Code style changes
refactor: Code refactoring
test: Adding tests
chore: Maintenance tasks
Example:
feat(trading): implement automatic gas optimization
- Add gas price monitoring
- Implement dynamic gas adjustment
- Add configuration options
Closes #123
Updating Documentation
Update relevant .md files in the /docs directory
Generate API documentation:
make docs
Test documentation locally:
mkdocs serve
Documentation Style
Use clear, concise language
Include code examples
Provide step-by-step instructions
Add diagrams when helpful
Code Review Requirements:
Two approvals required
All CI checks must pass
Documentation updated
Test coverage maintained
Review Checklist:
Code follows style guide
Tests are comprehensive
Documentation is clear
Performance impact considered
Security implications reviewed
Version Bump:
bumpversion patch # or minor/major
Update CHANGELOG.md
Create release PR
After merge, create GitHub release
Join our Discord channel
Check existing issues
Tag maintainers in comments
Attend community calls
Contributors are recognized in:
Release notes
Community announcements
Thank you for contributing to Equilink!
Last updated