Skip to content

FuelLabs/faucet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

474768d · Oct 28, 2024

History

48 Commits
Oct 12, 2024
Oct 12, 2024
Nov 6, 2023
Oct 14, 2024
Oct 28, 2024
Oct 14, 2024
Apr 22, 2024
Oct 14, 2024
Oct 14, 2024
Aug 7, 2024
Apr 22, 2024

Repository files navigation

Faucet App

build discord

A simple faucet app for dispensing tokens on a fuel network. It uses Google captcha for spam resistance without requiring any social media based identification.

Configuration

The faucet makes use of environment variables for configuration.

Environment Variable Description
RUST_LOG EnvFilter configuration for adjusting logging granularity.
HUMAN_LOGGING If false, logs will be output as machine readable JSON.
CAPTCHA_SECRET The secret key used for enabling Google captcha authentication.
CAPTCHA_KEY The website key used for enabling Google captcha authentication.
WALLET_SECRET_KEY A hex formatted string of the wallet private key that owns some tokens.
FUEL_NODE_URL The GraphQL endpoint for connecting to fuel-core.
PUBLIC_FUEL_NODE_URL The public GraphQL endpoint for connecting to fuel-core. Ex.: https://node.fuel.network/graphql
SERVICE_PORT The port the service will listen for http connections on.
DISPENSE_AMOUNT Dispense amount on each faucet
MIN_GAS_PRICE The minimum gas price to use in each transfer

Build and Run

To run locally, assuming environment variables have already been set:

cargo run

Query Params

When integrating the faucet you can use the following query params to enhance the user experience:

Name Type Description
address Address Auto-fill the address field using the provided value
redirectUrl String If provided with a valid url, once the faucet is complete, the user will be redirected back to the url with tx_id as a query param
autoClose String If provided empty or true will close automatically the window after the transaction is finished

Example - Redirect

  • http://localhost:3000/?address=fuel134ddh9pfsspar086htdldwxq2jsr3yvqtj5w456kkrz3s653la5q347kmc&redirectUrl=http://localhost:4000

Example - Auto Close

  • http://localhost:3000/?address=fuel134ddh9pfsspar086htdldwxq2jsr3yvqtj5w456kkrz3s653la5q347kmc&autoClose