Code Monkey home page Code Monkey logo

faucet's Introduction

faucet

A faucet that uses cosmos-sdk executable binaries only.

The main purpose of this faucet is to avoid using RPC or API endpoints, and use the CLI binary instead, more specifically, 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 with cosmos-sdk even if different types of keys are used (such as in ethermint for example).

Installation

Using cURL

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

Use docker image

Use docker image ghcr.io/tendermint/faucet. You can use it in a Kubernetes pod with shareProcessNamespace or 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 table shows the available configuration options and respective defaults:

flag env description default
port PORT tcp port where faucet will be listening for requests 8000
account-name ACCOUNT_NAME name of the account to be used by the faucet faucet
mnemonic MNEMONIC mnemonic for restoring an account
keyring-password KEYRING_PASSWORD password for accessing keyring
cli-name DENOMS denomination of the coins sent by default (comma separated) uatom
credit-amount CREDIT_AMOUNT amount to credit in each request 10000000
max-credit MAX_CREDIT maximum credit per account 100000000
sdk-version SDK_VERSION version of sdk (launchpad or stargate) stargate
node NODE address of tendermint RPC endpoint for this chain
keyring-backend KEYRING_BACKEND keyring backend to be used
legacy-send LEGACY_SEND whether to use legacy send command false
coin-type COIN_TYPE registered coin type number for HD derivation (BIP-0044) 118
home HOME replaces the default home used by the chain

gaia example

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

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

or, with environment variables:

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

ethermint example

Start the faucet with:

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

or, with environment variables:

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

wasmd example

Start the faucet with:

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

or, with environment variables:

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

Request tokens

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

$ 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"}]}

faucet's People

Contributors

helder-moreira avatar ilgooz avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.