Code Monkey home page Code Monkey logo

cosmos-faucet's Introduction

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 testnet full node, because it relies on using the gaiacli 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.

go get [email protected]:cosmos/faucet

Backend Setup

Production

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

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

Then build the backend.

go mod init github.com/enigmampc/faucet/backend
go mod tidy
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/cosmos/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.

cosmos-faucet's People

Contributors

greg-szabo avatar nylira avatar toml01 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.