Пример #1
0
        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);
                    services.AddSingleton <ApiSettings>();
                    services.AddSingleton <ICertificateStore, CertificateStore>();

                    // Controller
                    services.AddTransient <NodeController>();
                });
            });

            return(fullNodeBuilder);
        }
 public ApiFeature(
     IFullNodeBuilder fullNodeBuilder,
     FullNode fullNode,
     ApiFeatureOptions apiFeatureOptions,
     ApiSettings apiSettings,
     ILoggerFactory loggerFactory)
 {
     this.fullNodeBuilder   = fullNodeBuilder;
     this.fullNode          = fullNode;
     this.apiFeatureOptions = apiFeatureOptions;
     this.apiSettings       = apiSettings;
     this.logger            = loggerFactory.CreateLogger(this.GetType().FullName);
 }
Пример #3
0
 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);
 }
Пример #4
0
        public ApiFeature(
            IFullNodeBuilder fullNodeBuilder,
            FullNode fullNode,
            ApiFeatureOptions apiFeatureOptions,
            ApiSettings apiSettings,
            ILoggerFactory loggerFactory,
            ICertificateStore certificateStore)
        {
            this.fullNodeBuilder   = fullNodeBuilder;
            this.fullNode          = fullNode;
            this.apiFeatureOptions = apiFeatureOptions;
            this.apiSettings       = apiSettings;
            this.certificateStore  = certificateStore;
            this.logger            = loggerFactory.CreateLogger("Impleum.Bitcoin.Fullnode");

            this.InitializeBeforeBase = true;
        }
Пример #5
0
        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);
        }