Xone Faucet is a simple and efficient Web3 faucet application that allows users to request tokens on the test network for development and testing purposes. This project utilizes Node.js and Prisma for database management and supports PM2 for production deployment.
Ensure your development environment meets the following requirements:
- Node.js v20.*
- npm / yarn
- Install dependencies
yarn install
- Initialize the database
If the database is not set up, run the following command to create it:
npx prisma migrate deploy
- Start the local development server
yarn dev
Use the .env file to configure the database and other necessary settings.
DB_HOST="localhost"
DB_NAME="xone-faucet"
DB_USER="postgres"
DB_PWD="root"
DATABASE_URL="postgresql://${DB_USER}:${DB_PWD}@${DB_HOST}:5432/${DB_NAME}?schema=public".env.local is usually the same as .env.production.
NEXT_PUBLIC_RECAPTCHA_SITE_KEY="your-site-key"
RECAPTCHA_SECRET_KEY="your-secret-key"
TESTNET_PK="your-private-key"
TESTNET_RPC="https://rpc.xonetest.plus"
NEXT_PUBLIC_EXPLORER="https://testnet.xscscan.com"
ASSET_PREFIX="https://faucet.xone.plus"- Install dependencies
yarn install
- Run database migration (if not initialized)
npx prisma migrate deploy
- Install PM2 and run the application
sudo npm install -g pm2 pm2 start ecosystem.config.js --env production
To package the project, use the following command:
zip -r xone-faucet.zip . -x "node_modules/*" ".next/*" ".git/*"Community contributions are welcome! If you have suggestions for improvements or encounter any issues, feel free to submit an Issue or a Pull Request.
This project is released under the MIT License. See the LICENSE file for details.