Thank you for your interest in contributing to the Medusa Solana Payment Provider! This document provides guidelines and instructions for contributing.
- A working MedusaJS 2.0 backend project.
- Node.js 22 or higher.
npmoryarn.- Basic knowledge of TypeScript, MedusaJS, and the Solana blockchain.
To contribute to this project, you need to set it up within a Medusa backend.
-
Fork and Clone the Repository:
git clone https://github.com/your-username/medusa-payment-solana.git
-
Link the Module to Your Medusa Backend:
Navigate to the cloned directory and run:
npm link
Then, navigate to your Medusa backend's root directory and run:
npm link medusa-payment-solana
This will create a symbolic link, allowing you to see your changes in real-time without reinstalling.
-
Configure Your Medusa Backend:
In your Medusa backend's
.envfile, add the required environment variables. See theREADME.mdfor a full list of options.SOLANA_MNEMONIC="your 12 or 24-word mnemonic phrase" SOLANA_COLD_STORAGE_WALLET="your solana cold storage wallet address" COINGECKO_API_KEY="your coingecko api key if you use coingecko" -
Install Dependencies: In the
medusa-payment-solanadirectory, run:npm install
-
Create a Branch: Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name
-
Make Changes: Make your changes to the module's source code. Since the module is linked, your Medusa backend will automatically pick up the changes.
-
Write and Run Tests: Add or update tests for your changes. Run the test suite to ensure everything is working correctly:
npm test -
Build the Project: Ensure the project compiles successfully:
npm run build
-
Commit and Push: Commit your changes following the conventional commits format and push your branch.
-
Create a Pull Request: Create a pull request against the
mainbranch of the original repository.
Run the Jest test suite with:
npm testTo test the payment provider, you should perform real transactions on the Solana devnet or testnet. This involves setting up a storefront, creating an order, and completing a payment using a Solana wallet with devnet/testnet SOL.
This project uses ESLint and Prettier to maintain a consistent code style. Please ensure your code adheres to these standards before submitting a pull request.
- Update the
README.mdor other documentation if your changes require it. - Ensure your PR is up-to-date with the
mainbranch. - The PR will be reviewed and merged by a maintainer.
When reporting issues, please provide a clear description, steps to reproduce, and any relevant environment details.
By contributing to this project, you agree that your contributions will be licensed under its MIT License.