Commit fc9814a6 authored by Jeremy Bokobza's avatar Jeremy Bokobza

Added Api as a feature of the Full Node

parent ead042b2
...@@ -257,3 +257,4 @@ ModelManifest.xml ...@@ -257,3 +257,4 @@ ModelManifest.xml
# DNX # DNX
project.lock.json project.lock.json
/Breeze/src/Breeze.Deamon/Wallets
using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Builder.Feature;
namespace Breeze.Api
{
public class ApiFeature : FullNodeFeature
{
public override void Start()
{
Program.Main(null);
}
}
public static class ApiFeatureExtension
{
public static IFullNodeBuilder UseApi(this IFullNodeBuilder fullNodeBuilder)
{
fullNodeBuilder.ConfigureFeature(features =>
{
features
.AddFeature<ApiFeature>()
.FeatureServices(services =>
{
});
});
return fullNodeBuilder;
}
}
}
...@@ -12,14 +12,14 @@ namespace Breeze.Api ...@@ -12,14 +12,14 @@ namespace Breeze.Api
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var host = new WebHostBuilder() var host = new WebHostBuilder()
.UseKestrel() .UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory()) .UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration() .UseIISIntegration()
.UseStartup<Startup>() .UseStartup<Startup>()
.Build(); .Build();
host.Run(); host.Run();
} }
} }
} }
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1", "Microsoft.Extensions.Options.ConfigurationExtensions": "1.1.1",
"Microsoft.NETCore.App": "1.1.0", "Microsoft.NETCore.App": "1.1.0",
"NBitcoin": "3.0.2.10", "NBitcoin": "3.0.2.10",
"Stratis.Bitcoin": "1.0.1.2-alpha",
"System.Reactive": "3.1.1" "System.Reactive": "3.1.1"
}, },
......
using System.Threading; using System.Threading;
using Breeze.Api;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Stratis.Bitcoin; using Stratis.Bitcoin;
using Stratis.Bitcoin.Builder; using Stratis.Bitcoin.Builder;
...@@ -18,7 +19,7 @@ namespace Breeze.Deamon ...@@ -18,7 +19,7 @@ namespace Breeze.Deamon
var node = (FullNode)new FullNodeBuilder() var node = (FullNode)new FullNodeBuilder()
.UseNodeSettings(nodeSettings) .UseNodeSettings(nodeSettings)
//.UseWallet() //.UseWallet()
//.UseApi() .UseApi()
//.UseBlockNotification() //.UseBlockNotification()
.Build(); .Build();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment