Lisk Reward Distributor
A tool to calculate and distribute forging rewards among voters.
Only compatible with Lisk Core 1.0 and up.
If you find my tools useful, please consider voting for my delegate
lemii or donating to
@karek314's LISK-PHP is used for pushing TXs to the network.
Please install and configure this tool before proceeding.
Installation & Configuration
git clone https://github.com/Lemii/lisk-reward-distributor cd lisk-reward-distributor pip install -r requirements.txt
Most of the values are already pre-configured. If you're only using this on testnet and have installed everything as user 'Lisk' in the default directories, simply add your
passphrase and go to Usage.
If you want to customize more values, please see the list below:
node Node address used for API calls. delegate_address Your delegate's address passphrase Your 12 word mnemonic passphrase second_passphrase Your (optional) second 12 word mnemonic passphrase (default = false) limit Maximum weight of a voter (default of 70500000000000 equals 750,000 LSK) percentage Total sharing percentage fee Transaction fee that will be deducted from payment threshold Payout threshold lisk-php_path Path to lisk-php exclusions Addresses that will be excluded from reward calcution and distribution dev Enable or disable "dev mode"
true, all payment TXs will be printed to screen rather than pushed out to the network.
- 8000 = mainnet
- 7000 = testnet
- 5000 = betanet
Even though it's possible to run this script manually, it is highly recommended to set up a Cron Job to do it for you.
The example below runs the script every day at 12:00.
0 12 * * * /usr/bin/python [path to lisk-reward-distributor.py]
How it works
When the script is ran, the following things happen:
- Voter database gets imported from csv. If no database exists, a new one is created
- New voters are added to database
- All voters' weight (balances) are updated
- Total forged Lisk since last timestamp is calculated
- Each voter's reward is calculated (can be limited to X relational amount in config)
- Rewards are added to voters' pending balances
- If new pending balance exceeds configured payout threshold, construct TX command line and send to lisk-php
- If TX is sent, reset voter's balance to 0
- New voter dabase is dumped to csv
- New timestamp is dumped to file
All steps are logged in
Licensed under the MIT license