Code Monkey home page Code Monkey logo

petrometer's Introduction

petrometer

Build Status codecov

petrometer is a tool which summarizes daily and total gas consumption of all transactions sent from a specified Ethereum address.

It uses the etherscan.io API (https://etherscan.io/apis) to download the transaction data as it's much more effective than querying an Ethereum node directly. What even more, it caches the downloaded data between invocations and only downloads new transactions when run again. Thanks to appdirs (https://pypi.python.org/pypi/appdirs), standard OS locations are used for storing cached data.

You do need an etherscan.io API key (https://etherscan.io/apis) in order to use this tool, it needs to be passed as the --etherscan-api-key parameter. You need to create an etherscan.io account (https://etherscan.io/register) in order to be able to generate an API key.

https://chat.makerdao.com/channel/keeper

Installation

This project uses Python 3.6.2.

In order to clone the project and install required third-party packages please execute:

git clone https://github.com/makerdao/petrometer.git
cd petrometer
pip3 install -r requirements.txt

Usage

usage: petrometer [-h] --etherscan-api-key ETHERSCAN_API_KEY address

arguments:
  --etherscan-api-key ETHERSCAN_API_KEY    Etherscan API key
  address                                  Ethereum address to get the gas usage of

optional arguments:
  -h, --help            show this help message and exit

Sample invocation:

bin/petrometer --etherscan-api-key ABCDFDBCBAFDBCFBDFCBFDBAFB 0x1212121212343434343456565656565454545454

Sample output:

Gas usage summary for: 0x00......................................

    Day       # transactions        Average gas price              Average gas cost                  Total gas cost        
===========================================================================================================================
2018-01-06                 12                   39.7 GWei         0.005078854742238021 ETH         0.060946256906856247 ETH
2018-01-07                 22                   22.0 GWei         0.003037521765674030 ETH         0.066825478844828673 ETH
2018-01-08                 76                   27.7 GWei         0.003806332034057282 ETH         0.289281234588353420 ETH

Number of transactions: 351
Total gas cost: 1.526090324569235879 ETH

License

See COPYING file.

petrometer's People

Contributors

devenoges 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.