Simple faucet with REST API
Last updated a year ago by jeroenknoops .
MIT · Original npm · Tarball · package.json
$ cnpm install @cogitojs/faucet 
SYNC missed versions from official npm registry.


This is a very simple faucet Express app. It supports the following REST call:

POST /donate/<ethereum address>


Cogito Faucet is a NodeJS program. It can be installed by running

npm install -g @cogitojs/faucet

or alternatively

yarn global install @cogitojs/faucet


The cogito-faucet command takes the following arguments:

  • <account>, this first argument is the account number from which Ether will be donated. Needs to include the 0x prefix.
  • -d or --donation followed by an amount of Ether. This is the amount of Ether that is donated per request. Defaults to 0.1.
  • -p or --provider followed by the provider URL. This specifies the full URL of the node in your blockchain network (including http or https and port number if needed). Defaults to http://localhost:8545.
  • --port followed by a port number. The port that the faucet listens on. Defaults to 3001

The private key that corresponds with the account is specified as an environment variable:



This runs a faucet that hands out Ether in amount of 0.01 from the account 0x627306090abab3a6e1400e9345bc60c78a8bef57, using its corresponding private key. It uses the Ethereum node at ip address

cogito-faucet --donation 0.01 --provider 0x627306090abab3a6e1400e9345bc60c78a8bef57

Using the faucet

After the faucet is started, you can use test it by performing a post using e.g. curl:

curl -X POST -D - http://localhost:3001/donate/0xdf562290eceb83d659e23252ae8d38fa0bbc06e8

or using httpie:

http POST http://localhost:3001/donate/0xdf562290eceb83d659e23252ae8d38fa0bbc06e8

When using a deployed network, you may want to increase the timeouts. For curl:

curl -X POST -m 600 -D - https://blockchain.deployed.com/faucet/donate/0x6b0be084e6ffc7d6cace8e01e2814c869257c3aa

for httpie:

http --timeout=600 POST https://blockchain.deployed.com/faucet/donate/0x6b0be084e6ffc7d6cace8e01e2814c869257c3aa

This will give the network 10min.

Current Tags

  • 0.3.0                                ...           latest (a year ago)

10 Versions

  • 0.3.0                                ...           a year ago
  • 0.2.23                                ...           a year ago
  • 0.2.19                                ...           a year ago
  • 0.2.18                                ...           2 years ago
  • 0.2.17                                ...           2 years ago
  • 0.2.16                                ...           2 years ago
  • 0.2.15                                ...           2 years ago
  • 0.2.13                                ...           2 years ago
  • 0.2.12                                ...           2 years ago
  • 0.2.11                                ...           2 years ago
Today 0
This Week 0
This Month 12
Last Day 0
Last Week 10
Last Month 4
Dependencies (6)
Dev Dependencies (3)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |