Skip to content

gregorst3/DposScripts

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Universal Delegate Scripts (BETA v0.9.5.1)

Thank you

Thank you to cc001, corsaro, liberspirita, wannabe_RoteBaron, hagie, isabella, stoner19, punkrock, Nerigal, doweig, and anyone I might have missed for their help and/or contributions.

Forked and modified by Gregorst.

Disclaimer: This is always a work in progress. I provide no warrenty or guerentee :)

Config settings

  • port --http port for lisk API access (needed by check_consensus.sh){needed by manage.sh}
  • https_port --https port for lisk API access (needed by check_consensus.sh){needed by manage.sh}
  • lisk_directory --directory where lisk is installed (needed by check_consensus.sh)
  • pbk --Your account's public key (needed by check_consensus.sh){needed by manage.sh}
  • secret --Your account's secret passphrase (needed by check_consensus.sh){needed by manage.sh}
  • manage_servers --Array of servers for management script to use {needed by manage.sh}
  • srv1 --Should always be localhost (needed by check_consensus.sh)
  • servers --Array of servers for consensus script to switch to (needed by check_consensus.sh)

Control Script

This is the wrapper script for check_height_and_rebuild.sh and check_consensus.sh. You can run this on all forging servers. You only need to use this script directly and not check_height_and_rebuild.sh or check_consensus.sh. Commands are:

  • start -- starts both scripts

  • startc -- starts consensus script

  • startm -- starts management script

  • stop -- stops both scripts

  • stopc -- stops consensus script

  • stoph -- stops height_rebuild script

  • logs -- display all log files (requires multitail)

  • upgrade -- upgrades and runs runs both scripts

How to run:

  1. sudo apt-get install jq
  2. https://github.com/gregorst3/DposScripts/raw/master/control.sh
  3. Choose which scripts to run
  4. bash control.sh start - Both
  5. bash control.sh startc - Consensus script only

To check the logs and what the script is going:

  • tail -f consensus.log
  • bash control.sh logs (requires multitail)

My consensus check script

check_consensus.sh

User does not need to directly do anything with this. control.sh interfaces with it automatically

This script looks at the last two lines of the log: ~/lisk-main/logs/lisk.log for the word 'Inadequate'. If it sees that word then it tries to switch forging quickly to server 2. If server two is not at a good height, it tries server 3 if available. You can run this on all forging servers.

How to test:

If you enter echo "Inadequate" >> ~/lisk-main/logs/lisk.log on the server, it should activate check_consensus.sh to switch forging nodes

My Management script

manage.sh

User does not need to directly do anything with this. control.sh interfaces with it automatically This script will check the block heights of all listed servers. It will attempt to have one and only one server forging and prefer to have server 1 do the forging. If the forging server swtiches by something other then this script, it will pause for 15 seconds and then check the status of the servers after that.

How to run:

  1. sudo apt-get install jq
  2. https://github.com/gregorst3/DposScripts/raw/master/control.sh
  3. bash control.sh startm - Start management script

To check the logs and what the script is going:

  • tail -f manage.log
  • bash control.sh logs (requires multitail)

Donation Address: 3532362465127676136L

About

Scripts for Any Delegate Servers

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%