Commit 8a5b7393 authored by Sergei Zubov's avatar Sergei Zubov

Merge apps

parent 575a01fd
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>DeStream.Bitcoin.Cli</AssemblyName>
<RootNamespace>DeStream.Bitcoin.Cli</RootNamespace>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DeStream.Stratis.Bitcoin\DeStream.Stratis.Bitcoin.csproj" />
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.RPC\Stratis.Bitcoin.Features.RPC.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup>
</Project>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using DeStream.Stratis.Bitcoin.Configuration;
using NBitcoin;
using Newtonsoft.Json;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.RPC;
using Stratis.Bitcoin.Utilities.Extensions;
namespace DeStream.Bitcoin.Cli
{
public class Program
{
/// <summary>
/// The expected sequence of arguments:
/// <list>
/// <item>
/// 1, [network-name] [options] [rpc-command] [rpc-params].
/// </item>
/// <item>
/// 2, [network-name] [options] [api-controller "/" api-command] [api-params].
/// </item>
/// </list>
/// </summary>
public static void Main(string[] args)
{
try
{
// Preprocess the command line arguments
var argList = new List<string>(args);
string networkName = null;
if (argList.Any())
{
networkName = argList.First();
argList.RemoveAt(0);
}
var optionList = new List<string>();
while ((argList.Any()) && (argList[0].StartsWith('-')))
{
optionList.Add(argList[0]);
argList.RemoveAt(0);
}
string command = string.Empty;
if (argList.Any())
{
command = argList.First();
argList.RemoveAt(0);
}
var commandArgList = new List<string>(argList);
// Display help if required.
if (optionList.Contains("-help") || optionList.Contains("--help") || string.IsNullOrWhiteSpace(command))
{
var builder = new StringBuilder();
builder.AppendLine("Usage:");
builder.AppendLine(" dotnet run <DeStream.Stratis.Bitcoin.Cli/DeStream.Stratis.Bitcoin.Cli.dll> [network-name] [options] <command> [arguments]");
builder.AppendLine();
builder.AppendLine("Command line arguments:");
builder.AppendLine();
builder.AppendLine("[network-name] Name of the network - e.g. \"destream\", \"destreammain\", \"destreamtest\", \"bitcoinmain\", \"bitcointest\".");
builder.AppendLine("[options] Options for the CLI (optional) - e.g. -help, -rpcuser, see below.");
builder.AppendLine("[command] Name of RPC method or API <controller>/<method>.");
builder.AppendLine("[arguments] Argument by position (RPC) or Name = Value pairs (API) (optional).");
builder.AppendLine();
builder.AppendLine("Options:");
builder.AppendLine("-help This help message");
builder.AppendLine("-rpcconnect=<ip> Send commands to node running on <ip> (default: 127.0.0.1)");
builder.AppendLine("-rpcport=<port> Connect to JSON-RPC on <port> (default for destream: 26174 or default for Bitcoin: 8332)");
builder.AppendLine("-rpcuser=<user> Username for JSON-RPC connections");
builder.AppendLine("-rpcpassword=<pw> Password for JSON-RPC connections");
builder.AppendLine();
builder.AppendLine("Examples:");
builder.AppendLine();
builder.AppendLine("dotnet run destream Wallet/history WalletName=testwallet - Lists all the historical transactions of the wallet called 'testwallet'.");
builder.AppendLine("dotnet run destream getinfo -rpcuser=destreamtestuser -rpcpassword=destreamtestpassword -rpcconnect=127.0.0.3 -rpcport=26174 - Displays general information about the destream node on the 127.0.0.3:26174, authenticating with the RPC specified user.");
builder.AppendLine("dotnet run bitcoin getbalance -rpcuser=btctestuser -rpcpassword=btctestpass - Displays the current balance of the opened wallet on the 127.0.0.1:8332 node, authenticating with the RPC specified user.");
Console.WriteLine(builder);
return;
}
// Determine API port.
int defaultRestApiPort = 0;
Network network = null;
if (networkName.Contains("destream"))
{
defaultRestApiPort = 37221;
network = Network.DeStreamMain;
}
else
{
defaultRestApiPort = 37220;
network = Network.Main;
}
// API calls require both the contoller name and the method name separated by "/".
// If this is not an API call then assume it is an RPC call.
if (!command.Contains("/"))
{
// Process RPC call.
try
{
var options = optionList.ToArray();
DeStreamNodeSettings nodeSettings = new DeStreamNodeSettings(network, args:options);
var rpcSettings = new RpcSettings(nodeSettings);
// Find the binding to 127.0.0.1 or the first available. The logic in RPC settings ensures there will be at least 1.
System.Net.IPEndPoint nodeEndPoint = rpcSettings.Bind.FirstOrDefault(b => b.Address.ToString() == "127.0.0.1") ?? rpcSettings.Bind[0];
Uri rpcUri = new Uri($"http://{nodeEndPoint}");
// Process the command line RPC arguments
// TODO: this should probably be moved to the NodeSettings.FromArguments
if (options.GetValueOf("-rpcbind") != null)
{
rpcUri = new Uri($"http://{options.GetValueOf("-rpcbind")}");
}
if (options.GetValueOf("-rpcconnect") != null || options.GetValueOf("-rpcport") != null)
{
string rpcAddress = options.GetValueOf("-rpcconnect") ?? "127.0.0.1";
int rpcPort = rpcSettings.RPCPort;
int.TryParse(options.GetValueOf("-rpcport"), out rpcPort);
rpcUri = new Uri($"http://{rpcAddress}:{rpcPort}");
}
rpcSettings.RpcUser = options.GetValueOf("-rpcuser") ?? rpcSettings.RpcUser;
rpcSettings.RpcPassword = options.GetValueOf("-rpcpassword") ?? rpcSettings.RpcPassword;
Console.WriteLine($"Connecting to the following RPC node: http://{rpcSettings.RpcUser}:{rpcSettings.RpcPassword}@{rpcUri.Authority}...");
// Initialize the RPC client with the configured or passed userid, password and endpoint.
var rpcClient = new RPCClient($"{rpcSettings.RpcUser}:{rpcSettings.RpcPassword}", rpcUri, network);
// Execute the RPC command
Console.WriteLine($"Sending RPC command '{command} {string.Join(" ", commandArgList)}' to '{rpcUri}'...");
RPCResponse response = rpcClient.SendCommand(command, commandArgList.ToArray());
// Return the result as a string to the console.
Console.WriteLine(response.ResultString);
}
catch (Exception err)
{
Console.WriteLine(err.Message);
}
}
else
{
// Process API call.
using (var client = new HttpClient())
{
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
var url = $"http://localhost:{defaultRestApiPort}/api/{command}";
if (commandArgList.Any()) url += $"?{string.Join("&", commandArgList)}";
try
{
// Get the response.
Console.WriteLine($"Sending API command to {url}...");
var response = client.GetStringAsync(url).GetAwaiter().GetResult();
// Format and return the result as a string to the console.
Console.WriteLine(JsonConvert.SerializeObject(JsonConvert.DeserializeObject<object>(response), Formatting.Indented));
}
catch (Exception err)
{
Console.WriteLine(ExceptionToString(err));
}
}
}
}
catch (Exception err)
{
// Report any errors to the console.
Console.WriteLine(ExceptionToString(err));
}
}
/// <summary>
/// Determine both the exception message and any inner exception messages.
/// </summary>
/// <param name="exception">The exception object.</param>
/// <returns>Returns the exception message plus any inner exceptions.</returns>
public static string ExceptionToString(Exception exception)
{
bool isDebugMode = false;
#if DEBUG
isDebugMode = true;
#endif
Exception ex = exception;
StringBuilder stringBuilder = new StringBuilder(128);
while (ex != null)
{
if (isDebugMode)
stringBuilder.Append($"{ex.GetType().Name}: ");
stringBuilder.Append(ex.Message);
if (isDebugMode)
stringBuilder.AppendLine(ex.StackTrace);
ex = ex.InnerException;
if (ex != null)
stringBuilder.Append(" ---> ");
}
return stringBuilder.ToString();
}
}
}
\ No newline at end of file
{
"profiles": {
"Stratis.CLI Stratis REST API": {
"commandName": "Project",
"commandLineArgs": "stratis Wallet/files"
},
"Stratis.CLI Stratis RPC": {
"commandName": "Project",
"commandLineArgs": "stratis -rpcuser=stratistestuser -rpcpassword=stratistestpass -rpcport=26174 getinfo"
},
"Stratis.CLI Bitcoin RPC": {
"commandName": "Project",
"commandLineArgs": "bitcoin -rpcuser=btctestuser -rpcpassword=btctestpass getbalance"
}
}
}
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>DeStream.BreezeD</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<PackageId>DeStream.BreezeD</PackageId> <TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion> <LangVersion>7.1</LangVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DeStream.Stratis.Bitcoin\DeStream.Stratis.Bitcoin.csproj" />
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.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.LightWallet\Stratis.Bitcoin.Features.LightWallet.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Notifications\Stratis.Bitcoin.Features.Notifications.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.Networks\Stratis.Bitcoin.Networks.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" /> <ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup> </ItemGroup>
</Project>
<PropertyGroup> \ No newline at end of file
<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>
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DeStream.Stratis.Bitcoin.Configuration;
using NBitcoin;
using NBitcoin.Protocol; using NBitcoin.Protocol;
using Stratis.Bitcoin; using Stratis.Bitcoin;
using Stratis.Bitcoin.Builder; using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.Api; using Stratis.Bitcoin.Features.Api;
using Stratis.Bitcoin.Features.LightWallet; using Stratis.Bitcoin.Features.LightWallet;
using Stratis.Bitcoin.Features.Notifications; using Stratis.Bitcoin.Features.Notifications;
using Stratis.Bitcoin.Networks;
using Stratis.Bitcoin.Utilities; using Stratis.Bitcoin.Utilities;
namespace DeStream.BreezeD namespace DeStream.BreezeD
{ {
public class Program class Program
{ {
public static void Main(string[] args) public static async Task Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{ {
try try
{ {
// Get the API uri. string agent = "Breeze";
Network network = args.Contains("-testnet") ? Network.DeStreamTest : Network.DeStreamMain;
var nodeSettings = new DeStreamNodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: args, NodeSettings nodeSettings;
loadConfiguration: false);
nodeSettings = new NodeSettings(networksSelector: Networks.DeStream,
protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, agent: agent, args: args);
IFullNodeBuilder fullNodeBuilder = new FullNodeBuilder() IFullNodeBuilder fullNodeBuilder = new FullNodeBuilder()
.UseNodeSettings(nodeSettings) .UseNodeSettings(nodeSettings)
.UseDeStreamLightWallet() .UseDeStreamLightWallet()
...@@ -45,7 +41,7 @@ namespace DeStream.BreezeD ...@@ -45,7 +41,7 @@ namespace DeStream.BreezeD
} }
catch (Exception ex) catch (Exception ex)
{ {
Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString());
} }
} }
} }
......
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")]
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>netcoreapp2.1</TargetFramework>
<AssemblyName>DeStream.DeStreamD</AssemblyName>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<PackageId>DeStream.DeStreamD</PackageId> <TargetFramework>netcoreapp2.1</TargetFramework>
<RuntimeFrameworkVersion>2.1.1</RuntimeFrameworkVersion> <LangVersion>7.1</LangVersion>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;IDE0008;</NoWarn>
</PropertyGroup>
<PropertyGroup>
<LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="NLog" Version="4.5.6" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DeStream.Stratis.Bitcoin\DeStream.Stratis.Bitcoin.csproj" />
<ProjectReference Include="..\NBitcoin\NBitcoin.csproj" /> <ProjectReference Include="..\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.csproj" /> <ProjectReference Include="..\Stratis.Bitcoin.Features.Api\Stratis.Bitcoin.Features.Api.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Apps\Stratis.Bitcoin.Features.Apps.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.BlockStore\Stratis.Bitcoin.Features.BlockStore.csproj" /> <ProjectReference Include="..\Stratis.Bitcoin.Features.BlockStore\Stratis.Bitcoin.Features.BlockStore.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.ColdStaking\Stratis.Bitcoin.Features.ColdStaking.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Consensus\Stratis.Bitcoin.Features.Consensus.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.MemoryPool\Stratis.Bitcoin.Features.MemoryPool.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Miner\Stratis.Bitcoin.Features.Miner.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.Networks\Stratis.Bitcoin.Networks.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin.Features.Wallet\Stratis.Bitcoin.Features.Wallet.csproj" /> <ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="destream.service">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup> </ItemGroup>
</Project>
</Project> \ No newline at end of file
using System; using System;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using DeStream.Stratis.Bitcoin.Configuration;
using NBitcoin;
using NBitcoin.Protocol; using NBitcoin.Protocol;
using Stratis.Bitcoin; using Stratis.Bitcoin;
using Stratis.Bitcoin.Builder; using Stratis.Bitcoin.Builder;
using Stratis.Bitcoin.Configuration;
using Stratis.Bitcoin.Features.Api; using Stratis.Bitcoin.Features.Api;
using Stratis.Bitcoin.Features.Apps;
using Stratis.Bitcoin.Features.BlockStore; using Stratis.Bitcoin.Features.BlockStore;
using Stratis.Bitcoin.Features.Consensus; using Stratis.Bitcoin.Features.Consensus;
using Stratis.Bitcoin.Features.MemoryPool; using Stratis.Bitcoin.Features.MemoryPool;
using Stratis.Bitcoin.Features.Miner; using Stratis.Bitcoin.Features.Miner;
using Stratis.Bitcoin.Features.RPC; using Stratis.Bitcoin.Features.RPC;
using Stratis.Bitcoin.Features.Wallet; using Stratis.Bitcoin.Features.Wallet;
using Stratis.Bitcoin.Networks;
using Stratis.Bitcoin.Utilities; using Stratis.Bitcoin.Utilities;
namespace DeStream.DeStreamD namespace DeStream.DeStreamD
{ {
public class Program public class Program
{ {
public static void Main(string[] args) public static async Task Main(string[] args)
{
MainAsync(args).Wait();
}
public static async Task MainAsync(string[] args)
{ {
try try
{ {
Network network = args.Contains("-testnet") ? Network.DeStreamTest : Network.DeStreamMain; var nodeSettings = new NodeSettings(networksSelector: Networks.DeStream,
protocolVersion: ProtocolVersion.PROVEN_HEADER_VERSION, args: args)
var nodeSettings = new DeStreamNodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: args, {
loadConfiguration: false); MinProtocolVersion = ProtocolVersion.ALT_PROTOCOL_VERSION
};
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
IFullNode node = new FullNodeBuilder() IFullNode node = new FullNodeBuilder()
.UseNodeSettings(nodeSettings) .UseNodeSettings(nodeSettings)
.UseBlockStore() .UseBlockStore()
.UseDeStreamPosConsensus() .UseDeStreamPosConsensus()
.UseDeStreamMempool() .UseDeStreamMempool()
.UseDeStreamWallet() .UseDeStreamWallet()
.AddDeStreamPowPosMining() .AddPowPosMining()
.UseApi() .UseApi()
.UseApps()
.AddRPC() .AddRPC()
.Build(); .Build();
...@@ -56,4 +50,4 @@ namespace DeStream.DeStreamD ...@@ -56,4 +50,4 @@ namespace DeStream.DeStreamD
} }
} }
} }
} }
\ No newline at end of file
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")]
...@@ -166,6 +166,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stratis.SmartContracts.Stan ...@@ -166,6 +166,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stratis.SmartContracts.Stan
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stratis.SmartContracts.RuntimeObserver", "Stratis.SmartContracts.RuntimeObserver\Stratis.SmartContracts.RuntimeObserver.csproj", "{8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stratis.SmartContracts.RuntimeObserver", "Stratis.SmartContracts.RuntimeObserver\Stratis.SmartContracts.RuntimeObserver.csproj", "{8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeStream.DeStreamD", "DeStream.DeStreamD\DeStream.DeStreamD.csproj", "{09262A6E-DAC6-48CF-8EF5-7A575FFADD64}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeStream.BreezeD", "DeStream.BreezeD\DeStream.BreezeD.csproj", "{AB5BCFEF-FBBB-4ECD-9AA4-63699EBA434C}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
...@@ -432,6 +436,14 @@ Global ...@@ -432,6 +436,14 @@ Global
{8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU {8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU {8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Release|Any CPU.Build.0 = Release|Any CPU {8FEFF18B-3546-4237-8FD1-9F184BC7B4C7}.Release|Any CPU.Build.0 = Release|Any CPU
{09262A6E-DAC6-48CF-8EF5-7A575FFADD64}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09262A6E-DAC6-48CF-8EF5-7A575FFADD64}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09262A6E-DAC6-48CF-8EF5-7A575FFADD64}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09262A6E-DAC6-48CF-8EF5-7A575FFADD64}.Release|Any CPU.Build.0 = Release|Any CPU
{AB5BCFEF-FBBB-4ECD-9AA4-63699EBA434C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB5BCFEF-FBBB-4ECD-9AA4-63699EBA434C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB5BCFEF-FBBB-4ECD-9AA4-63699EBA434C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB5BCFEF-FBBB-4ECD-9AA4-63699EBA434C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
......
using System;
using System.IO;
using Microsoft.Extensions.Logging;
using NBitcoin;
using NBitcoin.Protocol;
using Stratis.Bitcoin.Configuration.Logging;
using Stratis.Bitcoin.Utilities;
using Stratis.Bitcoin.Configuration;
using System.Collections.Generic;
using Stratis.Bitcoin.Builder.Feature;
using Stratis.Bitcoin.Utilities.Extensions;
namespace DeStream.Stratis.Bitcoin.Configuration
{
/// <summary>
/// Node configuration complied from both the application command line arguments and the configuration file.
/// </summary>
public class DeStreamNodeSettings : NodeSettings
{
/// <summary>
/// Initializes a new instance of the object.
/// </summary>
/// <param name="innerNetwork">Specification of the network the node runs on - regtest/testnet/mainnet.</param>
/// <param name="protocolVersion">Supported protocol version for which to create the configuration.</param>
/// <param name="agent">The nodes user agent that will be shared with peers.</param>
public DeStreamNodeSettings(Network innerNetwork = null, ProtocolVersion protocolVersion = SupportedProtocolVersion,
string agent = "DeStream", string[] args = null, bool loadConfiguration = true)
: base ("DeStreamNode", innerNetwork, protocolVersion, agent, args)
{
}
}
}
\ No newline at end of file
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Description>DeStream FullNode</Description>
<AssemblyTitle>DeStream.Stratis.Bitcoin</AssemblyTitle>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>DeStream.Stratis.Bitcoin</AssemblyName>
<PackageId>DeStream.Stratis.Bitcoin</PackageId>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<GenerateAssemblyDescriptionAttribute>false</GenerateAssemblyDescriptionAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<GenerateAssemblyCopyrightAttribute>false</GenerateAssemblyCopyrightAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<Version>1.1.0-beta</Version>
<GeneratePackageOnBuild>False</GeneratePackageOnBuild>
</PropertyGroup>
<ItemGroup>
<Compile Remove="Base\**" />
<Compile Remove="BlockPulling\**" />
<Compile Remove="Broadcasting\**" />
<Compile Remove="Builder\**" />
<EmbeddedResource Remove="Base\**" />
<EmbeddedResource Remove="BlockPulling\**" />
<EmbeddedResource Remove="Broadcasting\**" />
<EmbeddedResource Remove="Builder\**" />
<None Remove="Base\**" />
<None Remove="BlockPulling\**" />
<None Remove="Broadcasting\**" />
<None Remove="Builder\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="ConcurrentHashSet" Version="1.0.2" />
<PackageReference Include="DBreeze" Version="1.89.0" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Core" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.Formatters.Json" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Mvc.ViewFeatures" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.IISIntegration" Version="2.1.1" />
<PackageReference Include="Microsoft.AspNetCore.Server.Kestrel" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="2.1.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="2.1.1" />
<PackageReference Include="NLog" Version="4.5.6" />
<PackageReference Include="NLog.Extensions.Logging" Version="1.0.0" />
<PackageReference Include="System.ValueTuple" Version="4.3.1" />
<PackageReference Include="System.Xml.XmlSerializer" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Stratis.Bitcoin\Stratis.Bitcoin.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="Configuration\" />
</ItemGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<OutputType>Library</OutputType>
</PropertyGroup>
<PropertyGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<DefineConstants>$(DefineConstants);NETCORE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<NoWarn>1701;1702;1705;IDE0008;</NoWarn>
<DocumentationFile></DocumentationFile>
</PropertyGroup>
</Project>
using System.Reflection;
using System.Runtime.CompilerServices;
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: AssemblyTitle("Stratis.Bitcoin")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Stratis.Bitcoin")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// 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("a6c18cae-7246-41b1-bfd6-c54ba1694ac2")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.1.0.0")]
[assembly: AssemblyFileVersion("1.1.0.0")]
[assembly: InternalsVisibleTo("Stratis.Bitcoin.Tests")]
...@@ -22,5 +22,14 @@ namespace Stratis.Bitcoin.Networks ...@@ -22,5 +22,14 @@ namespace Stratis.Bitcoin.Networks
return new NetworksSelector(() => new StratisMain(), () => new StratisTest(), () => new StratisRegTest()); return new NetworksSelector(() => new StratisMain(), () => new StratisTest(), () => new StratisRegTest());
} }
} }
public static NetworksSelector DeStream
{
get
{
// TODO: DeStreamRegTest?
return new NetworksSelector(() => new DeStreamMain(), () => new DeStreamTest(), () => new DeStreamTest());
}
}
} }
} }
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