Swan Faucet is a pretty minimalistic faucet for Ethereum-based ERC20 tokens. It's based on a simple smart contract that will allow you to withdraw some tokens every couple of minutes. The amount of tokens and the waiting period can be defined upon deployment of the smart contract.
Technology Stack: node + react.js + web3
Running Swan Faucet as a container is the recommended way of using it.
https://docs.docker.com/compose/install/
Before deploying, you need to set environment variables in a .env
file inside the backend
directory, an
example .env.example
file is provided
WALLET_ADDRESS
the address of signer that will be calling the function on the server-sidePRIVATE_KEY
the private key of this wallet addressFAUCET_ADDRESS_MUMBAI
faucet contract addressRPC_URL_MUMBAI
the url of the RPC server/node (defaults tohttps://matic-mumbai.chainstacklabs.com
)PORT
the localhost port the server is running on (defaults to 5000)REDIS_HOST
the localhost port of the redis databaseFAUCET_ADDRESS_BINANCE_TESTNET
faucet contract addressRPC_URL_BINANCE_TESTNET
the url of the RPC server/node
For the frontend, you need to set environment variables inside the vue-frontend/config
directory
NODE_ENV
production or development,BASE_API
the base API for the UIBASE_NETWORK
the base RPC networkTOKEN_ADDRESS
the token addressFAUCET_ADDRESS
the address of the faucet contractMATIC_TOKEN_ADDRESS
native token addressGOOGLE_KEY
key for google recaptcha service
Run the following command to run the latest stable image of Swan Faucet
docker-compose up
You can check the service at:
Install npm
. (Version v14.18.1 of Node was used for this project) Both the front
and backend use npm
as the package manager.
Install redis.io
The backend uses a redis server to provide API rate limiting.
cd backend
npm install
cd ..
cd vue-frontend
npm install
cd ..
npm run build
should build the project. The build artifacts will be stored in the build/
directory
redis-server
node server