Skip to content

michieldespiegelaere/Enable-Forging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is a tool to re enable forging after your lisk node stopped forging.

Download

To download the script you can just clone the project or download the files with wget

clone https://github.com/michieldespiegelaere/EnableForging.git

wget https://raw.githubusercontent.com/michieldespiegelaere/EnableForging/master/EnableForging/EnableForging.py & wget https://raw.githubusercontent.com/michieldespiegelaere/EnableForging/master/EnableForging/Config.py

Setup

To be able to run the python script you need to run pyhton -m pip install requests first so the script can execute the api calls and cUrl requests.

For the logging part you need to run python -m pip install logging

In Config.py you need to configere the following variables:

  • ipAddress = '127.0.0.1' # Your forging nodes ipaddress
  • port = '7000' # The port you're using for your api betanet :5000 testnet:7000 mainnet:8000
  • publicKey = '' # The public key of the forging delegate
  • password = '' # The password you used for encrypting your passphrase
  • logname = 'EnableForging.log' # The name for your log file

If you don't want logging you need to empty the logname variable

After installing the requests module you can start the script with python EnableForging.py or python3 EnableForging.py.

when you checked if everything runs well you can make a cronjob to have optimal us of the script.

Creation of the cronjob

The best way to make full use of the script is to run the script every minute as a cronjob. The following commands will show you how to create a cronjob that executes the script every minute.

  1. Go to cron.hourly with: cd /etc/cron.hourly
  2. To make a cronjob use: crontab -e
  3. You'll enter in a text editor where you have to fill in your cronjob. To run the cronjob every minute you have to use the following line: * * * * * /usr/bin/python [path to EnableForging.py]
  4. When you have edited the file just ctrl+x to save the file.

The following link helped me a lot. https://awc.com.my/uploadnew/5ffbd639c5e6eccea359cb1453a02bed_Setting%20Up%20Cron%20Job%20Using%20crontab.pdf

P.S. script still in development for easier usage.

donations allways welcome: 12056889420610179211L