Giter Site home page Giter Site logo

eth-onchain-price's Introduction

eth-onchain-price's People

Contributors

brianleect avatar

Watchers

 avatar  avatar

eth-onchain-price's Issues

[Research] Implementation for maintaining up to date data

Solution 1: Sub newHeaders()
Subscribe to connection once and simply update on every new header received.

Pros

  • Close to instant updating of price once received

Cons

  • Not sure how reliable WS connections are in general especially over extended periods of time.

Solution 2: setInterval(10000,checkAndUpdate())
Check every set interval of 10s the latest block and updates accordingly

Pros

  • Relatively more stable (this only holds if WS does indeed turn out to have issues)

Cons

  • Delay of up to 10s from last blocks, might be slower by a few blocks.
  • However, in most use cases it's likely that a 10s delay in price update on chain would be significant considering average block time is 15s. In the case where the current block is not available, app could simply fall back to the price in previous block number?

[Research][Benchmark] JSON vs Sqlite vs eth_call

Considering that I shifted over from using a JSON file as a store initially, it would be interesting to see whether performance improvements or degradation is observable and the required load for it to matter.

Variables

  1. Storage format: JSON / Sqlite / NONE (eth_call)
  2. Retrieval style: Sqlite (ALL vs Single)
  3. Number of blocks: 1k / 10k/ 100k / 1mil
  4. "Simultaneous" requests 1/10/100/1000

Metrics to compare

  1. Size of DB choice (Storage)
  2. Time taken to retrieve price of X number of blocks

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.