Пример #1
0
        public async Task <IActionResult> Index(string id)
        {
            var block = await _blockModelService.GetBlock(id);

            var transactions = await _blockTransactionModelService.GetBlockTransactions(id);

            return(View(new BlockViewModel
            {
                Block = block,
                Transactions = transactions
            }));
        }
        public async Task <dynamic> Index(string hash)
        {
            var json = await _blockModelService.GetBlock(hash);

            if (json == null)
            {
                return(NotFound());
            }

            var block = JsonConvert.DeserializeObject <dynamic>(json);

            return(block?.result);
        }
        public async Task <string> Index(long height, [FromHeader(Name = "Token")] string token)
        {
            if (string.IsNullOrWhiteSpace(token) ||
                _configuration.GetValue <string>("FrontendNotificationToken") != token)
            {
                return("");
            }

            lock (Lock)
            {
                foreach (var key in CacheItemKeys.Keys)
                {
                    _memoryCache.Remove(key);
                }

                CacheItemKeys.Keys.Clear();
            }

            await _hubContext.Clients.All.SendAsync("wsbn", await _blockModelService.GetBlock(height));

            return("OK");
        }
 public async Task <IActionResult> Block(long height)
 {
     return(PartialView(await _blockModelService.GetBlock(height)));
 }