Commit d977f393 authored by khvostenko's avatar khvostenko

DeStream.DeStreamD and DeStream.BreezeD added for DeStream

parent 984c1469
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>DeStream.BreezeD</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>DeStream.BreezeD</PackageId>
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.LightWallet\Stratis.Bitcoin.Features.LightWallet.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Notifications\Stratis.Bitcoin.Features.Notifications.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Wallet\Stratis.Bitcoin.Features.Wallet.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup>
<PropertyGroup>
<RuntimeIdentifiers>win7-x86;win7-x64;win10-x86;win10-x64;osx.10.12-x64;ubuntu.14.04-x64;ubuntu.16.04-x64</RuntimeIdentifiers>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<PlatformTarget>AnyCPU</PlatformTarget>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
cd ..
start cmd /k dotnet run
timeout 21
start cmd /k dotnet run stratis
\ No newline at end of file
cd ..
start cmd /k dotnet run -testnet -debug=all -loglevel=debug
timeout 21
start cmd /k dotnet run stratis -testnet -debug=all -loglevel=debug
\ No newline at end of file
using System;
using System.Linq;
using System.Threading.Tasks;
using NBitcoin;
using NBitcoin.Protocol;
using Stratis.Bitcoin;
using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.Api;
using Stratis.Bitcoin.Features.LightWallet;
using Stratis.Bitcoin.Features.Notifications;
using Stratis.Bitcoin.Utilities;
namespace Stratis.BreezeD
{
public class Program
{
public static void Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{
try
{
// Get the API uri.
var isTestNet = args.Contains("-testnet");
var isDeStream= args.Contains("destream");
var agent = "Breeze";
NodeSettings nodeSettings;
if (isDeStream)
{
Network network = isTestNet ? Network.DeStreamTest : Network.DeStreamMain;
nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, agent, args:args, loadConfiguration:false);
}
else
{
nodeSettings = new NodeSettings(agent: agent, args: args, loadConfiguration:false);
}
IFullNodeBuilder fullNodeBuilder = new FullNodeBuilder()
.UseNodeSettings(nodeSettings)
.UseLightWallet()
.UseBlockNotification()
.UseTransactionNotification()
.UseApi();
IFullNode node = fullNodeBuilder.Build();
// Start Full Node - this will also start the API.
if (node != null)
await node.RunAsync();
}
catch (Exception ex)
{
Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message);
}
}
}
}
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Stratis.BreezeD")]
[assembly: AssemblyTrademark("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("1b598e33-667f-496d-bc0d-88276e8e7632")]
{
"profiles": {
"Bitcoin Main": {
"commandName": "Project",
"commandLineArgs": "-testnet"
},
"Bitcoin Test": {
"commandName": "Project",
"commandLineArgs": "-testnet -debug=all -loglevel=debug"
},
"Stratis Main": {
"commandName": "Project",
"commandLineArgs": "stratis "
},
"Stratis Test": {
"commandName": "Project",
"commandLineArgs": "stratis -testnet -debug=all -loglevel=debug"
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>DeStream.DeStreamD</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>DeStream.DeStreamD</PackageId>
<RuntimeFrameworkVersion>2.0.0</RuntimeFrameworkVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;IDE0008;</NoWarn>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.BlockStore\Stratis.Bitcoin.Features.BlockStore.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Consensus\Stratis.Bitcoin.Features.Consensus.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.MemoryPool\Stratis.Bitcoin.Features.MemoryPool.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Miner\Stratis.Bitcoin.Features.Miner.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.RPC\Stratis.Bitcoin.Features.RPC.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Wallet\Stratis.Bitcoin.Features.Wallet.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.0.0" />
<PackageReference Include="NLog" Version="5.0.0-beta09" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0-rtm-beta5" />
</ItemGroup>
</Project>
using System;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using NBitcoin;
using NBitcoin.Protocol;
using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.Api;
using Stratis.Bitcoin.Features.BlockStore;
using Stratis.Bitcoin.Features.Consensus;
using Stratis.Bitcoin.Features.MemoryPool;
using Stratis.Bitcoin.Features.Miner;
using Stratis.Bitcoin.Features.RPC;
using Stratis.Bitcoin.Features.Wallet;
using Stratis.Bitcoin.Utilities;
namespace Stratis.StratisD
{
public class Program
{
public static void Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{
try
{
Network network = null;
if (args.Contains("-testnet"))
network = Network.DeStreamTest;
else
network = Network.DeStreamMain;
NodeSettings nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args:args, loadConfiguration:false);
Console.WriteLine($"current network: {network.Name}");
// NOTES: running BTC and STRAT side by side is not possible yet as the flags for serialization are static
var node = new FullNodeBuilder()
.UseNodeSettings(nodeSettings)
.UsePosConsensus()
.UseBlockStore()
.UseMempool()
.UseWallet()
.AddPowPosMining()
.UseApi()
.AddRPC()
.Build();
if (node != null)
await node.RunAsync();
}
catch (Exception ex)
{
Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message);
}
}
}
}
using System.Reflection;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Stratis.StratisD")]
[assembly: AssemblyTrademark("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("34c17104-704e-4790-b398-d1f73cbee31e")]
<?xml version="1.0" encoding="utf-8"?>
<!--
https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<PublishProtocol>FileSystem</PublishProtocol>
<Configuration>Release</Configuration>
<TargetFramework>netcoreapp2.0</TargetFramework>
<PublishDir>bin\Release\PublishOutput</PublishDir>
</PropertyGroup>
</Project>
\ No newline at end of file
{
"profiles": {
"Stratis.StratisD": {
"commandName": "Project",
"commandLineArgs": "-testnet"
},
"Stratis.StratisD Test": {
"commandName": "Project",
"commandLineArgs": "-testnet"
},
"Stratis.StratisD Test with RPC": {
"commandName": "Project",
"commandLineArgs": "-testnet -server -rpcpassword=password -rpcuser=user"
},
"Stratis.StratisD Test Keepalive 60s": {
"commandName": "Project",
"commandLineArgs": "-testnet -keepalive=60"
}
}
}
\ No newline at end of file
......@@ -89,6 +89,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stratis.StratisDnsD", "Stra
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Stratis", "Stratis", "{A0CEDD86-D446-436E-8C35-261B30CEE5D3}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeStream.DeStreamD", "DeStream.DeStreamD\DeStream.DeStreamD.csproj", "{DFFB8C9F-4186-417F-A843-A5E1E6125164}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeStream.BreezeD", "DeStream.BreezeD\DeStream.BreezeD.csproj", "{5303E8B0-C422-4D1C-8096-24DF6AF75E31}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
......@@ -223,6 +227,14 @@ Global
{978482B2-AE17-421E-AD6F-ED9667C6B8A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{978482B2-AE17-421E-AD6F-ED9667C6B8A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{978482B2-AE17-421E-AD6F-ED9667C6B8A1}.Release|Any CPU.Build.0 = Release|Any CPU
{DFFB8C9F-4186-417F-A843-A5E1E6125164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFFB8C9F-4186-417F-A843-A5E1E6125164}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFFB8C9F-4186-417F-A843-A5E1E6125164}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFFB8C9F-4186-417F-A843-A5E1E6125164}.Release|Any CPU.Build.0 = Release|Any CPU
{5303E8B0-C422-4D1C-8096-24DF6AF75E31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5303E8B0-C422-4D1C-8096-24DF6AF75E31}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5303E8B0-C422-4D1C-8096-24DF6AF75E31}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5303E8B0-C422-4D1C-8096-24DF6AF75E31}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
......
This diff is collapsed.
......@@ -95,6 +95,11 @@ namespace Stratis.Bitcoin.Cli
defaultRestApiPort = 37221;
network = Network.StratisMain;
}
else if (networkName.Contains("destream"))
{
defaultRestApiPort = 37221;
network = Network.StratisMain;
}
else
{
defaultRestApiPort = 37220;
......
using NBitcoin;
using System.Linq;
namespace Stratis.Bitcoin.Utilities
{
......@@ -20,6 +21,26 @@ namespace Stratis.Bitcoin.Utilities
return network.Name.ToLowerInvariant().Contains("test");
}
/// <summary>
/// Determines whether this network is a Stratis-network.
/// </summary>
/// <param name="network">The network.</param>
/// <returns><c>true</c> if the specified network is Stratis, <c>false</c> otherwise.</returns>
public static bool IsStratis(this Network network)
{
return network.Name.ToLowerInvariant().Contains("stratis");
}
/// <summary>
/// Determines whether this network is a DeStream-network.
/// </summary>
/// <param name="network">The network.</param>
/// <returns><c>true</c> if the specified network is DeStream, <c>false</c> otherwise.</returns>
public static bool IsDeStream(this Network network)
{
return network.Name.ToLowerInvariant().Contains("destream");
}
/// <summary>
/// Determines whether this network is a bitcoin network.
/// </summary>
......@@ -27,7 +48,9 @@ namespace Stratis.Bitcoin.Utilities
/// <returns><c>true</c> if the specified network is bitcoin, <c>false</c> otherwise.</returns>
public static bool IsBitcoin(this Network network)
{
return !network.Name.ToLowerInvariant().Contains("stratis");
//return !(new string[] { "stratis", "destream" }.Any(s => network.Name.ToLowerInvariant().Contains(s)));
return !IsStratis(network) && !IsDeStream(network);
}
}
}
......@@ -27,18 +27,12 @@ namespace Stratis.BreezeD
// Get the API uri.
var isTestNet = args.Contains("-testnet");
var isStratis = args.Contains("stratis");
var isDestreamTest = args.Contains("-destreamtest");
var agent = "Breeze";
NodeSettings nodeSettings;
if(isDestreamTest)
{
Network network = Network.DestreamTest;
nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, agent, args: args, loadConfiguration: false);
}
else if (isStratis)
if (isStratis)
{
Network network = isTestNet ? Network.StratisTest : Network.StratisMain;
if (isTestNet)
......
{
"profiles": {
"Bitcoin Main": {
"commandName": "Project",
"commandLineArgs": "-destreamtest"
"commandName": "Project"
},
"Bitcoin Test": {
"commandName": "Project",
......
......@@ -31,10 +31,6 @@ namespace Stratis.StratisD
Network network = null;
if (args.Contains("-testnet"))
network = Network.StratisTest;
else if (args.Contains("-destreamtest"))
network = Network.DestreamTest;
else if (args.Contains("-destreamtestserver"))
network = Network.DestreamTestServer;
else
network = Network.StratisMain;
NodeSettings nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args:args, loadConfiguration:false);
......
{
"profiles": {
"Stratis.StratisD": {
"commandName": "Project",
"commandLineArgs": "-destreamtest"
"commandName": "Project"
},
"Stratis.StratisD Test": {
"commandName": "Project",
......
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