Commit 56340876 authored by khvostenko's avatar khvostenko

DeStream.DeStreamDnsD temporary removed

parent aaa92836
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp2.0</TargetFramework>
<AssemblyName>DeStream.DeStreamDnsD</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>DeStream.DeStreamDnsD</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="..\DeStream.Bitcoin.Features.Api\DeStream.Bitcoin.Features.Api.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.BlockStore\DeStream.Bitcoin.Features.BlockStore.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.Consensus\DeStream.Bitcoin.Features.Consensus.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.Dns\DeStream.Bitcoin.Features.Dns.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.MemoryPool\DeStream.Bitcoin.Features.MemoryPool.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.Miner\DeStream.Bitcoin.Features.Miner.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.RPC\DeStream.Bitcoin.Features.RPC.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin.Features.Wallet\DeStream.Bitcoin.Features.Wallet.csproj" />
<ProjectReference Include="..\DeStream.Bitcoin\DeStream.Bitcoin.csproj" />
</ItemGroup>
</Project>
using System;
using System.Linq;
using System.Threading.Tasks;
using NBitcoin;
using NBitcoin.Protocol;
using DeStream.Bitcoin;
using DeStream.Bitcoin.Builder;
using DeStream.Bitcoin.Configuration;
using DeStream.Bitcoin.Features.Api;
using DeStream.Bitcoin.Features.BlockStore;
using DeStream.Bitcoin.Features.Consensus;
using DeStream.Bitcoin.Features.Dns;
using DeStream.Bitcoin.Features.MemoryPool;
using DeStream.Bitcoin.Features.Miner;
using DeStream.Bitcoin.Features.RPC;
using DeStream.Bitcoin.Features.Wallet;
using DeStream.Bitcoin.Utilities;
namespace DeStream.DeStreamDnsD
{
/// <summary>
/// Main entry point.
/// </summary>
public class Program
{
/// <summary>
/// The entry point for the DeStream Dns process.
/// </summary>
/// <param name="args">Command line arguments.</param>
public static void Main(string[] args)
{
MainAsync(args).Wait();
}
/// <summary>
/// The async entry point for the DeStream Dns process.
/// </summary>
/// <param name="args">Command line arguments.</param>
/// <returns>A task used to await the operation.</returns>
public static async Task MainAsync(string[] args)
{
try
{
Network network = args.Contains("-testnet") ? Network.DeStreamTest : Network.DeStreamMain;
NodeSettings nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args:args, loadConfiguration:false);
Action<DnsSettings> serviceTest = (s) =>
{
if (string.IsNullOrWhiteSpace(s.DnsHostName) || string.IsNullOrWhiteSpace(s.DnsNameServer) || string.IsNullOrWhiteSpace(s.DnsMailBox))
throw new ConfigurationException("When running as a DNS Seed service, the -dnshostname, -dnsnameserver and -dnsmailbox arguments must be specified on the command line.");
};
// Run as a full node with DNS or just a DNS service?
IFullNode node;
if (args.Contains("-dnsfullnode"))
{
// Build the Dns full node.
node = new FullNodeBuilder()
.UseNodeSettings(nodeSettings)
.UsePosConsensus()
.UseBlockStore()
.UseMempool()
.UseWallet()
.AddPowPosMining()
.UseApi()
.AddRPC()
.UseDns(serviceTest)
.Build();
}
else
{
// Build the Dns node.
node = new FullNodeBuilder()
.UseNodeSettings(nodeSettings)
.UsePosConsensus()
.UseApi()
.AddRPC()
.UseDns(serviceTest)
.Build();
}
// Run node.
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("DeStream.DeStreamDnsD")]
[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("572f57cb-5b00-46eb-bf5e-dcd6aa9fc2d1")]
\ No newline at end of file
{
"profiles": {
"DeStream.DeStreamDnsD": {
"commandName": "Project"
},
"DeStream.DeStreamDnsD Test": {
"commandName": "Project",
"commandLineArgs": "-testnet -dnslistenport=5399 -dnshostname=dns.destreamplatform.com -dnsnameserver=ns1.dns.destreamplatform.com -dnsmailbox=admin@destreamplatform.com"
},
"DeStream.DeStreamDnsD FullNode Test": {
"commandName": "Project",
"commandLineArgs": "-testnet -dnsfullnode -dnslistenport=5399 -dnshostname=dns.destreamplatform.com -dnsnameserver=ns1.dns.destreamplatform.com -dnsmailbox=admin@destreamplatform.com"
}
}
}
\ No newline at end of file
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