public static async Task MainAsync(string[] args) { try { Network network = args.Contains("-testnet") ? Network.XelsTest : Network.XelsMain; NodeSettings nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: args, loadConfiguration: false); 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); } }
public static async Task MainAsync(string[] args) { try { var nodeSettings = new NodeSettings(networksSelector: Networks.Impleum, protocolVersion: ProtocolVersion.PROVEN_HEADER_VERSION, args: args, agent: "ImpleumNode") { MinProtocolVersion = ProtocolVersion.ALT_PROTOCOL_VERSION }; IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .UseMempool() .UseWallet() .AddPowPosMining() .UseApi() .UseApps() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
public static async Task MainAsync(string[] args) { try { if (!args.Any(a => a.Contains("apiport"))) { // TEMP set the default port to 38225 if it isn't set. args = args.Concat(new[] { "apiport=38225" }).ToArray(); } NodeSettings nodeSettings = new NodeSettings(ApexNetwork.Test, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args); string[] seedNodes = { "104.211.178.243", "51.144.35.218", "65.52.5.149", "51.140.231.125", "13.70.81.5" }; ApexNetwork.Test.SeedNodes.AddRange(ConvertToNetworkAddresses(seedNodes, ApexNetwork.Test.DefaultPort).ToList()); var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePowConsensus() .UseMempool() .AddRPC() .UseWallet() .UseApi() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
public static async Task MainAsync(string[] args) { try { NodeSettings nodeSettings = new NodeSettings(protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args); Stratis.Bitcoin.IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .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); } }
public static async Task Main(string[] args) { try { const string agent = "RedstoneSpv"; Network network = args.Contains("-testnet") ? NetworkRegistration.Register(new RedstoneTest()) : args.Contains("-regnet") ? NetworkRegistration.Register(new RedstoneRegTest()) : NetworkRegistration.Register(new RedstoneMain()); var nodeSettings = new NodeSettings(network: network, protocolVersion: ProtocolVersion.PROVEN_HEADER_VERSION, args: args) { MinProtocolVersion = ProtocolVersion.ALT_PROTOCOL_VERSION }; var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseLightWallet() .UseBlockNotification() .UseTransactionNotification() .UseApi() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
public static async Task Main(string[] args) { try { var nodeSettings = new NodeSettings(networksSelector: Networks.Stratis, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args); IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .UseMempool() .UseColdStakingWallet() .AddPowPosMining() .UseApi() .UseApps() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString()); } }
public static async Task Main(string[] args) { try { Network network = new PoANetwork(); var nodeSettings = new NodeSettings(args: args, network: network); bool keyGenerationRequired = nodeSettings.ConfigReader.GetOrDefault("generateKeyPair", false); if (keyGenerationRequired) { GenerateFederationKey(nodeSettings.DataFolder); return; } IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePoAConsensus() .UseMempool() .UseWallet() .UseApi() .UseApps() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem running the node. Details: '{0}'", ex.ToString()); } }
public static async Task MainAsync(string[] args) { try { NodeSettings nodeSettings = new NodeSettings(new SmartContractsPoATest(), ProtocolVersion.ALT_PROTOCOL_VERSION, "StratisSC", args: args); Bitcoin.IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .AddRPC() .AddSmartContracts() .UseSmartContractPoAConsensus() .UseSmartContractPoAMining() .UseSmartContractWallet() .UseReflectionExecutor() .UseApi() .UseMempool() .Build(); await node.RunAsync(); } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString()); } }
public static async Task MainAsync(string[] args) { try { string agent = "BiblePayStratis"; Network network = false ? Network.StratisTest : Network.BiblepayMain; // BIBLEPAY - TODO - ADD 5 SEED NODES SO USER CAN SYNC THE VERY FIRST TIME // FOR NOW, WE ARE ADDING ONE HARDCODED NODE (dns1.biblepay.org) args = args.Append("-addnode=144.202.45.226").ToArray(); var nodeSettings = new NodeSettings(network, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, agent, args: args); //nodeSettings.ApiUri = new Uri(string.IsNullOrEmpty(apiUri) ? DefaultStratisUri : apiUri); IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePowConsensus() .UseMempool() .UseWallet() .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); } }
public static async Task Main(string[] args) { try { // var networkIdentifier = "test"; var nodeSettings = new NodeSettings(networksSelector: GetNetwork(chain), protocolVersion: ProtocolVersion.PROVEN_HEADER_VERSION, args: args, agent: "Redstone") { MinProtocolVersion = ProtocolVersion.ALT_PROTOCOL_VERSION }; IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .UseMempool() .UseColdStakingWallet() .AddPowPosMining() .UseApi() .UseApps() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString()); } }
public static async Task Main(string[] args) { try { var nodeSettings = new NodeSettings(network: new LocalSmartContracts(), protocolVersion: ProtocolVersion.PROVEN_HEADER_VERSION, args: args, agent: "LSC_Standard_Node") { MinProtocolVersion = ProtocolVersion.ALT_PROTOCOL_VERSION }; IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UseMempool() .AddSmartContracts(options => { options.UseReflectionExecutor(); }) .UseSmartContractPoAConsensus() .UseSmartContractPoAMining() .UseSmartContractWallet() .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); } }
#pragma warning disable IDE1006 // Naming Styles public static async Task Main(string[] args) #pragma warning restore IDE1006 // Naming Styles { try { var nodeSettings = new NodeSettings(networksSelector: Networks.Bitcoin, args: args); IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePowConsensus() .UseMempool() .AddMining() .AddRPC() .UseWallet() .UseNodeHost() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString()); } }
public static async Task MainAsync(string[] args) { try { args = new List <string>(args) { "mine=1", "mineaddress=MbPPopMepRTPQVJvohuKAjdZ66dw1ADKda", "minecpupercentage=80" }.ToArray(); // Network network = args.Contains("-testnet") ? Network.PurpleTest : Network.PurpleMain; Network network = Network.PurpleTest; NodeSettings nodeSettings = new NodeSettings("Purple", network, ProtocolVersion.ALT_PROTOCOL_VERSION).LoadArguments(args); var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UsePurpleConsensus() .UseBlockStore() .UseMempool() .UseWallet() .AddPowPosMining() .UseApi() .AddRPC() .Build(); await node.RunAsync(); } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
public static async Task MainAsync(string[] args) { try { Network network = args.Contains("-testnet") ? Network.BatzTest : Network.BatzMain; NodeSettings nodeSettings = new NodeSettings("batz", network, ProtocolVersion.ALT_PROTOCOL_VERSION).LoadArguments(args); // 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) .UseStratisConsensus() .UseBlockStore() .UseMempool() .UseWallet() .AddPowPosMining() .UseApi() .AddRPC() .Build(); await node.RunAsync(); } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
public static async Task MainAsync(string[] args) { try { var network = args.Contains("-testnet") ? Network.StratisTest : Network.StratisMain; var nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: args, loadConfiguration: false); // 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(settings => settings.TxIndex = true) .UseAzureIndexer() .Build(); // Run node. if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine($"There was a problem initializing the node. Details: '{ex.Message}'"); Console.ReadLine(); } }
public static async Task MainAsync(string[] args) { try { NodeSettings nodeSettings = new NodeSettings(protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args, loadConfiguration: false); // 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); } }
public static async Task MainAsync(string[] args) { try { NodeSettings nodeSettings = new NodeSettings(args: args, loadConfiguration: false); var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UsePowConsensus() .UseBlockStore() .UseMempool() .AddMining() .AddRPC() .UseWallet() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
/// <summary> /// The async entry point for the Stratis 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.StratisTest : Network.StratisMain; NodeSettings nodeSettings = new NodeSettings(network, ProtocolVersion.ALT_PROTOCOL_VERSION, args: args); DnsSettings dnsSettings = new DnsSettings().Load(nodeSettings); // Verify that the DNS host, nameserver and mailbox arguments are set. if (string.IsNullOrWhiteSpace(dnsSettings.DnsHostName) || string.IsNullOrWhiteSpace(dnsSettings.DnsNameServer) || string.IsNullOrWhiteSpace(dnsSettings.DnsMailBox)) { throw new ArgumentException("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? if (dnsSettings.DnsFullNode) { // Build the Dns full node. IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UsePosConsensus() .UseBlockStore() .UseMempool() .UseWallet() .AddPowPosMining() .UseApi() .AddRPC() .UseDns() .Build(); // Run node. if (node != null) { await node.RunAsync(); } } else { // Build the Dns node. IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UsePosConsensus() .UseApi() .AddRPC() .UseDns() .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); } }
public static async Task Main(string[] args) { NodeSettings nodeSettings = NodeSettings.FromArguments(args); var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseConsensus() .UseBlockStore() .UseMempool() .AddMining() .AddRPC() .Build(); await node.RunAsync(); }
public static async Task MainAsync(string[] args) { Network network = args.Contains("-testnet") ? Network.StratisTest : Network.StratisMain; NodeSettings nodeSettings = new NodeSettings("stratis", network, ProtocolVersion.ALT_PROTOCOL_VERSION); nodeSettings = nodeSettings.LoadArguments(args); // 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) .UseStratisConsensus() .UseIndexStore() .UseMempool() .Build(); await node.RunAsync(); }
public static async Task Main(string[] args) { try { if (!ContainsDataDirRoot(args)) { args = AddDefaultDataDirRoot(args); } var nodeSettings = new NodeSettings( networksSelector: Networks.Solaris, protocolVersion: ProtocolVersion.PROTOCOL_VERSION, agent: Agent, args: args) { MinProtocolVersion = ProtocolVersion.PROTOCOL_VERSION }; IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .UseMempool() .UseColdStakingWallet() .AddPowPosMining() .UseApi() .UseApps() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine($"There was a problem initializing the node. Details: '{ex}'"); } }
public static async Task MainAsync(string[] args) { try { NodeSettings nodeSettings = new NodeSettings().LoadArguments(args); var node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseConsensus() .UseBlockStore() .UseMempool() .AddMining() .AddRPC() .Build(); await node.RunAsync(); } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }
/// <summary> /// The async entry point for the Stratis 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 { var nodeSettings = new NodeSettings(networksSelector: FederatedPegNetwork.NetworksSelector, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, args: args); 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."); } // Build the Dns full node. IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .AddSmartContracts() .UseSmartContractPoAConsensus() .UseSmartContractPoAMining() .UseSmartContractWallet() .UseReflectionExecutor() .UseMempool() .UseApi() .UseDns() .Build(); // Run node. if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.ToString()); } }
/// <summary> /// City.Chain daemon can be launched with options to specify coin and network, using the parameters -chain and -testnet. It defaults to City main network. /// </summary> /// <example> /// dotnet city.chain.dll -coin bitcoin -network regtest /// dotnet city.chain.dll -coin city -network test /// </example> /// <param name="args"></param> /// <returns></returns> public static async Task Main(string[] args) { try { // Temporary enforce testnet if anyone launces without -testnet parameter. TODO: Remove before mainnet launch. args = args.Append("-testnet").ToArray(); // To avoid modifying Stratis source, we'll parse the arguments and set some hard-coded defaults for City Chain, like the ports. var configReader = new TextFileConfiguration(args ?? new string[] { }); var networkIdentifier = "main"; if (configReader.GetOrDefault <bool>("testnet", false)) { networkIdentifier = "testnet"; } else if (configReader.GetOrDefault <bool>("regtest", false)) { networkIdentifier = "regtest"; } // City Chain daemon supports multiple networks, supply the chain parameter to change it. // Example: -chain=bitcoin var chain = configReader.GetOrDefault <string>("chain", "city"); var networkConfiguration = new NetworkConfigurations().GetNetwork(networkIdentifier, chain); if (networkConfiguration == null) { throw new ArgumentException($"The supplied chain ({chain}) and network ({networkIdentifier}) parameters did not result in a valid network."); } var network = GetNetwork(networkConfiguration.Identifier, networkConfiguration.Chain); // Register the network found. NetworkRegistration.Register(network); if (args.Contains("-generate")) { GenerateAddressKeyPair(network); return; } args = args .Append("-apiport=" + networkConfiguration.ApiPort) .Append("-txindex=1") // Required for History (Block) explorer. .Append("-wsport=" + networkConfiguration.WsPort).ToArray(); var nodeSettings = new NodeSettings( args: args, protocolVersion: ProtocolVersion.ALT_PROTOCOL_VERSION, network: network, agent: "CityChain"); // Write the schema version, if not already exists. var infoPath = System.IO.Path.Combine(nodeSettings.DataDir, "city.info"); if (!System.IO.File.Exists(infoPath)) { // For clients earlier than this version, the database already existed so we'll // write that it is currently version 100. var infoBuilder = new System.Text.StringBuilder(); // If the chain exists from before, but we did not have .info file, the database is old version. if (System.IO.Directory.Exists(Path.Combine(nodeSettings.DataDir, "chain"))) { infoBuilder.AppendLine("dbversion=100"); } else { infoBuilder.AppendLine("dbversion=110"); } File.WriteAllText(infoPath, infoBuilder.ToString()); } else { var fileConfig = new TextFileConfiguration(File.ReadAllText(infoPath)); var dbversion = fileConfig.GetOrDefault <int>("dbversion", 110); } IFullNode node = new FullNodeBuilder() .UseNodeSettings(nodeSettings) .UseBlockStore() .UsePosConsensus() .UseMempool() .UseWallet() .AddPowPosMining() //.UseBlockNotification() //.UseTransactionNotification() //.AddSimpleWallet() .UseApi() //.UseApps() //.UseDns() .AddRPC() .Build(); if (node != null) { await node.RunAsync(); } } catch (Exception ex) { Console.WriteLine("There was a problem initializing the node. Details: '{0}'", ex.Message); } }