How to Contribute

Welcome to the Qsafe Wallet Open-Source Contribution. We are thrilled to open-source the Qsafe Wallet and invite developers to contribute to its growth. The Qsafe Wallet is built with Python and follows the design principles of Electrum.

This document will guide you through the steps to get started contributing to the Qsafe Wallet, running it locally, and submitting your changes.

Table of Contents

  1. Prerequisites

  2. Getting Started

  3. How to Contribute

  4. Coding Standards

  5. Testing Your Changes

  6. Submitting Pull Requests

  7. Code of Conduct

  8. Support


1. Prerequisites

Before contributing, ensure you have the following installed:

  • Python 3.x: We recommend using Python 3.8 or later. You can download it from here.

  • pip: Python’s package installer to manage dependencies.

  • Git: To clone the repository and manage your contributions.

  • Virtual Environment (optional): For isolating dependencies per project.

To check if Python and pip are installed, run:

python --version
pip --version

2. Getting Started

Clone the repository

To begin working on Qsafe Wallet, clone the repository to your local machine:

git clone https://github.com/your-organization/qsafe-wallet.git
cd qsafe-wallet

Create a virtual environment (optional but recommended)

It's good practice to create a virtual environment to manage dependencies:

python -m venv venv
source venv/bin/activate  # For Linux/MacOS
venv\Scripts\activate  # For Windows

Install dependencies

Once you're inside the project directory, install the required dependencies:

 python3 -m pip install ".[gui,crypto]"
 ./build_slhdsa # do ./build_slhdsa --clean if you want to clean the build

This will install the Python packages required to run and test Qsafe Wallet locally.

Running the Qsafe Wallet

Start the wallet server locally by running:

./run_qsafe

For debugging support use -v flag along with ./run_qsafe .


3. How to Contribute

There are several ways you can contribute to the Qsafe Wallet:

1. Fixing Bugs

  • Browse through the open issues on GitHub.

  • Pick a bug you can fix, investigate the problem, and submit a PR with your fix.

2. Adding Features

  • If you have a feature in mind, create an issue first to discuss it.

  • Work on the feature by extending or modifying the appropriate Python scripts and wallet modules.

3. Improving Documentation

  • If you notice missing or unclear documentation, feel free to improve it. We need detailed documentation to help new contributors.

4. Enhancing Security

  • Review and improve wallet security (e.g., improve private key handling, encryption).

  • Check for any security vulnerabilities that can be fixed.

5. Testing and Reviewing

  • Help test features by running the wallet with different scenarios.

  • Review pull requests submitted by others, ensuring code quality and consistency.


4. Coding Standards

To maintain high code quality, we follow certain coding standards:

  • Python Coding Style: We adhere to PEP 8 (Python Enhancement Proposal 8) standards.

  • Docstrings: All functions and classes should have appropriate docstrings explaining their purpose.

  • Use asyncio: Use asyncio for asynchronous tasks like handling RPC requests, wallet transactions, etc.

  • Logging: Use Python’s built-in logging module to log important actions or errors.

Code Formatting

We use black for automatic code formatting. To auto-format your code, run:

black .

5. Testing Your Changes

Before submitting your code, make sure to test your changes thoroughly.

Running Tests

You can run the test suite to ensure your changes do not break anything:

pytest - tv

To add tests for new features or bug fixes, write your tests in the tests directory. Ensure they follow existing patterns and test edge cases.


6. Submitting Pull Requests

Once you have made your changes, it's time to submit a pull request (PR).

Steps to submit a PR:

  1. Commit your changes: Write clear and descriptive commit messages.

  2. Push to a new branch:

    • Create a new branch for your feature or bug fix:

      git checkout -b your-feature-branch
      git push origin your-feature-branch
  3. Open a pull request: Go to the GitHub repository and create a PR from your branch to the main branch.

  4. Provide a detailed description: Explain the changes you've made and link any related issues.

Our maintainers will review your PR and give feedback. If everything looks good, your PR will be merged!


7. Code of Conduct

Please follow our Code of Conduct to create a welcoming and inclusive environment for all contributors. Be respectful and constructive in your interactions.


8. Support

If you need help, you can:

  • Browse the Issues tab on GitHub for open problems or feature requests.

  • Open a new Issue if you have a question or need clarification.

  • Join the Qsafe community on Discord or Forum to interact with other developers.

Last updated