Page cover image

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

  1. Fork the repository

  2. Clone your fork:

git clone https://github.com/yourusername/equilink.git
cd equilink
  1. Create a new branch:

git checkout -b feature/your-feature-name

Development Environment Setup

  1. Install development dependencies:

pip install -r requirements-dev.txt
  1. 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

  1. Update documentation if needed

  2. Add tests for new features

  3. Run the test suite:

pytest
npm test
  1. Push to your fork:

git push origin feature/your-feature-name
  1. 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

  1. Update relevant .md files in the /docs directory

  2. Generate API documentation:

make docs
  1. Test documentation locally:

mkdocs serve

Documentation Style

  • Use clear, concise language

  • Include code examples

  • Provide step-by-step instructions

  • Add diagrams when helpful

  1. Code Review Requirements:

    • Two approvals required

    • All CI checks must pass

    • Documentation updated

    • Test coverage maintained

  2. Review Checklist:

    • Code follows style guide

    • Tests are comprehensive

    • Documentation is clear

    • Performance impact considered

    • Security implications reviewed

  1. Version Bump:

bumpversion patch  # or minor/major
  1. Update CHANGELOG.md

  2. Create release PR

  3. 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