This faucet app allows anyone who passes a captcha to request tokens for a Cosmos account address.
-
Clone this repository locally
-
Create Google reCAPTCHA v2 keys.
-
Install secretcli on the server.
secretcli
's version has to be compatible with the testnet. -
Configure
secretcli
:sudo secretcli config indent true sudo secretcli config keyring-backend test sudo secretcli config trust-node true
-
Create the the faucet account on the machine that is going to run the faucet.
secretcli keys add <name of the account> --keyring-backend=test
-
Make sure the faucet account have funds. The faucet basically performs a
tx send
for every token request, so make sure the faucet account have enough tokens (more tokens could be added later by sending more funds to the faucet account). -
Copy the
.env
template to the/frontend
directorycp .env.template ./frontend/.env
-
Change the
.env
parameters as you see fit. Parameter description:VUE_APP_CHAIN
- Should hold thechain-id
FAUCET_CHAIN
- Should hold thechain-id
VUE_APP_RECAPTCHA_SITE_KEY
- Google reCAPTCHA Site KeyFAUCET_RECAPTCHA_SECRET_KEY
- Google reCAPTCHA Secret KeyVUE_APP_CLAIM_URL
- URL for the claim server request. Leave as is.FAUCET_PUBLIC_URL
- The URL that the server is going to listen to. Leave as is to use Caddy later.FAUCET_AMOUNT_FAUCET
- Amount of tokens to send on each request. Should specify amount+denom e.g. 123uscrt.FAUCET_KEY
- The account alias that will hold the faucet funds.FAUCET_NODE
- Address of a full node/validator that the CLI will send txs to e.g. tcp://domain.name:26657LOCAL_RUN
- Option for local run for debug. Not supported for now, should leave asfalse
.- Other parameters should be left unchanged.
-
Build:
make all
-
Deploy to server. You can do it manually by copying the
bin/
directory or runmake deploy
(make sure to change the makefile to match your server's address i.e.scp -r ./bin [email protected]:~/
) -
(optional) Configure Caddy. You can use this as a simple template.
-
(optional) You can start the server by running the
./path/to/bin/faucet
binary. It is recommended to create a systemd unit. For example (change parameters for your own deployment):[Unit] Description=Faucet web server After=network.target [Service] Type=simple WorkingDirectory=/home/ubuntu/testnet-faucet/bin ExecStart=/home/ubuntu/testnet-faucet/bin/faucet User=ubuntu Restart=always StartLimitInterval=0 RestartSec=3 LimitNOFILE=65535 AmbientCapabilities=CAP_NET_BIND_SERVICE [Install] WantedBy=multi-user.target