Giter Club home page Giter Club logo

gasfaucet's Introduction

gasFaucet API


Calculating how much Ether should be sent to a wallet depending on requested gas price, gas amount and confirmation time.

Working website

Installation

install dependencies

pip3 install -r requirements.txt

populate the config.py with:

  • NODE_URL = the url of the node you want to connect to like "https://ropsten.infura.io/YOUR_API_KEY" or "http://localhost:8545" if you run parity or geth
  • ETH_PRIVATE_KEY = Ethereum Private Key as string
  • API_KEY = Random 30 characters long string (needed for flask front end)
  • CACHE_INTERVAL = Positive integer for seconds specifying how often gas Prices will be updated

Usage

run the app

python3 app.py

send request to localhost with query parameters

available parameters are: gas_needed (1 - 4.000.000) tx_speed (slow, medium, fast) public_address (valid ethereum address)

you can switch to the infura branch to quickly test with an INURA node otherwise you can run a local parity node

when testing you can run the testScript.py to fire request at your localhost. The app takes upto 30 seconds before it can return the first gas prices.

example GET request:

curl http://localhost:8000/fill-wallet-for-gas?gas_needed=10000&tx_speed=medium&public_address=0x516F329EC1fF7BF6882dE762A14eb94491FA4D8d'

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.