Home

Awesome

Cosmfaucet

Cosmfaucet is a self-hosted faucet service for cosmos based blockchain.

Homescreen

Supported Features

End-to-end Test Environment

To launch a e2e environment, please follow below steps.

  1. Visit to the e2e directory.
  2. Run docker-compose up to launch 2 chains, a relayer and the faucet service.
  3. Visit to the http://localhost:8080 with your browser.

Run faucet server manually

$ make build
$ ./bin/server --config-file config.yml

Run from docker

Please check e2e/docker-compose.yml file.

Configuration

You can add supported chains as many as possible.

# config.yml
server:
  allow_cors: false
  http:
    port: 8081
  grpc:
    port: 9092
  limit:
    enabled: true
    period: 86400
chains:
  - name: "cosmos"
    key_name: "cosmos"
    chain_id: "testchain"
    rpc_endpoint: "http://localhost:26657/"
    account_prefix: "cosmos"
    sender: "cosmos1u9vn33qs6jdr3wwq4u2l9p349n9c95uxz2lew0"
    key: "reopen throw concert garment wash slab jump company habit father below stage float attitude achieve net charge bulb mouse mind fat net hello vague"
    gas_adjustment: 1.2
    gas_price: "0.01uatom"
    drop_coin: "10000000uatom"
  - name: "osmosis"
    ...
optiondescriptiondefault
server.allow_corsAllow CORS Policyfalse
server.http.portHTTP Server Port8081
server.grpc.portGRPC Server Port9092
server.limit.enabledEnable the faucet limit to prevent the fund from being drained from the single usertrue
server.limit.periodThe period of the faucet limit in seconds, any user cannot run the request more than once within this period86400
chains[].nameThe name of the chain
chains[].key_nameThe name of the keyfile, the key is stored on {name}.info file in the keys folder
chains[].chain_idThe chain id of the chain, all chain ids must be unique for each other
chains[].rpc_endpointThe RPC endpoint of the chain, it must be accessible from the faucet server
chains[].account_prefixThe account prefix of the chain, it is used to check wether the given address is valid or not
chains[].senderThe address of the sender
chains[].keyThe private key of the sender, <br/>it is used to sign the transaction<br/>Please do not use this key for important business, it must be only used for faucet service
chains[].gas_adjustmentIt's used to avoid underestimating amount of gas needed to send transaction
chains[].gas_priceThe gas price of the chain
chains[].drop_coinThe amount of the coin to be dropped, it must be in the format of {amount}{denom}

Contribution

Please feel free to open an issue or a pull request.