Synopsis
Subcommands
cowboy faucet request
Request test-network funds for an address.
Behavior:
- Resolve the recipient address, in order:
--address; the wallet from--private-key,COWBOY_PRIVATE_KEY_FILE, orCOWBOY_PRIVATE_KEY; the keystore key the selected environment names (key, elsedefault). A missing key is an error, not a search for another wallet. - Resolve the RPC URL, in order:
--rpc-url;COWBOY_RPC_URL; the selected environment’s RPC URL;http://localhost:4000. When both the address and the URL come from project discovery they are read from one configuration snapshot, so a concurrentenv usecannot pair one environment’s wallet with another’s endpoint. POST <rpc-url>/faucetwith body{"address": "<checksum hex>"}. The client uses a 30-second timeout and follows no redirects.- Validate the response:
statusmust beaccepted,finalitymust beaccepted_only,tx_hashmust be a0x-prefixed 32-byte hash, andamountmust equalamount_cby × 10^9. - Print
Faucet request accepted.with the address, the amount in CBY, and the transaction hash.
Example:
Edge Cases
acceptedmeans the faucet accepted the transaction, not that it is final; check the balance afterwards.- A non-2xx response fails with
faucet request failed with HTTP <status>and up to 1024 printable characters of the body. - Responses over 64 KiB are refused.
- A plain-HTTP RPC URL to a non-local host prints a warning that requests and responses are sent unencrypted.
- If no wallet can be loaded, the error suggests
cowboy wallet createor--address.