Giter Site home page Giter Site logo

transcendence-scripts's Introduction

transcendence-scripts

forkwatch

Compares the blockhashes of explorer.teloscoin.org, telos.polispay.com and your local wallet and tells you if you are forked.

forkwatch.bat

forkwatch.bat

forkwatch.bat relies on Windows 10, as this is the only version that ships with its own curl. If you are on an older Windows version, maybe you can download a Windows curl binary and put it in the same directory as the batch file and wallet binaries.

Configuration

Configuration is the same as for forkwatch.sh, just scroll down.

How to run

  • Double-click the file, or
  • Open a command window, e.g. hitting Windows-Key + R, entering "cmd" and pressing ENTER, then issue:
cd C:\full\path\to\the\bat\file\without\the\file\itself
forkwatch.bat

IFTTT

If you want to use IFTTT for fork alarms, you should delete all PAUSE statements. Rest of the configuration equals the Cron with IFTTT part, minus the cron. You should use Windows Task Scheduler instead, but I haven't tried it, yet.

Caveats, ToDo, Known Problems

Same as for forkwatch.sh

forkwatch.sh

Configuration

  • SAFEMARGIN - (default: 50) we don't compare the latest hashes, as they are subject to change due to consensus. We compare the hash of (blockheight - $SAFEMARGIN) to rule out orphan hashes.
  • TRANSCENDENCE - (default: ./transcendence-cli) sets where the transcendence-cli binary is. The default refers to the directory where this script is run from.
  • IFTTTKEY - (default: none) enter your key for IFTTT to get a push notification when you are forked.

How to run

wget https://github.com/qSebastiaNp/transcendence-scripts/raw/main/forkwatch.sh
chmod u+x forkwatch.sh
./forkwatch.sh

Cron with e-mail

This assumes you have a working mailing system (Exim, Postfix,...) on your server. If not, you cannot be alarmed by email and putting the script into cron would be pointless. This will only email you in case of errors, and like this, would run every hour. Feel free to change the 0 to something else, to avoid the explorer being hammered at full hours.

[email protected]
0       *       *       *       *       /home/your-user/path-to-the-script/forkwatch.sh > /dev/null

Cron with IFTTT

Put this into your crontab. Note the difference to the cron command above. Feel free to change the 0 to something else, to avoid the explorer being hammered at full hours.

0       *       *       *       *       /home/your-user/path-to-the-script/forkwatch.sh > /dev/null 2>&1

You have to have a working IFTTT account. If you have none, create a free account on www.ifttt.com. Then follow these instructions:

  1. Go to https://ifttt.com/maker_webhooks and click "Connect"
  2. Click on "Documentation" in the upper right, copy the part after /key/ and put it in IFTTTKEY in the script
  3. Click on "Create" in the upper menu and at "If This" click "Add"
  4. Type "Webhooks", click on the Webhooks square and then on "Receive a web request"
  5. Give it the event name "notify" and click "Create Trigger"
  6. Under "Then That" click on "Add" and type "Notifications", click on the square
  7. Click on "Send a notification from the IFTTT app"
  8. Delete the sample message and write: Notification: {{Value1}}
  9. Click "Create Action", "Continue", "Finish".
  10. Install the IFTTT app on your iPhone or Android and log in with your account. You will now receive a push message when your watched wallet is forked.

Caveats

This script cannot provide guidance if:

  • a large chunk of the network has forked away. Check the discord then for reports and instructions.
  • explorer.teloscoin.org and telos.polispay.com fork away, the script cannot determine what should be the right blockhash. This should not happen though.
  • Don't use or trust the script around planned forks.

ToDo / Known Problems

  • there is no error checking for downtime or errors of the explorer or PolisPay
  • there is no checking whether you have the current wallet version
  • the script can't detect stuck wallets and getblockhash will return an error (well, there is your detection)
  • the script can't handle overloaded/unresponsive wallets (transcendence-cli will never return anything and hang, leave with CTRL + C after some minutes, add maxconnections=32 to your transcendence.conf and restart your wallet!)

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.