Report misbehavior plugin
@liskhq/lisk-framework-report-misbehavior-plugin
is a plugin for the Lisk Framework that provides automatic detection of delegate misbehavior and sends a reportDelegateMisbehaviorTransaction
to the running node.
Alias |
|
Actions |
|
Events |
none |
Table of Contents
Registering the plugin
How to register the report misbehavior plugin with the blockchain application.
const { Application, ReportMisbehaviorPlugin, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const app = Application.defaultApplication(genesisBlockDevnet, configDevnet);
app.registerPlugin(ReportMisbehaviorPlugin);
app
.run()
.then(() => app.logger.info('App started...'))
.catch(error => {
console.error('Faced error in application', error);
process.exit(1);
});
Default configuration
The report misbehavior plugin can be configured in the configuration of the blockchain application under plugins.reportMisbehavior
.
The application will use the default values, in case there is no plugin configuration provided. |
Misbehavior reporting options in the configuration
const { Application, ReportMisbehaviorPlugin, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const appConfig = utils.objects.mergeDeep({}, configDevnet, {
plugins: {
reportMisbehavior: {
dataPath: '~/.lisk/report-misbehavior', (1)
cleanupFrequency: 3600, (2)
encryptedPassphrase: '', (3)
fee: 100000000 (4)
},
}
});
const app = Application.defaultApplication(genesisBlockDevnet, appConfig);
app.registerPlugin(ReportMisbehaviorPlugin);
app
.run()
.then(() => app.logger.info('App started...'))
.catch(error => {
console.error('Faced error in application', error);
process.exit(1);
});
1 | dataPath : The data path for storing misbehavior related information captured from the application. |
2 | cleanupFrequency (optional): Frequency of cleaning up the outdated data in seconds. |
3 | encryptedPassphrase (optional): The encrypted passphrase of the account that will report the misbehavior. |
4 | fee (optional): The fee required to send a report misbehavior transaction. |