public ApiFeature(IFullNodeBuilder fullNodeBuilder, FullNode fullNode, ApiFeatureOptions apiFeatureOptions, IAsyncLoopFactory asyncLoopFactory) { this.fullNodeBuilder = fullNodeBuilder; this.fullNode = fullNode; this.apiFeatureOptions = apiFeatureOptions; this.asyncLoopFactory = asyncLoopFactory; }
public ApiFeature( IFullNodeBuilder fullNodeBuilder, FullNode fullNode, ApiFeatureOptions apiFeatureOptions, IAsyncLoopFactory asyncLoopFactory, ILoggerFactory loggerFactory) { this.fullNodeBuilder = fullNodeBuilder; this.fullNode = fullNode; this.apiFeatureOptions = apiFeatureOptions; this.asyncLoopFactory = asyncLoopFactory; this.logger = loggerFactory.CreateLogger(this.GetType().FullName); }
public static IFullNodeBuilder UseApi(this IFullNodeBuilder fullNodeBuilder, Action <ApiFeatureOptions> optionsAction = null) { // TODO: move the options in to the feature builder var options = new ApiFeatureOptions(); optionsAction?.Invoke(options); fullNodeBuilder.ConfigureFeature(features => { features .AddFeature <ApiFeature>() .FeatureServices(services => { services.AddSingleton(fullNodeBuilder); services.AddSingleton(options); }); }); return(fullNodeBuilder); }