Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A faucet for cosmos-sdk apps that uses the app binary only

NotificationsYou must be signed in to change notification settings

tendermint/faucet

Repository files navigation

A faucet that usescosmos-sdk executable binaries only.

The main purpose of thisfaucet is to avoid using RPC or API endpoints, and use the CLI binary instead, morespecifically, the commands:

$ {app}d tx bank send

and:

$ {app}d query txs

Since the faucet only uses the CLI binary, it is compatible with practically any blockchain built withcosmos-sdk even if different types of keys are used (such as inethermint for example).

Installation

Using cURL

$ curl https://get.starport.network/faucet!| bash

Use docker image

Use docker imageghcr.io/tendermint/faucet. You can use it in a Kubernetes pod withshareProcessNamespaceor mount the chain binary using docker:

$ docker run -it -v~/go/bin/gaiad:/usr/local/bin/gaiad ghcr.io/tendermint/faucet

From Source

You can build the faucet with:

$ make build

The executable binary will be avaialable in the./build/ directory. To install it to$GOPATH/bin, use instead:

$ make install

Usage

Configuration

You can configure the faucet either using command line flags or environment variables. The following tableshows the available configuration options and respective defaults:

flagenvdescriptiondefault
portPORTtcp port where faucet will be listening for requests8000
account-nameACCOUNT_NAMEname of the account to be used by the faucetfaucet
mnemonicMNEMONICmnemonic for restoring an account
keyring-passwordKEYRING_PASSWORDpassword for accessing keyring
cli-nameDENOMSdenomination of the coins sent by default (comma separated)uatom
credit-amountCREDIT_AMOUNTamount to credit in each request10000000
max-creditMAX_CREDITmaximum credit per account100000000
sdk-versionSDK_VERSIONversion of sdk (launchpad or stargate)stargate
nodeNODEaddress of tendermint RPC endpoint for this chain
keyring-backendKEYRING_BACKENDkeyring backend to be used
legacy-sendLEGACY_SENDwhether to use legacy send commandfalse
coin-typeCOIN_TYPEregistered coin type number for HD derivation (BIP-0044)118
homeHOMEreplaces the default home used by the chain

gaia example

This faucet options default to work withgaia. So you can start the faucet with just:

$ faucet --keyring-password 12345678INFO[0000] listening on :8000

or, with environment variables:

$export KEYRING_PASSWORD=12345678$ faucetINFO[0000] listening on :8000

ethermint example

Start the faucet with:

$ faucet --cli-name ethermintcli --denoms ueth --keyring-password 12345678 --sdk-version launchpadINFO[0000] listening on :8000

or, with environment variables:

$export CLI_NAME=ethermintcli$export SDK_VERSION=launchpad$export DENOMS=ueth$export KEYRING_PASSWORD=12345678$ faucetINFO[0000] listening on :8000

wasmd example

Start the faucet with:

$ faucet --cli-name wasmcli --denoms ucosm --keyring-password 12345678INFO[0000] listening on :8000

or, with environment variables:

$export CLI_NAME=wasmcli$export DENOMS=ucosm$export KEYRING_PASSWORD=12345678$ faucetINFO[0000] listening on :8000

Request tokens

You can request tokens by sending aPOST request to the faucet, with a key address in aJSON:

$ curl -X POST -d'{"address": "cosmos1kd63kkhtswlh5vcx5nd26fjmr9av74yd4sf8ve"}' http://localhost:8000{"transfers":[{"coin":"10000000uatom","status":"ok"}]}

For requesting specific coins, use:

$ curl -X POST -d'{"address": "cosmos1kd63kkhtswlh5vcx5nd26fjmr9av74yd4sf8ve", "coins": ["10uatom", "20ueth"]}' http://localhost:8000{"transfers":[{"coin":"10uatom","status":"ok"}, {"coin":"20ueth","status":"ok"}]}

[8]ページ先頭

©2009-2025 Movatter.jp