Creating a new feature summaryΒΆ
This chapter summarizes the steps that you need to take to create a custom feature:
Create a
FullNodeBuilder
extension method for your feature. There is no specific naming convention for these methods, but something likeUseFeatureX()
would be ideal. The extension method will need its own static class. Again, a name likeFullNodeBuilderXExtension
is ideal for the class but this is not enforced.Create a class for the feature, which inherits from
FullNodeFeature
, and implement at least theIFullNodeFeature.InitializeAsync()
method.Populate your feature extensions method using the same pattern found in the other extension methods:
Call
FullNodeBuilder.ConfigureFeature()
with a lambda function as the parameter.Lambda A: Register your feature class with
IFeatureCollection.AddFeature()
and begin a fluid interface.If required, register dependencies by extending the fluid interface with calls to
IFeatureRegistration.DependOn()
.Extend the fluid interface by making a call to
IFeatureRegistration.FeatureServices()
with a lambda function as the parameter.Lambda B: Register your feature interfaces and classes as singleton services using
IServiceCollection.AddSingleton()
.
Place a call to your feature extension method in the Full Node Builder fluid interface found in
Main()
.