Giter Club home page Giter Club logo

realtps's Introduction

RealTPS

RealTPS measures the current number of transactions per second committed by various blockchains.

About the software

RealTPS is written in Rust. It contains three parts:

  • realtps_import is the syncing server that keeps running jobs for
    • requesting block data from various blockchains' RPC clients, and storing them to disk,
    • calculating TPS for each blockchain.
  • realtps_web is the realtps.net website, built on top of the Rocket framework.
  • realtps_common is data structures that are shared between realtps_import and realtps_web
    • abstracted database trait Db and its JSON implementation JsonDb
    • RealTPS' Block data structure that is converted from different blockchains' block data
    • implementations of Chain for various RPC protocols

About the algorithm

RealTPS uses a simple method of counting the transactions in every block over the time period spanning from one week ago until the present moment, then dividing that total number of transactions by the number of seconds from the beginning of the first block until the end of the last block.

Full details are on the website.

Run RealTPS yourself

$ git clone https://github.com/Aimeedeer/realtps
$ cd realtps
$ cargo run -p realtps_import

You'll see the db directory for fetched data under the root. You can kill it any time or just keep it running.

With the data in db, you can see the list of results by running the website:

$ cargo run -p realtps_web

And check it in your browser at http://localhost:8000.

To update data for a specific chain, run realtps_import with arguments. e.g.

$ cargo run -p realtps_import -- import --chain polygon
    Finished dev [unoptimized + debuginfo] target(s) in 0.33s
     Running `target/debug/realtps_import import --chain polygon`
[realtps_import] creating client for polygon at https://polygon-rpc.com
[realtps_import] node version for polygon: bor/v0.2.12-stable-488ea2bc/linux-amd64/go1.17
[realtps_import::import] beginning import for polygon
[realtps_import::import] importing at least 43020 blocks for polygon
[realtps_import::import] fast-forwarding chain polygon from block 23004376
[realtps_import::import] fast-forwarded chain polygon to block 23004283

Have fun!

License

MIT

realtps's People

Contributors

brson avatar aimeedeer avatar leighmcculloch avatar classic298 avatar ivnsch avatar nikhildfinity avatar graydon avatar joshlind avatar niklabh avatar praxis-innovation avatar a-ridley 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.