Git Product home page Git Product logo

faucet's Introduction

Terra Testnet Faucet

banner

Terra Testnet Faucet is a client tool that allows anyone to easily request a nominal amount of Terra or Luna assets for testing purposes. This app needs to be deployed on a Terra testnet full node, because it relies on using the terracli command to send tokens.

WARNING: Tokens recieved over the faucet are not real assets and have no market value.

This faucet implementation is a fork of the Cosmos Faucet.

Get tokens on the Terra Soju Testnet

Using the testnet is really easy. Simply go to https://faucet.terra.money and input your testnet address.

If you don't have a testnet address, or don't know what the Soju testnet is, please refer to setup docs for more info.

Deploying your own faucet

The faucet app offers both a backend and a frontend. Here we offer instructions to deploy both.

Deploy faucet server (backend)

You must have terrad installed and running on your machine before deploying the faucet server. Follow setup docs to deploy Terrad if you haven't already.

Get reCAPTCHA Key

Go to the Google reCAPTCHA Admin and create a new reCAPTCHA site. For the version of captcha, choose reCAPTCHA v2.

In the file ./frontend/src/views/Faucet.vue on line 60, change the sitekey to your new reCAPTCHA client side integration site key.

sitekey: "6LdqyV0UAAAAAEqgBxvSsDpL2aeTEgkz_VTz1Vi1"

Set ENV Variables

The faucet requires 4 different enviroment variables to set in order to function. They are:

  1. mnemonic, seed mnemonic of your faucet account.
  2. lcd, the address of your terracli rest-server node (probably don't have to change)
  3. chain-id, the chain id of the testnet.

Copy the default settings on the main directory's env-example.json file to env.json and set the relevant variables.

Build

You need to have Golang and Yarn/Node.js installed on your system.

go get github.com/terra-project/faucet
cd $GOPATH/src/github.com/terra-project/faucet
dep ensure

cd frontend
yarn && yarn build
cd ..

Run

This will run the faucet on port 8080. It's highly recommended that you run a reverse proxy with rate limiting in front of this app.

go run faucet.go RECAPTCHA_SERVER_SIDE_SECRET

Deploy faucet client (frontend)

Deploying the faucet frontend is simple. It is a trivial React app.

From the topmost directory, run:

cd $GOPATH/src/github.com/terra-project/faucet/frontend
npm install
npm start 

This should start the faucet web server on localhost:3000.

Read the frontend docs for more detailed instructions.

Optional: Caddy

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. Change the URL to best fit your purposes.

faucet's People

Contributors

hanjukim avatar cui-di avatar dokwon avatar ziwon avatar yun-yeo avatar dependabot[bot] avatar ny6234 avatar bluedisk avatar brianterra 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.