This repository contains a Next.js application that serves as a faucet for Electroneum (ETN) testnet tokens. It allows users to request ETN from the testnet by solving a CAPTCHA and provides a user-friendly interface for developers and testers interacting with the Electroneum testnet.
- ETN Testnet Integration: Connects to the ETN-SC RPC for testnet transactions.
- Rate Limiting: Ensures fair usage with Redis-based rate limiting.
- CAPTCHA Protection: Uses hCaptcha to prevent abuse.
- Modern Frontend: Built with Next.js for a responsive and efficient UI.
Before running this application, ensure you have the following:
- ETN-SC RPC: A running Electroneum testnet node with RPC access.
- Redis: For rate-limiting and session management.
- hCaptcha Account: For CAPTCHA verification.
git clone https://github.com/electroneum/etn-faucet.git
cd etn-faucetpnpm installCreate a .env.local file in the root directory and set the following variables:
# ETN-SC RPC
RPC_URL=<Your ETN-SC RPC endpoint>
# Faucet Private Key
PRIVATE_KEY=<Your faucet private key>
# Redis Configuration
REDIS_URL=<Your Redis connection URL>
# hCaptcha Configuration
HCAPTCHA_SECRET_KEY=<Your hCaptcha secret key>
# Public Configurations
NEXT_PUBLIC_RATE_LIMIT_COOLDOWN_PERIOD_HOURS=<Rate limit cooldown period in hours>
NEXT_PUBLIC_HCAPTCHA_SITE_KEY=<Your hCaptcha site key>
NEXT_PUBLIC_ETN_AMOUNT=<Amount of ETN to dispense per request>pnpm dev-
Build the application:
pnpm build
-
Start the production server:
pnpm start
The application will be accessible at http://localhost:3000.
- Navigate to the application in your browser.
- Enter your testnet ETN address.
- Solve the hCaptcha challenge.
- Submit the form to receive testnet ETN tokens.
You can deploy this application on any hosting provider that supports Node.js. Popular choices include:
Contributions are welcome! Feel free to open an issue or submit a pull request.
- Fork the repository.
- Create a feature branch (
git checkout -b feature/your-feature). - Commit your changes (
git commit -m 'Add some feature'). - Push to the branch (
git push origin feature/your-feature). - Open a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.
- Next.js for the awesome React framework.
- hCaptcha for CAPTCHA services.
- Redis for caching and rate limiting.
Feel free to reach out via GitHub Issues!