Giter VIP home page Giter VIP logo

1hive-xdai_faucet's Introduction

xDAI-ETH faucet server

built upon: https://github.com/sponnet/locals-faucetserver

supports xDAI and test-erc20 token transfers to (pay out amount 1 xdai and 2 test erc20 tokens), ropsten and eth-mainnet

  • payout frequency: 120 seconds
  • server check frequency: 10 seconds

(configured in server/config.json)

address and ip are 'greylisted' right after a successful transaction - for 60 seconds. greylists are reset every 10 seconds.

screenshot

installing

$ git clone https://github.com/Luigy-Lemon/1hive-xDAI_Faucet.git xDAI-faucet
$ cd xDAI-faucet && cd server && npm install
$ cd .. && cd client && npm install
$ cd ..

Configuring the faucet API

edit config.json in the server/ directory and add private keys to the accounts for each network.

Start your faucet:

node index.js

Configuring the faucet frontend

edit the file client/src/config.js and specify the base URL for your API. Run npm run start

API

Endpoints

GET https://<FAUCET-URL>/info

Response

{
	checkfreqinsec: ...,
	greylistdurationinsec: ...,
	balances: [
		{
			"network": ...,
			"account": ...,
			"balanceEth": ...,
			"balanceTestErc20": ...
		},
		...
	]
}

GET https://<FAUCET-URL>/tokenInfo

Response

{
	"tokenInfo":[
		{
			"network": ...,
			"payoutEth": ...,
			"payoutTestErc20": ...,
			"testErc20Address": ...
		},
		...
	]
}

GET https://<FAUCET-URL>/{network name}/{token}/{ethereum address}

Request parameters

  • Network Name

name RPC
xdai https://blockscout.com/poa/xdai
  • token

name token
xdai the native coin on these testnets
  • ethereum address

your ethereum address

Response format

Status code: 200

{ 
	hash: 0x2323... 
}

Status code: 500

{
	err: {
		...
	}
}
  • hash transaction hash

Example Usage

curl http://localhost:1337/ropsten/testErc20/0x96C42C56fdb78294F96B0cFa33c92bed7D75F96a

HTTP Return / error codes

  • 200 : Request OK
  • 400 : Invalid address
  • 500 : error (greylisted/ tx error)

1hive-xdai_faucet's People

Contributors

sponnet avatar adriansonb avatar mkg20001 avatar probablyangg avatar

Stargazers

Mirat Can Bayrak avatar  avatar

Watchers

 avatar

Forkers

h-crypto-z

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.