GithubHelp home page GithubHelp logo

isabella232 / ae-fork-monitor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aeternity/ae-fork-monitor

0.0 0.0 0.0 179 KB

Aeternity Network Fork Monitor

JavaScript 18.33% Dockerfile 0.97% TypeScript 71.44% Handlebars 9.27%

ae-fork-monitor's Introduction

ARCHIVED

This project is no longer active superseded by ae_canary.

Fork Detection

The following steps are repeated with pauses of 180 seconds in between.

1. Update Chain Ends

  1. Call the endpoint of a single node http://206.81.24.215:3013/v2/status/chain-ends
  2. From each unique chain end, recursively query the prev_key_hash from the node
    1. Get prev_key_hash from current Block ("Block 2")
    2. Query the previous block ("Block 1") from node
    3. Insert block ("Block 1") in database
    4. Set reference from inserted ("Block 1") to next block ("Block 2") (via prev_key_hash)
    5. Repeat unless the key_hash of ("Block 1") is already in the database

2. Check for Forks

  1. Search the database for prev_key_hash which occur more than once
  2. Get all blocks with these prev_key_hash which are not older than 1k blocks from the current top
  3. Run a forward search on these. For each potential fork:
  4. Get all future blocks (height > current)
  5. For current Block ("Block 1") get the next block ("Block 2") where 2.prev_key_hash is 1.key_hash
  6. If there are two next Blocks, do a forward search for each of them and merge the result in current fork
  7. Repeat 2. & 3. until there are no next blocks

3. Alert for forks

  1. Remove the longest (highest height - lowest height) fork, its the main chain
  2. For all other found forks,
    1. verify that a fork contains more than one block
    2. check if it has been growing (compare with memory state of last alert iterations)
    3. if both of the above are true, alert users in telegram group

ae-fork-monitor's People

Contributors

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