You can extend Hyperledger Besu functionality by building Java plugins. Use the Plugin API to take data from any Besu network, public or permissioned, and feed it into an application or system.
For example, create a plugin to add more monitoring functionality or stream event data to a third-party application. The API exposes data about the following components:
- Smart contracts
- Execution results
- Syncing state.
The Plugin API provides access to interfaces allowing you to build the plugin.
View the Plugin API webinar for an example of how to build a plugin.
For more information about the available interfaces, see the Plugin API Javadoc.
To allow Besu to access and use the plugin, copy the plugin (
.jar) to the
If not already present, you must create the
plugins directory one directory level below
Each plugin in the directory has the following lifecycle events:
- Register - Executed when Besu starts. Besu checks plugin compatibility and registers plugins.
- Start - Plugins start after being successfully registered.
- Stop - Besu stops plugins.
The order in which Besu calls plugins during lifecycle events is not guaranteed.