This guide will help you get started with developing the Automated DDC Account Top-Up System for the hackathon. Follow the steps below to set up your environment, understand the deliverables, and begin contributing.
-
Locate the repository provided for this track.
-
Click on the "Fork" button in GitHub to create a copy of the repository under your account.
-
Clone the forked repository to your local machine using:
git clone https://github.com/your-username/repository-name.git cd repository-name
-
Install the required dependencies for Substrate development by following the official guide:
- Visit Polkadot-SDK Installation Guide.
- Ensure you have Rust (with
nightly
toolchain), Node.js, Yarn, and other prerequisites installed.
-
Verify installation by running:
rustup show cargo --version
-
Build the project to ensure all dependencies are correctly installed:
cargo build --release
-
Run existing tests to verify the setup:
cargo test
-
Navigate to the DDC Customer Pallet directory in your project.
-
Add new extrinsics for mandate creation, updating, and revocation. These extrinsics should handle:
- User-defined balance thresholds.
- Maximum top-up amounts.
-
Refer to this tutorial for guidance on adding extrinsics:
-
Update logic to trigger automatic top-ups when balance falls below thresholds.
- Integrate your new extrinsics with the existing DDC Customer Pallet features.
- Ensure compatibility with current account management functions.
-
Write unit tests for all newly added functionality using Substrate's test framework.
-
Add integration tests to verify seamless operation with existing pallet features.
-
Use Polkadot.js to create end-to-end tests simulating real-world scenarios.
-
Refer to this guide for testing:
-
Run tests using:
cargo test
- Deploy your updated pallet on a local Substrate node or testnet.
- Validate that:
- Mandates are created, updated, and revoked successfully.
- Automated top-ups trigger correctly when thresholds are breached.
- Record mandates on the CERE Mainnet blockchain as part of final integration.
- Use Polkadot.js for interacting with your blockchain during testing and validation.
- Follow best practices for Rust development and Substrate runtime coding.
- Collaborate effectively if working in a team by assigning roles (e.g., Rust Developer, Frontend Developer).
Good luck with your hackathon project! 🍀🚀