Beispiel #1
0
        public void start(bool verboseConsoleOutput)
        {
            UpdateVerify.start();

            // Generate presence list
            PresenceList.init(IxianHandler.publicIP, Config.serverPort, 'C');

            // Start the network queue
            NetworkQueue.start();

            ActivityStorage.prepareStorage();

            if (Config.apiBinds.Count == 0)
            {
                Config.apiBinds.Add("http://localhost:" + Config.apiPort + "/");
            }

            // Start the HTTP JSON API server
            apiServer = new APIServer(Config.apiBinds, Config.apiUsers, Config.apiAllowedIps);

            if (IXICore.Platform.onMono() == false && !Config.disableWebStart)
            {
                System.Diagnostics.Process.Start(Config.apiBinds[0]);
            }

            // Prepare stats screen
            ConsoleHelpers.verboseConsoleOutput = verboseConsoleOutput;
            Logging.consoleOutput = verboseConsoleOutput;
            Logging.flush();
            if (ConsoleHelpers.verboseConsoleOutput == false)
            {
                statsConsoleScreen.clearScreen();
            }

            // Start the node stream server
            NetworkServer.beginNetworkOperations();

            // Start the network client manager
            NetworkClientManager.start(2);

            // Start the keepalive thread
            PresenceList.startKeepAlive();

            // Start TIV
            string headers_path = "";

            if (IxianHandler.isTestNet)
            {
                headers_path = Path.Combine(Config.dataDirectory, "testnet-headers");
            }
            else
            {
                headers_path = Path.Combine(Config.dataDirectory, "headers");
            }
            if (generatedNewWallet || !File.Exists(Path.Combine(Config.dataDirectory, Config.walletFile)))
            {
                generatedNewWallet = false;
                tiv.start(headers_path);
            }
            else
            {
                tiv.start(headers_path, 0, null);
            }

            // Start the maintenance thread
            maintenanceThread = new Thread(performMaintenance);
            maintenanceThread.Start();

            pushNotifications = new PushNotifications(Config.pushServiceUrl);
            pushNotifications.start();
        }