MCPcopy Index your code
hub / github.com/FuelLabs/faucet

github.com/FuelLabs/faucet @v0.7.6

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.7.6 ↗ · + Follow
56 symbols 87 edges 10 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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

Extension points exported contracts — how you extend this code

Clock (Interface)
(no doc) [2 implementers]
src/dispense_tracker.rs

Core symbols most depended-on inside this repo

error
called by 12
src/routes.rs
now
called by 2
src/dispense_tracker.rs
start_server
called by 2
src/lib.rs
advance
called by 2
tests/dispense.rs
_dispense_sends_coins_to_valid_address
called by 2
tests/dispense.rs
parse_bool
called by 1
src/config.rs
init_logger
called by 1
src/main.rs
track
called by 1
src/dispense_tracker.rs

Shape

Function 24
Method 18
Class 13
Interface 1

Languages

Rust100%

Modules by API surface

src/routes.rs13 symbols
tests/dispense.rs12 symbols
src/dispense_tracker.rs12 symbols
src/lib.rs6 symbols
src/models.rs5 symbols
src/config.rs3 symbols
src/recaptcha.rs2 symbols
src/main.rs2 symbols
build.rs1 symbols

For agents

$ claude mcp add faucet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact