-
Notifications
You must be signed in to change notification settings - Fork 2
Getting Started
Welcome to the PeoPay-Core codebase! This page will help you set up your environment, install dependencies, and run tests so you can start contributing, experimenting, or integrating with the ecosystem.
-
Node.js & npm:
Install the latest LTS version of Node.js and ensurenpmis available. -
Git:
Ensure you have Git installed to clone the repository. -
Hardhat:
This project uses Hardhat as the development environment for compiling contracts, running tests, and deploying. Hardhat is installed as a dev dependency within the project. -
A Test Network (Optional):
If you plan to deploy to a testnet (e.g., Polygon’s Amoy), you’ll need an RPC endpoint and testnet funds for gas. Services like Alchemy or Infura can provide RPC URLs.
-
Fork (Optional):
If you plan to contribute, fork the repository on GitHub before cloning. -
Clone the Repository:
git clone https://github.com/PeoPay/PeoPay-Core.git cd PeoPay-Core
Install all required npm packages:
npm installThis will install Hardhat, OpenZeppelin contracts, and other dependencies specified in package.json.
Create a .env file (based on .env.example) to store sensitive info like private keys, RPC URLs, and API keys:
cp .env.example .envThen open .env and fill in:
-
PRIVATE_KEYfor deployment (if needed). -
INFURA_API_KEYorALCHEMY_KEYif you deploy to a testnet/mainnet. - Other variables as needed.
Compile the Solidity contracts:
npx hardhat compileIf successful, you’ll see a “Compiled successfully” message and generated artifacts in the artifacts/ directory.
The test suite ensures the integrity and functionality of the PeoPay-Core contracts. Run:
npx hardhat test- All tests are located in the
test/directory. - If tests pass, you should see green checkmarks and details of each test scenario.
For additional testing guidance, see the Testing & QA page.
To measure test coverage:
npx hardhat coverageOpen the generated coverage report in coverage/ to review which lines and branches are tested. Aim for high coverage before contributing new features or refactoring code.
To deploy contracts to a local Hardhat network:
npx hardhat run scripts/deploy_peocoin.jsAdjust the script and network:
npx hardhat run scripts/deploy_peocoin.js --network mumbaiFor more details on deploying to various networks, consult the Deployment & Configuration page.
Before submitting changes:
- Review code style and adhere to the project’s formatting and commenting guidelines.
- Run tests and coverage to ensure no regressions.
- Consider running static analysis tools like
slitherfor additional checks.
See the [CONTRIBUTING.md] file for detailed contribution guidelines.
- Contracts Overview: Dive deeper into the Contracts Overview page to understand each contract’s role and logic.
- Governance & DCS Parameters: Learn how to modify governance settings or DCS weights in the Governance & DCS Parameters page.
- FAQ: Check the FAQ if you encounter common issues or need clarification on typical scenarios.
By following these steps, you’ll have a functional development environment, an understanding of how to test the code, and a foundation to start exploring, contributing, and integrating with the PeoPay ecosystem. If you have any questions or run into issues, open a GitHub Issue or join our community channels for support.
PeoPay-Core Wiki
View on GitHub | peopay.io | docs.peopay.io
This content is licensed under the GNU GPLv3. For contributions and bug reports, see our CONTRIBUTING.md and SECURITY.md.
If you have suggestions to improve this Wiki, please open an issue or PR on the main repository!
- Home
- Getting Started
- Contracts Overview
- Deployment & Configuration
- Testing & QA
- Security & Audits
- Governance & DCS Parameters
- FAQ
External Links
Contributing & Security