Skip to content

Ether faucet server built with Go and Svelte.

License

Notifications You must be signed in to change notification settings

chainflag/eth-faucet

Repository files navigation

eth-faucet

Build Release Report Go License

The faucet is a web application with the goal of distributing small amounts of Ether in private and test networks.

Get started

Prerequisites

  • Go (1.16 or later)
  • Node.js

Installation

  1. Clone the repository and navigate to the app’s directory
git clone https://github.com/chainflag/eth-faucet.git
cd eth-faucet
  1. Bundle Frontend web with Rollup
npm run build
  1. Build Go project
go build -o eth-faucet

Usage

  • Use private key as funder
./eth-faucet -httpport 8080 -wallet.provider http://localhost:8545 -wallet.privkey privkey
  • Use keystore as funder
./eth-faucet -httpport 8080 -wallet.provider http://localhost:8545 -wallet.keyjson `pwd`/keystore -wallet.keypass password.txt

Parameters

The following are the available parameters to the faucet app:

Basic Flags

Flag Description Default Value
-httpport Listener port to serve HTTP connection 8080
-proxycount Count of reverse proxies in front of the server 0
-queuecap Maximum transactions waiting to be sent 100

Faucet Flags

Flag Description Default Value
-faucet.amount Number of Ethers to transfer per user request 1
-faucet.minutes Number of minutes to wait between funding rounds 1440
-faucet.name Network name to display on the frontend testnet

Wallet Flags

Flag Description Default Value
-wallet.provider Endpoint for Ethereum JSON-RPC connection $WEB3_PROVIDER
-wallet.privkey Private key hex to fund user requests with $PRIVATE_KEY
-wallet.keyjson Keystore file to fund user requests with $KEYSTORE
-wallet.keypass Passphrase text file to decrypt keystore password.txt

Docker deployment

  • Use private key as funder
docker run -d -p 8080:8080 -e WEB3_PROVIDER=rpc endpoint -e PRIVATE_KEY=hex private key chainflag/eth-faucet:1.0.0
  • Use keystore as funder
docker run -d -p 8080:8080 -e WEB3_PROVIDER=rpc endpoint -e KEYSTORE=keystore path -v `pwd`/keystore:/app/keystore -v `pwd`/password.txt:/app/password.txt chainflag/eth-faucet:1.0.0

Heroku deployment

heroku create
heroku buildpacks:add heroku/nodejs
heroku buildpacks:add heroku/go
heroku config:set WEB3_PROVIDER=rpc endpoint
heroku config:set PRIVATE_KEY=hex private key
git push heroku main
heroku open

or

Deploy

License

Distributed under the MIT License. See LICENSE.txt for more information.