public ActionResult HomeNumberofBlock() { var client = bs.GetAllBlocks(); int number = client.Count(); ViewBag.no = number; return(View()); }
public IActionResult GetAllBlocks() { _logger.LogDebug("[GET] block"); try { var allBlocks = _blockService.GetAllBlocks(); return(Ok(allBlocks)); } catch (ReadingBlockException ex) { _logger.LogWarning("Exception was thrown while getting all blocks.", ex); return(NoContent()); } }
private PeerToPeerCommand QueryAllBlocks() { try { var allBlocks = _blockService.GetAllBlocks(); var allBlockContents = _blockService.GetAllBlockContents(); Message message = new PeerToPeerMessage(MessageType.RESPONSE_BLOCKCHAIN, allBlocks, PrepareGraphData(allBlockContents)); return(new PeerToPeerCommand(CommandType.WRITE, message)); } catch (ReadingBlockException ex) { _logger.LogDebug("Exception was thrown: ", ex); Message errorMessage = new ErrorMessage(ex.Message); return(new PeerToPeerCommand(CommandType.WRITE_ERROR, errorMessage)); } }