A Next.js application that dispenses test RBTC tokens on the Rootstock Testnet. Users can request test tokens through a web interface with reCAPTCHA protection and optional promo code functionality.
- Node.js 18+
- npm or yarn
- Create a
.envfile in the project root:
cp .env.example .env- Configure the following environment variables in your
.envfile:
# RSK Blockchain Configuration
RSK_NODE=https://public-node.testnet.rsk.co
FAUCET_ADDRESS=
FAUCET_PRIVATE_KEY=your_private_key_here
# Gas Configuration
GAS_PRICE=60000000
GAS_LIMIT=800000
# Dispense Values (in RBTC)
VALUE_TO_DISPENSE=0.0005
PROMO_VALUE_TO_DISPENSE=0.05
# Google reCAPTCHA Configuration
GOOGLE_CAPTCHA_URL=https://www.google.com/recaptcha/api/siteverify
SECRET_VERIFY_CAPTCHA=your_recaptcha_secret_key
NEXT_PUBLIC_SITE_KEY_CAPTCHA=your_recaptcha_site_key
# Google Tag Manager
NEXT_PUBLIC_TAG_MANAGER_ID=GTM-XXXXXXX
# Security & Rate Limiting
FILTER_BY_IP=true
TIMER_LIMIT=180000
# Promo Codes (JSON array format)
PROMO_CODE=[{"code":"TEST1","activationDate":"2025-01-01","expirationDate":"2025-12-31","maxDispensableRBTC":1}]- RSK Node: Set
RSK_NODEto your RSK Testnet node URL - Faucet Wallet: Configure
FAUCET_ADDRESSandFAUCET_PRIVATE_KEYwith a funded wallet - reCAPTCHA: Create a Google reCAPTCHA project and add your keys
- Promo Codes (optional): Configure promo codes as JSON array with the following format:
[ { "code": "PROMO1", "activationDate": "2025-01-01", "expirationDate": "2025-12-31", "maxDispensableRBTC": 1 } ]
- Install dependencies:
npm install- Start the development server:
npm run devThe application will be available at http://localhost:3000
- Build the application:
npm run build- Start the production server:
npm run prod- Build the Docker image:
docker build -t rbtc-faucet .- Run the container:
docker run -d --name rbtc-faucet -p 3000:3000 --env-file .env rbtc-faucetThe application will be available at http://localhost:3000
- Linting:
npm run lint - Start:
npm start(for production after build)
