Forger plugin
@liskhq/lisk-framework-forger-plugin
is a plugin for the Lisk Framework that monitors configured delegates forging activity, and voters information.
Alias |
|
Actions |
|
Events |
Registering the plugin
How to register the forger plugin with the blockchain application.
// Import the ForgerPlugin from the lisk-sdk package
const { Application, ForgerPlugin, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
const app = Application.defaultApplication(genesisBlockDevnet, configDevnet);
// Register the plugin with the application
app.registerPlugin(ForgerPlugin);
app
.run()
.then(() => app.logger.info('App started...'))
.catch(error => {
console.error('Faced error in application', error);
process.exit(1);
});
Default configuration
The forger plugin can be configured in the configuration of the blockchain application under plugins.forger
.
The application will use the default values, in case no plugin configuration is provided. |
Forger options in the configuration
const { Application, ForgerPlugin, genesisBlockDevnet, configDevnet } = require('lisk-sdk');
configDevnet.plugins.forger = {};
// Configure where to store the plugin data.
// Default location is ~/.lisk/forger
configDevnet.plugins.forger.dataPath = '~/.lisk/forger'; (1)
const app = Application.defaultApplication(genesisBlockDevnet, configDevnet);
app.registerPlugin(ForgerPlugin);
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 forging related information captured from the application. |