예제 #1
0
 private void ConsensusNormal(double averageTime, int height)
 {
     Status.BlockCount = height;
     Status.Time       = DateTime.Now;
     Dispatcher.BeginInvoke(new Action(() => {
         TextBox1.WriteLine($"出块正常,平均出块时间{averageTime}秒 {height}, {DateTime.Now.ToString()}");
     }));
 }
예제 #2
0
        private void ConsensusStoped(int block)
        {
            var msg = $"NEO停止出块,超过{Math.Round((DateTime.Now - Status.Time).TotalMinutes)}分钟未出块";

            Dispatcher.BeginInvoke(new Action(() => {
                TextBox1.WriteLine($"{msg}, { DateTime.Now.ToString()}");
            }));
            Tools.SendMail(msg, "NEO停止出块❗❗❗");
            Tools.Call();
        }
예제 #3
0
        private void ConsensusStoped(int block)
        {
            var msg = $"NEO停止出块,超过{Math.Round((DateTime.Now - Status.Time).TotalMinutes)}分钟未出块<br /><br />" +
                      $"NEO has stopped generating blocks for more than {Math.Round((DateTime.Now - Status.Time).TotalMinutes)} minutes.";

            Dispatcher.BeginInvoke(new Action(() => {
                TextBox1.WriteLine($"{msg}, { DateTime.Now.ToString()}");
            }));
            Tools.SendMail(msg, "🆘NEO停止出块 NEO has stopped generating blocks");
            Tools.Call();
        }
예제 #4
0
        private void ConsensusSlow(double averageTime, int height)
        {
            var msg = $"NEO出块变慢,最近5分钟平均出块时间为{averageTime}秒。<br />PS:异常区间:{Status.BlockCount}~{height}。";

            Dispatcher.BeginInvoke(new Action(() => {
                TextBox1.WriteLine($"{msg}, { DateTime.Now.ToString()}");
            }));
            Tools.SendMail(msg, "NEO出块变慢❗");
            Status.BlockCount = height;
            Status.Time       = DateTime.Now;
        }
예제 #5
0
 /// <summary>
 /// 获取种子节点的区块高度
 /// </summary>
 private void GetNodesBlockCount()
 {
     Status.HeightList.ForEach(p => {
         p.Refresh();
         Dispatcher.BeginInvoke(new Action(() => {
             TextBox1.WriteLine(p.ToString());
         }));
     });
     Dispatcher.BeginInvoke(new Action(() => {
         TextBox1.WriteLine($"{DateTime.Now.ToString()}\t {Status.HeightList.Max(p => p.BlockCount)}");
     }));
 }
예제 #6
0
        private void ConsensusNormal(double averageTime, int height)
        {
            Status.BlockCount = height;
            Status.Time       = DateTime.Now;
            var msg = $"出块正常,平均出块时间{averageTime}秒 {height}, {DateTime.Now}";

            Dispatcher.BeginInvoke(new Action(() =>
            {
                TextBox1.WriteLine(msg);
            }));
            File.AppendAllText(Tools.LogFileName, msg + "\r\n");
        }
예제 #7
0
        private void ConsensusStoped()
        {
            var msg = $"Neo停止出块,超过{Math.Round((DateTime.Now - Status.Time).TotalMinutes)}分钟未出块";

            Dispatcher.BeginInvoke(new Action(() =>
            {
                TextBox1.WriteLine($"{msg}, { DateTime.Now}");
            }));
            File.AppendAllText(Tools.LogFileName, msg + "\r\n");
            Tools.SendMail(msg, "Neo停止出块❗❗❗");
            Tools.WeChat(msg);
        }
예제 #8
0
        private void ConsensusSlow(double averageTime, int height)
        {
            var msg = $"NEO出块变慢,最近5分钟平均出块时间为{averageTime}秒。<br />PS:异常区间:{Status.BlockCount}~{height}。<br /><br />" +
                      $"NEO block generation is slow, the average block generation time for the last 5 minutes is {averageTime} seconds. <br />PS: Exception interval: {Status.BlockCount}~{height}.";

            Dispatcher.BeginInvoke(new Action(() => {
                TextBox1.WriteLine($"{msg}, { DateTime.Now.ToString()}");
            }));
            Tools.SendMail(msg, "⚠NEO出块变慢 NEO block generation is slow");
            Status.BlockCount = height;
            Status.Time       = DateTime.Now;
        }
예제 #9
0
        private void ConsensusSlow(double averageTime, int height)
        {
            var msg = $"Neo出块变慢,最近5分钟平均出块时间为{averageTime}秒。PS:异常区间:{Status.BlockCount}~{height}。";

            Dispatcher.BeginInvoke(new Action(() =>
            {
                TextBox1.WriteLine($"{msg}, {DateTime.Now}");
            }));
            File.AppendAllText(Tools.LogFileName, msg + "\r\n");
            Tools.SendMail(msg, "Neo出块变慢❗");
            Tools.WeChat(msg);
            Status.BlockCount = height;
            Status.Time       = DateTime.Now;
        }
예제 #10
0
        /// <summary>
        /// 获取种子节点的区块高度
        /// </summary>
        private void GetNodesBlockCount()
        {
            var config = JObject.Parse(File.ReadAllText("config.json"));

            Status.BlockCountList.Clear();
            config["nodes"].ToList().ForEach(p => Status.BlockCountList.Add(new NodeBlockCount(p.ToString(), 0)));
            Dispatcher.BeginInvoke(new Action(() =>
            {
                TextBox0.Clear();
            }));
            Status.BlockCountList.ForEach(node =>
            {
                node.GetBlockCount();
                Dispatcher.BeginInvoke(new Action(() =>
                {
                    TextBox0.WriteLine(node.ToString());
                }));
            });
            Dispatcher.BeginInvoke(new Action(() =>
            {
                TextBox1.WriteLine($"{DateTime.Now}\t {Status.BlockCountList.Max(p => p.BlockCount)}");
            }));
        }