Giter Site home page Giter Site logo

komodo-chains-validator's Introduction

This repo contains a few scripts for monitoring the chains secured by Komodo's dPoW, to detect and provide an early warning if there is a hash mismatch between participating nodes for specific a block.

A "Sync" node constantly loops through:

  • (re)starting a dPoW chain to sync from scratch
  • reporting the chain tip block and hash once it is fully sync'd to an oracle
  • stopping the chain, and deleting all chain data

Participating nodes each have a custom oracle created on a dedicated smartchain, and periodically report their local block hash of the most recent block reported by the Sync node.

These oracle records are then periodically compared to ensure uniformity between the Sync node and all participating nodes, and:

  • a warning is sent via discord or telegram bot messages each hour if a mismatch is detected.
  • a status message is set via Discord / Telegram bot every 12 hours if no mismatch is detected.

To participate as a notary node, follow the instructions below:

  • Clone this repo - git clone https://github.com/smk762/komodo-chains-validator/
  • Go to the repo folder - cd komodo-chains-validator
  • Install pip reqs - pip3 install -r requirements.txt
  • Next create a config folder - mkdir config
  • Then create a file for your pubkey - nano ~/komodo-chains-validator/config/pubkey.txt
  • And enter your pubkey (just the pubkey, nothing else),then save the file and exit.
  • Start the STATSORCL chain with the following parameters (insert your pubkey!):
komodod -ac_name=STATSORCL -ac_supply=100000000 -ac_reward=10000000000 -ac_staked=99 -ac_cc=762 -ac_halving=762000 pubkey=[YOUR PUBKEY] -addnode=116.203.120.91 -addnode=116.203.120.163
  • Import your Notary Node private key - komodo-cli -ac_name=STATSORCL importprivkey [YOUR_PRIVATE_KEY]
  • Now stop the chain - komodo-cli -ac_name=STATSORCL stop
  • You can test everything is working as expected with python3 nn_report_hash.py
  • Last step is to setup a service for the nn_report_hash.py script, so it will restart on reboot, and run in the background.
  • Create a file with sudo nano /lib/systemd/system/kmd_sync_report.service, then populate it as below:
[Unit]
Description=KMD NN Sync Report Service
After=multi-user.target
[email protected]

[Service]
User=***YOUR USERNAME***
Type=simple
ExecStart=/usr/bin/python3 /***YOUR USERNAME***/komodo-chains-validator/nn_report_hash.py
StandardInput=tty-force
Restart=always
RestartSec=30

[Install]
WantedBy=multi-user.target
  • Start the service with sudo systemctl start kmd_sync_report.service
  • Check its status with sudo systemctl status kmd_sync_report.service
  • Set it to run automatically on reboot - sudo systemctl enable kmd_sync_report.service
  • To check the console stdout, use tail -f nn_sync_report.log

komodo-chains-validator's People

Contributors

smk762 avatar tonymorony 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.