One-click faucet for Tezos.
- React
- Craco
- Typescript
- Taquito
- Beacon Wallet
- ReactBootstrap
This front-end faucet is build on top of a backend (https://github.com/oxheadalpha/tezos-faucet-backend).
Backend handles:
- faucet private key
- captcha secret
- amounts sent
Sent amounts are configured in backend, using a conf named profiles
.
2 profiles are created: User, to get 1 xtz and Backer to get 6000 xtz.
Faucet calls backend using the target address and the given profile name. Then backend send as many xtz as configured on its side for the given profile.
This enforces security, avoiding user to change amount in front javascript code and dry out the faucet.
To setup the faucet for a new network:
- Update Beacon Wallet lib to make sure it will handle the new network.
- Deploy a new instance of backend
- Configure faucet to use backend
- Deploy faucet
Currently supported networks:
- Mainnet
- Mondaynet
- Dailynet
- Ghostnet
- Ithacanet
- Jakartanet
- Kathmandunet
To add a new network, first check that @airgap/beacon-sdk
handles it (check their config), then update:
npm i @airgap/beacon-sdk
And in Config.tsx
, add the case
for the new network using NetworkType
.
See https://github.com/oxheadalpha/tezos-faucet-backend
Application configuration:
name
: application name, displayed in header
googleCaptchaSiteKey
: Google ReCAPTCHA public site key
backendUrl
: Base URL of backend to connect to.
githubRepo
: URL of Github repository (displayed in header with Github icon).
profiles
: backend profiles, must match backend configuration.
-- user
: user profile, to get a single XTZ
-- baker
: baker profile, to get 6000 XTZ
-- -- profile
: backend profile ID
-- -- amount
: amount given for the profile, for display only.
Network configuration:
name
: network name. Must match one of @airgap/beacon-sdk NetworkType value (case insensitive). Also used to be displayed.
rpcUrl
: Tezos network RPC endpoint to be used by faucet
faucetAddress
: public Tezos address of faucet
viewer
: URL of a viewer that displays operation detail like http://viewer-url.com/{tx_hash}
(eg. https://jakarta.tzstats.com)
Deploy with Docker using Dockerfile.
Build Docker image:
docker build . -t tezos-faucet
Run Docker image:
docker run -p 80:80 tezos-faucet