Exemple #1
0
        public static void Main(string[] args)
        {
            ILoggerFactory loggerFactory = new LoggerFactory()
                                           .AddConsole(LogLevel.Trace, false);

            Logs.Configure(loggerFactory);

            if (NodeSettings.PrintHelp(args, Network.StratisMain))
            {
                return;
            }

            var          network      = args.Contains("-testnet") ? InitStratisTest() : Network.StratisMain;
            NodeSettings nodeSettings = NodeSettings.FromArguments(args, "stratis", network, ProtocolVersion.ALT_PROTOCOL_VERSION);

            // 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()
                       .Build();

            // TODO: bring the logic out of IWebHost.Run()
            node.Start();
            Console.WriteLine("Press any key to stop");
            Console.ReadLine();
            node.Dispose();
        }
        public static void Main(string[] args)
        {
            ILoggerFactory loggerFactory = new LoggerFactory()
                                           .AddConsole(LogLevel.Trace, false);

            Logs.Configure(loggerFactory);

            if (NodeSettings.PrintHelp(args, Network.StratisMain))
            {
                return;
            }

            NodeSettings nodeSettings = NodeSettings.FromArguments(args, Network.StratisMain, ProtocolVersion.ALT_PROTOCOL_VERSION);

            // NOTES
            // - for now only download the stratis chain form peers
            // - adding consensus requires bigger changes
            // - running the nodes side by side is not possible yet as the flags for serialization are static

            var node = new FullNodeBuilder()
                       .UseNodeSettings(nodeSettings)
                       .Build();

            // TODO: bring the logic out of IWebHost.Run()
            node.Start();
            Console.WriteLine("Press any key to stop");
            Console.ReadLine();
            node.Dispose();
        }
        public static void Main(string[] args)
        {
            ILoggerFactory loggerFactory = Logs.GetLoggerFactory(args);

            Logs.Configure(loggerFactory);

            if (NodeSettings.PrintHelp(args, Network.Main))
            {
                return;
            }

            NodeSettings nodeSettings = NodeSettings.FromArguments(args);

            if (!Checks.VerifyAccess(nodeSettings))
            {
                return;
            }

            var node = new FullNodeBuilder()
                       .UseNodeSettings(nodeSettings)
                       .UseConsensus()
                       .UseBlockStore()
                       .UseMempool()
                       .AddMining(args.Any(a => a.Contains("mine")))
                       .AddRPC()
                       .Build();

            // TODO: bring the logic out of IWebHost.Run()
            node.Start();
            Console.WriteLine("Press any key to stop");
            Console.ReadLine();
            node.Dispose();
        }