Giter VIP home page Giter VIP logo

locals-faucetserver's Introduction

locals-faucetserver

An Ethereum faucet with a React frontend and a REST API. Works on any network you configure (and fund the faucet account ofcourse).

prerequisites

  • A running local GETH node. ( or access to a node like Infura ) with RPC-JSON enabled.

installing

cd locals-faucetserver
npm install
cd static
yarn build
cd ..

Configuring the faucet API

Create a lightwallet wallet.json

node mkwallet.js test > wallet.json

You can change test to whatever the password is that you want to encrypt your wallet with.

Create a config file config.json

{
	"etherscanroot": "http://testnet.etherscan.io/address/",
	"payoutfrequencyinsec": 60,
	"payoutamountinether": 0.1,
	"queuesize": 5,
	"walletpwd": "test",
	"httpport": 3000,
	"web3": {
		"host": "http://<YOUR ETH NODE>:8545"
	}
}

Start your faucet:

node index.js

Configuring the faucet frontend

edit the file static/src/config.js and specify the base URL for your API

Demo

You can access our Ropsten testnet faucet at: https://faucet.ropsten.be/

API

Endpoint

GET https://faucet.ropsten.be/donate/{ethereum address}

Request parameters

ethereum address your ethereum address

Response format

{
"paydate": 1461335186,
"address": "0x687422eea2cb73b5d3e242ba5456b782919afc85",
"amount": 1000000000000000000,
"txhash": "0x..."
}
  • paydate the unix timestamp when the transaction will be executed. Depends on the current length of the queue
  • address the address where the payment will be done
  • amount the amount in Wei that will be transferred
  • txhash transaction hash : if the queue is empty, you will immediately receive the transaction hash - if the queue is not empty - your request will be queued until paydate and the txhash field will be empty.

HTTP Return / error codes

  • 200 : Request OK
  • 400 : The address is invalid
  • 403 : The queue is full / you are greylisted / blacklisted.
  • 500 : Internal faucet error

locals-faucetserver's People

Contributors

sponnet avatar adriansonb avatar mkg20001 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.