示例#1
0
        public async Task HashrateAsync([Remainder] string Remainder = "")
        {
            decimal Hashrate = TrtlBotSharp.GetHashrate();

            // Send reply
            await ReplyAsync("The current global hashrate is **" + TrtlBotSharp.FormatHashrate(Hashrate) + "**");
        }
        public async Task HashrateAsync([Remainder] string Remainder = "")
        {
            // Get last block header from daemon and calculate hashrate
            decimal Hashrate = 0;
            JObject Result   = Request.RPC(TrtlBotSharp.daemonHost, TrtlBotSharp.daemonPort, "getlastblockheader");

            if (Result.Count > 0 && !Result.ContainsKey("error"))
            {
                Hashrate = (decimal)Result["block_header"]["difficulty"] / 144;
            }

            // Send reply
            await ReplyAsync("The current global hashrate is **" + TrtlBotSharp.FormatHashrate(Hashrate) + "**");
        }
示例#3
0
        public async Task DynamitAsync([Remainder] string Remainder = "")
        {
            // Get supply
            decimal Supply     = TrtlBotSharp.GetSupply();
            decimal Height     = TrtlBotSharp.GetHeight();
            decimal Hashrate   = TrtlBotSharp.GetHashrate();
            decimal Difficulty = TrtlBotSharp.GetDifficulty();

            string Message = string.Format("The current block height is **{0:N0}**" +
                                           "\nThe current global hashrate is **" + TrtlBotSharp.FormatHashrate(Hashrate) + "**" +
                                           "\nThe current difficulty is **{1:N0}**" +
                                           "\nThe current circulating supply is **{2:N4}** {3}", Height, Difficulty, Supply, TrtlBotSharp.coinSymbol);

            await ReplyAsync(string.Format(Message));
        }