Giter Site home page Giter Site logo

onz-checker's Introduction

onz-checker

Current version: 1.0

This script checks the status of your ONZ node by using PHP.
Feel free to rewrite in Python or Bash.

This script will also check whether your node has forked or not.
When forked, it will stop ONZ node, restore to previous snapshot, and start ONZ node again.

This script will also check your consensus and switch forging to your backup node.
When both nodes have a bad consensus, it will restart ONZ node and let you know by sending a Telegram message.

IMPORTANT TO MENTION If you want to use the consensus controller, you need to add your secret(s) to config.php and remove them from your ONZ node config.json. Also, you have to give access to the forging API calls for both nodes. Like this (1.2.3.4 is the extra IP):

    "forging": {
        "force": false,
        "secret": [],
        "access": {
            "whiteList": [
                "127.0.0.1","1.2.3.4",
            ]
        }
    },

There are some echo lines in this file.
When you redirect output to a log file in your crontab, these lines will show up.
See section Example crontab for more information.

Be sure to run this script after:

  • You have installed onz-snapshot
  • You have created a snapshot with onz-snapshot

Prerequisites

Be sure that your php.ini allows passthru(). It's default that it does though, so just check if this script is not working.

sudo apt install php php-cli php-mbstring php-sqlite3

Installation

You can clone this into every directory of your choosing. I usually just clone it into my home folder.

git clone https://github.com/OnzCoin/onz-checker.git
  • Change settings inside config.php to match your needs
  • Edit your crontab with the example below

Example crontab

* * * * * php ~/onz-checker/checkdelegate.php >> ~/onz-checker/logs/checkdelegate.log 2>&1

Telegram bot

Onz-checker comes with Telegram functionality which will allow onz-checker to send you a message if anything requires your attention. It's very easy to set up:

  • Open Telegram and start a conversation with: userinfobot
  • Put your ID inside variable $telegramId.
$telegramId = "12345678";
  • Start a conversation with: botfather
  • Say: /newbot
  • Tell botfather your bot's name
  • Tell botfather your bot's username
  • Botfather will say "Congratulations!" and give you a token
  • Put your token inside variable $telegramApiKey.
$telegramApiKey 	= "1122334455:AAEhBOweik6ad9r_QXMENQjcrGbqCr4K-bs";
  • Edit the telegram toggle (true/false)
  • Start a conversation with your bot (username) to enable communication between you two

Contact

Contributors/Authors

lepetitjan

Donations: Do you like/use my script(s)? Please consider donating the amount of a cup of coffee :-)
BTC: 1GbAWBiGyuybXJcjtyTvtH6hB5iezXNVdP

Seatrips (create snapshot when status is okay)

Mrgr (Shift snapshot)

Lepetitjan (Oxycoin snapshot)

onz-checker's People

Contributors

marscrypto avatar stoner19 avatar crypt0jan avatar

Watchers

James Cloos avatar

Forkers

stoner19

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.