Skip to content

Latest commit

 

History

History
177 lines (122 loc) · 4.26 KB

File metadata and controls

177 lines (122 loc) · 4.26 KB

⚡ Quick Start (2 Minutes)

For Users Who Want to Enable SOL Rewards

What You Need:

  • Solana wallet (Phantom app)
  • SOL tokens to fund rewards
  • 5 minutes of time

Step 1: Get Wallet Address (30 seconds)

  1. Open Phantom wallet app
  2. Click your wallet name/icon
  3. Click "Copy address"
  4. Save it somewhere

You now have: REWARD_WALLET_ADDRESS

Step 2: Get Private Key (30 seconds)

⚠️ WARNING: This is SECRET. Never share!

  1. Phantom → Settings → Wallet Settings
  2. Click "Export Private Key"
  3. Enter your password
  4. Copy the key

You now have: REWARD_WALLET_PRIVATE_KEY

Step 3: Add to .env.local (1 minute)

In your project root, create/edit .env.local:

MONGODB_URI=mongodb+srv://username:password@cluster...
NODE_ENV=development

# SOL Rewards Configuration
REWARD_WALLET_ADDRESS=your_wallet_address_here
REWARD_WALLET_PRIVATE_KEY=your_private_key_here
SOLANA_RPC_URL=https://api.devnet.solana.com

⚠️ NEVER commit this file to GitHub!

Step 4: Fund Your Wallet (Optional but needed)

To send real rewards, you need SOL in the wallet:

For Testing (Free):

For Production (Real SOL):

  • Buy SOL from exchange (Coinbase, FTX, etc.)
  • Send to your REWARD_WALLET_ADDRESS
  • Use https://api.mainnet-beta.solana.com in SOLANA_RPC_URL

Step 5: Restart App (30 seconds)

npm run dev

Done! ✅

Users can now:

  • Report issues
  • Get verified automatically
  • Earn SOL tokens instantly!

🔍 Environment Variables Explained

Variable What It Is Where to Get It
MONGODB_URI Database connection MongoDB Atlas
REWARD_WALLET_ADDRESS Your Solana wallet Phantom app → Copy address
REWARD_WALLET_PRIVATE_KEY Your secret key Phantom app → Export key
SOLANA_RPC_URL Blockchain endpoint https://api.devnet.solana.com

⚙️ Configuration Examples

Development (Devnet - Free Testing)

MONGODB_URI=mongodb+srv://test:password@test.mongodb.net/urlmonitor
NODE_ENV=development
REWARD_WALLET_ADDRESS=4cP9fzMckHE9csbY5oSYSBeHJeWHwyPb72kf7EHbHeAJ
REWARD_WALLET_PRIVATE_KEY=your_devnet_private_key
SOLANA_RPC_URL=https://api.devnet.solana.com

Production (Mainnet - Real SOL)

MONGODB_URI=mongodb+srv://prod:password@prod.mongodb.net/urlmonitor
NODE_ENV=production
REWARD_WALLET_ADDRESS=your_mainnet_wallet
REWARD_WALLET_PRIVATE_KEY=your_mainnet_private_key
SOLANA_RPC_URL=https://api.mainnet-beta.solana.com

❓ Common Questions

Q: Can I test without real SOL?

A: Yes! Use devnet and get free test SOL from the faucet.

Q: What if I forget my private key?

A: You need to export it again from Phantom. There's no recovery.

Q: Is my private key safe?

A: Keep .env.local secret. Never commit to GitHub. Use .gitignore.

Q: How much SOL do I need?

A: For testing: free devnet SOL. For production: depends on rewards (0.01 SOL per report).

Q: Can I use multiple wallets?

A: For users: yes, each user can switch wallets. For rewards: you need one app wallet.


🚨 Troubleshooting

"Rewards not working"

Check:

  1. .env.local has all 3 variables
  2. ✅ Restarted app (npm run dev)
  3. ✅ Wallet is funded with SOL
  4. ✅ Private key is correct
  5. ✅ Using right RPC URL

"Invalid private key"

  • Don't include quotes around the key
  • Don't include spaces
  • Export directly from Phantom
  • Make sure it's the full key

"No SOL received"

  • Check wallet is funded
  • Check transaction in Solana Explorer
  • Verify recipient address is correct
  • Check logs for errors

📚 Complete Documentation

For more details:


✅ You're Ready!

  1. Add environment variables
  2. Restart app
  3. Test reporting issues
  4. Earn SOL! 🎉

Questions? Check the docs above!


Made with ❤️ for the Solana ecosystem