Faucet
This faucet app allows anyone who passes a captcha to request tokens for a Antlia account address. This app needs to be deployed on a Antlia testnet full node, because it relies on using the antliacli command to send tokens.

Prerequisites

reCAPTCHA

If you don't have a reCAPTCHA site setup for the faucet, now is the time to get one. Go to the Google reCAPTCHA Admin and create a new reCAPTCHA site. For the version of captcha, choose reCAPTCHA v2.

Checkout Code

The backend requires Go and the dep dependency tool to be installed. For the frontend, you also need to have node.js and the yarn dependency tool installed.
1
go get [email protected]:antlia/antlia-faucet
Copied!

Backend Setup

Production

First, set the environment variables for the backend, using ./backend/.env as a template:
1
cd $GOPATH/src/github.com/antlia/antlia-faucet/backend
2
cp .env .env.local
3
vi .env.local
Copied!
Then build the backend.
1
dep ensure
2
go build faucet.go
Copied!
The following executable will run the faucet on port 8080.
1
./faucet
Copied!
WARNING: It's highly recommended to run a reverse proxy with rate limiting in front of this app. Included in this repo is an example Caddyfile that lets you run an TLS secured faucet that is rate limited to 1 claim per IP per day

Development

Run go run faucet.go in the backend directory to serve the backend.

Frontend Setup

Production

First, set the environment variables for the frontend, using ./frontend/.env as a template:
1
cd $GOPATH/src/github.com/antlia/antlia-faucet/frontend
2
cp .env .env.local
3
vi .env.local
Copied!
Then build the frontend.
1
yarn
2
yarn build
Copied!
Lastly, serve the ./frontend/dist directory with the web server of your choice.

Development

Run yarn serve in the frontend directory to serve the frontend with hot reload.
Last modified 1yr ago