Updated 2020-03-16

Plugin API interfaces

API interfaces in Hyperledger Besu allow users to build plugins to extend Besu functionality.

For more information about the available interfaces, see the Plugin API Javadoc.

Core plugin classes

The following table lists the interfaces providing core plugin classes.

Interface Description
BesuContext Allows plugins to access Besu services.
BesuPlugin Used to manage the plugin lifecycle.

Plugin services

The following table lists interfaces providing services you can retrieve.

| Interface | Description | |--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------| | BesuEvents | Allows plugins to attach to events during Besu operation. | | BesuConfiguration | Provides file system locations of Besu’s storage. | | IbftQueryService | Allows query of the IBFT 2.0 aspects of the blockchain. | | MetricCategoryRegistry | Adds a new metrics category to the CLI. | | MetricsSystem | Register metrics with the Prometheus endpoint. | | PoaQueryService | Query the current state of Clique and IBFT 2.0 consensus protocols. | | PicoCLIOptions | Adds CLI commands to the Besu command line. | | StorageService | Allows plugins to register as a storage engine. |

To use the interfaces in your plugin, ensure the Gradle build file contains the https://hyperledger-org.bintray.com/besu-repo repository and the plugin-api dependency.