The Besu-Shomei Plugin is a module that supports the Shomei state management service for Linea on Besu.
Use the Gradle wrapper to build the plugin:
./gradlew build
Then, run the linea-besu docker container with the plugin mounted as a volume:
docker run -it -v `pwd`/build/libs:/opt/besu/plugins \
consensys/linea-besu:linea-delivery-1 \
--network=linea \
--data-storage-format=BONSAI \
--rpc-http-enabled=true \
--rpc-http-host="0.0.0.0" \
--rpc-http-api=ADMIN,DEBUG,NET,ETH,WEB3,PLUGINS,SHOMEI \
--rpc-http-cors-origins="*" \
--plugin-shomei-http-host=<SHOMEI_HOST_IP> \
--plugin-shomei-http-port=<SHOMEI_HOST_PORT>>
The latest plugin release version is available on the releases page.
To use a release version, follow these steps:
- Download the plugin jar.
- Create a plugins/ folder in your Besu installation directory.
- Copy the plugin jar into the plugins/ directory.
- Start Besu with the Shomei-specific configurations listed below.
The plugin enhances Besu by:
- Adding RPC endpoints (
shomei_getTrieLog
andshomei_getTrieLogsByRange
) for Shomei instances to sync with the chain. - Configuring a Shomei-friendly trielog serializer and deserializer. Note: Besu must be synced fresh with this plugin enabled, as the default trielog serializer in Besu does not store enough information in the trielogs to support Linea or Shomei.
- Configuring a trielog observer that sends new block trielogs to Shomei as they're processed in Besu. This allows Shomei to keep up with the chain head once synced.
Besu will autodetect the presence of the plugin and load and configure it at startup. However some additional configuration is to ensure besu and shomei can communicate.
The plugin registers an additional RPC namespace SHOMEI
for Shomei to query Besu for trielogs. Enable this namespace in Besu's configuration through the --rpc-http-api config option.
Specify the host and port where Shomei is running:
--plugin-shomei-http-host=<host>
: Specifies the RPC host where Shomei is running. Default is 127.0.0.1.--plugin-shomei-http-port=<port>
: Specifies the RPC host port for Shomei's RPC. Default is 8888.
The simplest way to use the plugin is with the linea-besu docker image. Ensure you specify the path to the folder containing the plugin, and a Shomei host and port that Docker can access. For example:
docker run -it -v <FOLDER_CONTAINING_PLUGIN_JAR>:/opt/besu/plugins \
consensys/linea-besu:linea-delivery-1 \
--network=linea \
--data-storage-format=BONSAI \
--rpc-http-enabled=true \
--rpc-http-host="0.0.0.0" \
--rpc-http-api=ADMIN,DEBUG,NET,ETH,WEB3,PLUGINS,SHOMEI \
--rpc-http-cors-origins="*" \
--plugin-shomei-http-host=<SHOMEI_HOST> \
--plugin-shomei-http-port=<SHOMEI_PORT>
To build the plugin from source and run tests, use the following command:
./gradlew build
The resulting JAR file will be located in the build/libs directory.
After building from source, you can install the plugin on an existing Besu installation. Here's how to do that:
-
Create a plugins directory in your Besu installation directory, if one doesn't already exist:
mkdir -p /opt/besu/plugins
-
Copy the built JAR file into the plugins directory: mkdir -p /opt/besu/plugins
cp build/libs/besu-shomei-plugin-0.1.0.jar /opt/besu/plugins
Here are the steps for releasing a new version of the plugin:
- Create a tag with the release version number in the format vX.Y.Z (e.g., v0.2.0 creates a release version 0.2.0).
- Push the tag to the repository.
- GitHub Actions will automatically create a draft release for the release tag.
- Once the release workflow completes, update the release notes, uncheck "Draft", and publish the release.
Note: Release tags (of the form v*) are protected and can only be pushed by organization and/or repository owners.