๐ XP & Achievements System โ
Track your learning progress with our gamified XP and achievements system! Earn points, unlock badges, and see how you rank.
Overview โ
The leaderboard system provides:
- XP Tracking - Earn points for completing tutorials and challenges
- Achievements - 8 unique badges to unlock
- Progress Visualization - See your learning journey
- Leaderboard - Compare with other developers
Quick Commands โ
# View your current XP and rank
npm run progress
# View all achievements (locked & unlocked)
npm run achievements
# View the global leaderboard
npm run quest:leaderboardXP System โ
How to Earn XP โ
| Activity | XP Reward |
|---|---|
| Complete a tutorial | 100-500 XP |
| Pass a test suite | 50 XP per test |
| Build a working example | 75 XP |
| Complete playground quest | 100-200 XP |
| Unlock achievement | Bonus 50-200 XP |
Rank Progression โ
| Rank | XP Required | Title |
|---|---|---|
| ๐ฅ | 0 | Novice Developer |
| ๐ฅ | 500 | Apprentice Builder |
| ๐ฅ | 1,000 | Transaction Crafter |
| ๐ | 2,000 | Token Master |
| ๐ | 5,000 | Contract Wizard |
| ๐ | 10,000 | Ergo Legend |
Achievements โ
๐ฏ Available Achievements โ
๐ First Transaction โ
Build your first valid transaction
Requirement: Complete Tutorial 1
Reward: 100 XP + Badge
๐ช Token Handler โ
Successfully transfer tokens
Requirement: Complete Tutorial 2
Reward: 150 XP + Badge
๐จ NFT Creator โ
Mint your first NFT
Requirement: Complete Tutorial 3
Reward: 200 XP + Badge
๐ Contract Interactor โ
Interact with a smart contract
Requirement: Complete Tutorial 4
Reward: 250 XP + Badge
๐งช Test Master โ
Pass all 86 tests
Requirement: Run npm test with 100% pass rate
Reward: 500 XP + Badge
๐ Testnet Explorer โ
Connect to Ergo testnet
Requirement: Successfully fetch UTXOs from testnet
Reward: 150 XP + Badge
๐ฎ Playground Champion โ
Complete all playground quests
Requirement: Finish all 8 arena quests
Reward: 300 XP + Badge
๐ Ergo Master โ
Complete everything!
Requirement: All tutorials + all tests + all quests
Reward: 1000 XP + Badge
Using the API โ
Check XP Progress โ
import { Leaderboard } from "../src/leaderboard";
const leaderboard = new Leaderboard();
const username = "developer123";
// Get user progress
const progress = leaderboard.getProgress(username);
console.log(`XP: ${progress.xp}`);
console.log(`Rank: ${progress.rank}`);
console.log(`Achievements: ${progress.achievements.length}`);Award XP โ
// Award XP for completing a task
leaderboard.awardXP(username, 100, "Completed Tutorial 1");
// Award achievement
leaderboard.unlockAchievement(username, "first_transaction");View Leaderboard โ
// Get top 10 users
const topUsers = leaderboard.getTopUsers(10);
topUsers.forEach((user, index) => {
console.log(`${index + 1}. ${user.name}: ${user.xp} XP`);
});Progress File โ
Your progress is stored locally in .fleet-progress.json:
{
"username": "developer123",
"xp": 850,
"rank": "Transaction Crafter",
"achievements": [
{
"id": "first_transaction",
"name": "First Transaction",
"unlockedAt": "2025-01-15T10:30:00Z"
}
],
"completedTutorials": [1, 2],
"testsPass": 86,
"lastActive": "2025-01-15T14:45:00Z"
}Displaying Progress โ
Terminal Output โ
$ npm run progress
๐ Fleet SDK Progress
โโโโโโโโโโโโโโโโโโโโโ
๐ค Developer: developer123
โญ XP: 850 / 1000
๐๏ธ Rank: ๐ฅ Apprentice Builder
๐ Progress: โโโโโโโโโโ 85%
๐
Achievements: 3/8
โ
First Transaction
โ
Token Handler
โ
NFT Creator
โฌ Contract Interactor
โฌ Test Master
โฌ Testnet Explorer
โฌ Playground Champion
โฌ Ergo Master
๐ Tutorials: 3/4 completed
๐งช Tests: 86/86 passingAchievements Output โ
$ npm run achievements
๐ All Achievements
โโโโโโโโโโโโโโโโโโโ
โ
๐ First Transaction
"Build your first valid transaction"
Unlocked: Jan 15, 2025
โ
๐ช Token Handler
"Successfully transfer tokens"
Unlocked: Jan 15, 2025
โฌ ๐จ NFT Creator
"Mint your first NFT"
Requirement: Complete Tutorial 3
โฌ ๐ Contract Interactor
"Interact with a smart contract"
Requirement: Complete Tutorial 4
...Customizing Achievements โ
You can add custom achievements by extending the leaderboard:
import { Leaderboard, Achievement } from "../src/leaderboard";
const leaderboard = new Leaderboard();
// Add custom achievement
const customAchievement: Achievement = {
id: "speed_demon",
name: "Speed Demon",
description: "Complete tutorial in under 5 minutes",
icon: "โก",
xpReward: 200
};
leaderboard.registerAchievement(customAchievement);Integration with CI/CD โ
Track progress automatically in your CI pipeline:
# .github/workflows/progress.yml
- name: Update Progress
run: |
npm test
if [ $? -eq 0 ]; then
npm run award-xp -- 50 "Passed all tests in CI"
fiNext Steps โ
- Start Tutorial 1 - Earn your first XP!
- Try the Playground - Complete quests for badges
- Connect to Testnet - Unlock explorer achievement