Skip to content

Xone Faucet is a lightweight Web3 faucet that provides testnet tokens for blockchain development and testing. Built with Node.js and Prisma, it supports PM2 for stable deployment.

Notifications You must be signed in to change notification settings

hello-xone/xone_faucet

Repository files navigation

Xone Faucet

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.

Environment Requirements

Ensure your development environment meets the following requirements:

  • Node.js v20.*
  • npm / yarn

Development Setup

  1. Install dependencies
    yarn install
  2. Initialize the database If the database is not set up, run the following command to create it:
    npx prisma migrate deploy
  3. Start the local development server
    yarn dev

Environment Variable Configuration

Use the .env file to configure the database and other necessary settings.

Example .env (Database Configuration)

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 and .env.production

.env.local is usually the same as .env.production.

Production Deployment

1. Configure Environment Variables

Example .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"

2. Start the Service

  1. Install dependencies
    yarn install
  2. Run database migration (if not initialized)
    npx prisma migrate deploy
  3. Install PM2 and run the application
    sudo npm install -g pm2
    pm2 start ecosystem.config.js --env production

Additional Tools

To package the project, use the following command:

zip -r xone-faucet.zip . -x "node_modules/*" ".next/*" ".git/*"

Contribution

Community contributions are welcome! If you have suggestions for improvements or encounter any issues, feel free to submit an Issue or a Pull Request.

License

This project is released under the MIT License. See the LICENSE file for details.

About

Xone Faucet is a lightweight Web3 faucet that provides testnet tokens for blockchain development and testing. Built with Node.js and Prisma, it supports PM2 for stable deployment.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5