Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions src/Networks/Rutanio/Rutanio.Node/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using Blockcore.Features.BlockStore;
using Blockcore.Features.ColdStaking;
using Blockcore.Features.Consensus;
using Blockcore.Features.Dns;
using Blockcore.Features.Diagnostic;
using Blockcore.Features.MemoryPool;
using Blockcore.Features.Miner;
Expand All @@ -22,18 +23,21 @@ public static async Task Main(string[] args)
{
try
{
var nodeSettings = new NodeSettings(networksSelector: Networks.Networks.Rutanio, args: args, agent: "Blockcore-RUTA");
var nodeSettings = new NodeSettings(networksSelector: Networks.Networks.Rutanio, args: args);

IFullNodeBuilder nodeBuilder = new FullNodeBuilder()
.UseNodeSettings(nodeSettings)
.UseBlockStore()
.UseMempool()
.UseNodeHost()
.AddRPC()
.UseDiagnosticFeature()
.UsePosConsensus()
.UseMempool()
.AddPowPosMining()
.UseColdStakingWallet();
.UseDiagnosticFeature()
.UseNodeHost()
.AddRPC();

// Build the Dns full node if enabled
UseDnsFullNode(nodeBuilder, nodeSettings);

IFullNode node = nodeBuilder.Build();

Expand All @@ -45,5 +49,17 @@ public static async Task Main(string[] args)
Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex);
}
}
static void UseDnsFullNode(IFullNodeBuilder nodeBuilder, NodeSettings nodeSettings)
{
if (nodeSettings.ConfigReader.GetOrDefault("dnsfullnode", false, nodeSettings.Logger))
{
var dnsSettings = new DnsSettings(nodeSettings);

if (string.IsNullOrWhiteSpace(dnsSettings.DnsHostName) || string.IsNullOrWhiteSpace(dnsSettings.DnsNameServer) || string.IsNullOrWhiteSpace(dnsSettings.DnsMailBox))
throw new ConfigurationException("When running as a DNS Seed service, the -dnshostname, -dnsnameserver and -dnsmailbox arguments must be specified on the command line.");

nodeBuilder.UseDns();
}
}
}
}
1 change: 1 addition & 0 deletions src/Networks/Rutanio/Rutanio.Node/Rutanio.Node.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

<ItemGroup>
<ProjectReference Include="..\..\..\External\NBitcoin\NBitcoin.csproj" />
<ProjectReference Include="..\..\..\Features\Blockcore.Features.Dns\Blockcore.Features.Dns.csproj" />
<ProjectReference Include="..\..\..\Features\Blockcore.Features.NodeHost\Blockcore.Features.NodeHost.csproj" />
<ProjectReference Include="..\..\..\Features\Blockcore.Features.BlockStore\Blockcore.Features.BlockStore.csproj" />
<ProjectReference Include="..\..\..\Features\Blockcore.Features.ColdStaking\Blockcore.Features.ColdStaking.csproj" />
Expand Down