예제 #1
0
        static void Main(string[] args)
        {
            Mineracao.hashFacens = facade.FacensWebService.ReqBitcoinsWebService();
            Console.WriteLine(Mineracao.hashFacens);

            // Carrega IP do arquivo de IPs iniciais
            if (File.Exists(ipsFile))
            {
                IPs = JsonConvert.DeserializeObject <model.IPs>(File.ReadAllText(ipsFile));
            }

            // Carrega configurações
            if (!File.Exists(logPath))
            {
                using (StreamWriter sw = File.CreateText(logPath))
                    sw.WriteLine(DateTime.Now);
            }

            if (File.Exists(configFile))
            {
                configuracao = JsonConvert.DeserializeObject <model.Config>(File.ReadAllText(configFile));

                socket = new UdpClient(configuracao.Port);
                Thread receiver = new Thread(new ThreadStart(service.Receiver.Receive));
                receiver.Start();

                Thread sender = new Thread(new ThreadStart(service.Sender.RequestReatbeatSender));
                sender.Start();

                Thread lider = new Thread(new ThreadStart(service.Geral.ElegeLider));
                lider.Start();

                Thread mineracao = new Thread(new ThreadStart(service.Sender.RequestMineracaoSender));
                mineracao.Start();
            }
        }