Esempio n. 1
0
        static void Main(string[] args)
        {
            AppDomain.CurrentDomain.ProcessExit += new EventHandler(CurrentDomain_ProcessExit);

            ClassConsole.SetTitle(0);

            // Show logo
            Config.LogoText();

            // Blockchain check
            DatabaseHandler.BlockchainCheckData();

            // Start node server
            StartNodeServer();

            // Start node client
            StartNodeClient();

            // Start api server
            StartApiConnection();

            //BlockHandler.CreateBlock();

            // Console key commands
            ConsoleKeyCommand();
        }
Esempio n. 2
0
        public static void CommandLine(string command)
        {
            switch (command.ToLower())
            {
            case ConsoleKey.CommandHelp:
                ClassConsole.WriteLine("(" + ConsoleKey.CommandStatus + ") Show status - (" + ConsoleKey.CommandHelp + ") This help message - (" + ConsoleKey.CommandExit + ") Exit", "KEYCOMMAND", Color.Blue, Color.Blue);
                break;

            case "t":
                NodeServer.sentToAll("test");
                break;

            case ConsoleKey.CommandExit:
                Environment.Exit(0);
                break;
            }
        }
Esempio n. 3
0
        private static void ConsoleKeyCommand()
        {
            Thread ConsoleReadLine = new Thread(delegate()
            {
                while (true)
                {
                    try
                    {
                        StringBuilder input = new StringBuilder();
                        var key             = Console.ReadKey(true);
                        input.Append(key.KeyChar);
                        ClassConsole.CommandLine(input.ToString());
                        input.Clear();
                    } catch { }
                }
            });

            ConsoleReadLine.Start();
        }