Skip to content

docs: update plugins page to match current Nethermind API#330

Merged
rubo merged 4 commits intomainfrom
fix/update-plugins-docs
Feb 25, 2026
Merged

docs: update plugins page to match current Nethermind API#330
rubo merged 4 commits intomainfrom
fix/update-plugins-docs

Conversation

@smartprogrammer93
Copy link
Contributor

Summary

Updates the plugins documentation to reflect the current state of the Nethermind codebase.

Changes

  • Removed references to deleted interfaces: \IInitializationPlugin\ and \ISynchronizationPlugin\ no longer exist in the codebase
  • Added \Enabled\ property to all plugin examples (now a required member of \INethermindPlugin)
  • Removed boilerplate stubs (\DisposeAsync, empty \InitNetworkProtocol, etc.) — the interface now provides default implementations
  • New section: Dependency injection and modules — documents the \Module\ property, \IStep\ interface, \AddStep(), and \RunnerStepDependencies\ attribute (replaces the old \IInitializationPlugin\ pattern)
  • Updated Configuration section to show Autofac constructor injection (the modern pattern used by all built-in plugins)
  • Added \INethermindPlugin\ reference table documenting all interface members including \MustInitialize\ and \Module\
  • Updated log output examples to match current \PluginLoader\ format
  • Updated JSON-RPC handler sample with the same fixes

- Remove IInitializationPlugin and ISynchronizationPlugin (no longer exist)
- Add Enabled property to all plugin examples (now required)
- Remove DisposeAsync and empty method stubs (default implementations exist)
- Add Dependency injection and modules section (Module, IStep, AddStep)
- Update Configuration section with constructor injection pattern
- Add INethermindPlugin interface reference table
- Update log output examples to match current PluginLoader format
- Update JSON-RPC handler sample with same fixes
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Nethermind plugin developer documentation to match the current plugin API, especially around required INethermindPlugin members, default interface implementations, and the modern DI/module-based initialization pattern.

Changes:

  • Updates plugin samples to include the required Enabled property and removes obsolete boilerplate method stubs.
  • Refreshes configuration guidance to show Autofac constructor injection and explains Enabled evaluation timing.
  • Adds documentation for DI modules and initialization steps, plus an INethermindPlugin member reference table and updated log output examples.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/developers/plugins/samples/json-rpc-handler.md Updates the JSON-RPC plugin sample to match the current INethermindPlugin surface (adds Enabled, removes unnecessary stubs).
docs/developers/plugins/plugins.md Refreshes core plugin docs: required members, updated logs, Autofac-based config injection, new DI/modules + steps section, and an INethermindPlugin reference table.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Nethermind uses [Autofac](https://autofac.org/) as its dependency injection (DI) container. Plugins can participate in DI by providing an Autofac `Module` through the `Module` property of `INethermindPlugin`. This is used to register services, override default implementations, and register initialization steps.

Here is an example of a plugin that registers a custom service and an initialization step:
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The text says this example "registers a custom service and an initialization step", but the code only registers an initialization step via builder.AddStep(typeof(DemoStep));. This is misleading—either add a service registration in the snippet or adjust the description to mention only steps.

Suggested change
Here is an example of a plugin that registers a custom service and an initialization step:
Here is an example of a plugin that registers an initialization step:

Copilot uses AI. Check for mistakes.

### Initialization steps (IStep) {#steps}

Initialization steps allow plugins to hook into Nethermind's startup sequence. Each step implements the [`IStep`](https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Api/Steps/IEthereumRunnerStep.cs) interface and is resolved through Autofac, so its dependencies are injected automatically via the constructor:
Copy link

Copilot AI Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The IStep link text points to a file named IEthereumRunnerStep.cs, which reads as a mismatch and makes it hard to confirm the correct interface. Consider updating the URL to the actual IStep definition (or adjusting the link text) so readers land on the right symbol.

Suggested change
Initialization steps allow plugins to hook into Nethermind's startup sequence. Each step implements the [`IStep`](https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Api/Steps/IEthereumRunnerStep.cs) interface and is resolved through Autofac, so its dependencies are injected automatically via the constructor:
Initialization steps allow plugins to hook into Nethermind's startup sequence. Each step implements the [`IStep`](https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Api/Steps/IStep.cs) interface and is resolved through Autofac, so its dependencies are injected automatically via the constructor:

Copilot uses AI. Check for mistakes.

### Initialization steps (IStep) {#steps}

Initialization steps allow plugins to hook into Nethermind's startup sequence. Each step implements the `IStep` interface (defined in [`IEthereumRunnerStep.cs`](https://github.com/NethermindEth/nethermind/blob/master/src/Nethermind/Nethermind.Api/Steps/IEthereumRunnerStep.cs)) and is resolved through Autofac, so its dependencies are injected automatically via the constructor:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should rename IEthereumRunnerStep.cs to just IStep.cs

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean in code, not in docs, right?

@rubo rubo merged commit 5ba6d3f into main Feb 25, 2026
1 check passed
@rubo rubo deleted the fix/update-plugins-docs branch February 25, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants