docs: update plugins page to match current Nethermind API#330
Conversation
- 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
There was a problem hiding this comment.
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
Enabledproperty and removes obsolete boilerplate method stubs. - Refreshes configuration guidance to show Autofac constructor injection and explains
Enabledevaluation timing. - Adds documentation for DI modules and initialization steps, plus an
INethermindPluginmember 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.
docs/developers/plugins/plugins.md
Outdated
|
|
||
| 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: |
There was a problem hiding this comment.
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.
| 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: |
docs/developers/plugins/plugins.md
Outdated
|
|
||
| ### 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: |
There was a problem hiding this comment.
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.
| 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: |
docs/developers/plugins/plugins.md
Outdated
|
|
||
| ### 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: |
There was a problem hiding this comment.
We should rename IEthereumRunnerStep.cs to just IStep.cs
There was a problem hiding this comment.
You mean in code, not in docs, right?
Summary
Updates the plugins documentation to reflect the current state of the Nethermind codebase.
Changes