samajammin / goerli-faucet

Production ready faucet for the Ethereum goerli testnet with an Angular app example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ethereum Goerli Testnet Faucet

This project defines a production ready faucet for the Ethereum Goerli test network, allowing users to receive 2 Goerli ETH every 24 hours to an address from a max of 5 different IP addresses (configurable). The API tracks IP addresses and wallet addresses which requested and flushes them out every 24 hours to allow them to request again the next day.

Running the Faucet API

Install Go here

Available flags are as follows:

  • -rpc-port, default: 5000, port to serve gRPC requests
  • -host, default: "127.0.0.1", host address to serve gRPC requests
  • -gateway-port, default: 8000, port to serve JSON-RPC requests
  • -gateway-host, default: 127.0.0.1, host address to serve JSON-RPC requests
  • -allowed-origins, default: "*", allowed origins for JSON-RPC requests, comma-separated
  • -captcha-host, default: "", host for the captcha
  • -captcha-secret, default: "", secret to verify recaptcha
  • -rpc, default: "", RPC address of a running geth node
  • -private-key, default: "", the private key of funder
  • -min-score, default: 0.9, minimum captcha score

Build the API:

make go

Run the API server:

./main \
  -rpc=<GETH_RPC> \
  -private-key=<GOERLI_PRIVATE_KEY_HEX> \
  -captcha-host=<CAPTCHA_HOST> \
  -captcha-secret=<CAPTCHA_SECRET>

You will have a JSON-RPC endpoint running on 127.0.0.1:8000 by default and a gRPC server on 127.0.0.1:5000, which can be accessed from your frontend.

Running the Example Angular Application

Update catpchaSiteKey in environment.ts

cd web
npm install
npm start

Then navigate to http://localhost:4200 and try it out!

About

Production ready faucet for the Ethereum goerli testnet with an Angular app example


Languages

Language:TypeScript 44.2%Language:Go 36.6%Language:HTML 8.2%Language:JavaScript 6.9%Language:CSS 3.0%Language:Makefile 1.1%