Faucet
A minimal Typescript faucet to drip native tokens on Ethereum chains
Usage
-
Install the faucet.
pnpm install @latticexyz/faucet@next -
Specify the environment variables. Note that you need to
export(opens in a new tab) these variables for the faucet service to get them.Variable Description Default HOSTHost that the indexer server listens on 0.0.0.0PORTPort that the indexer server listens on 3002RPC_HTTP_URLHTTP URL for Ethereum RPC FAUCET_PRIVATE_KEYPrivate key of wallet to distribute faucet funds from DRIP_AMOUNT_ETHERDrip amount in ether -
Start the server.
pnpm faucet-serverFor example, you can use these values to drip 1 ETH for a local
anvil(opens in a new tab) instance:Variable Value Comments RPC_HTTP_URLhttp://127.0.0.1:8545 (opens in a new tab) localhostsometimes doesn't workFAUCET_PRIVATE_KEY0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d One of the default accounts DRIP_AMOUNT_ETHER1
Getting ETH from a faucet
This sample program (opens in a new tab) shows how to obtain ETH from a faucet.