Skip to content
/ faucet Public
forked from cosmos/faucet

Token faucet web app for the Cosmos Hub and Gaia testnets.

Notifications You must be signed in to change notification settings

vitwit/faucet

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cosmos Testnet Faucet

This faucet app allows anyone who passes a captcha to request tokens for a Cosmos account address. This app needs to be deployed on a Cosmos SDK based full node, because it relies on using the binary to send tokens.

Note: This faucet backend works only for Cosmos SDK based application whose version is greater than or equal to v0.40.

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.

go get git@github.com:vitwit/faucet

Install Network Binary

Make sure to install network binary and add faucet account key in instance where you are going to run faucet backend.

Backend Setup

Production

First, set the environment variables for the backend, using ./backend/.env as a template:

cd $GOPATH/src/github.com/vitwit/faucet/backend
cp .env .env.local
vi .env.local

Then build the backend.

dep ensure
go build faucet.go

The following executable will run the faucet on port 8080.

./faucet

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:

cd $GOPATH/src/github.com/vitwit/faucet/frontend
cp .env .env.local
vi .env.local

Then build the frontend.

yarn
yarn build

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.

About

Token faucet web app for the Cosmos Hub and Gaia testnets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Vue 50.4%
  • Go 18.7%
  • JavaScript 17.8%
  • Stylus 6.9%
  • Shell 3.8%
  • HTML 2.4%