public HomeController(BlockQuery blockQuery, TransactionQuery txQuery, RedisCommand redisCommand, StatQuery statQuery) { _blockQuery = blockQuery; _txQuery = txQuery; _redisCommand = redisCommand; _statQuery = statQuery; }
public AddressStatsJob(ILogger <AddressStatsJob> logger, RedisCommand redisCommand, AddressQuery addressQuery, BlockQuery blockQuery, NexusQuery nexusQuery) : base(30, logger) { _redisCommand = redisCommand; _addressQuery = addressQuery; _blockQuery = blockQuery; _nexusQuery = nexusQuery; }
public BlockScanJob(ILogger <BlockScanJob> logger, NexusQuery nexusQuery, BlockQuery blockQuery, BlockInsertCommand blockInsert, AddressAggregatorCommand addressAggregator, BlockDeleteCommand blockDelete) : base(3, logger) { _nexusQuery = nexusQuery; _blockQuery = blockQuery; _blockInsert = blockInsert; _addressAggregator = addressAggregator; _blockDelete = blockDelete; }
public TrustAddressCacheJob(ILogger <TrustAddressCacheJob> logger, NexusQuery nexusQuery, BlockQuery blockQuery, NexusDb nexusDb, AddressQuery addressQuery, RedisCommand redisCommand) : base(180, logger) { _nexusQuery = nexusQuery; _blockQuery = blockQuery; _nexusDb = nexusDb; _addressQuery = addressQuery; _redisCommand = redisCommand; }
public BlockSyncJob(ILogger <BlockSyncJob> logger, NexusQuery nexusQuery, BlockQuery blockQuery, BlockPublishCommand blockPublish, BlockInsertCommand blockInsert, AddressAggregatorCommand addressAggregator, BlockCacheCommand cacheCommand) : base(3, logger) { _nexusQuery = nexusQuery; _blockQuery = blockQuery; _blockPublish = blockPublish; _blockInsert = blockInsert; _addressAggregator = addressAggregator; _cacheCommand = cacheCommand; }
public AddressesController(UserManager <ApplicationUser> userManager, AddressQuery addressQuery, CurrencyQuery currencyQuery, ExchangeQuery exchangeQuery, BlockQuery blockQuery, UserQuery userQuery, TransactionQuery transactionQuery) { _userManager = userManager; _addressQuery = addressQuery; _currencyQuery = currencyQuery; _exchangeQuery = exchangeQuery; _blockQuery = blockQuery; _userQuery = userQuery; _transactionQuery = transactionQuery; }
public IActionResult Get(int index) { BlockApiModel block = BlockQuery.Get(index); if (block != null) { return(AsJson(block)); } return(NotFound($"Block with index {index} is not found")); }
public BlockSyncCatchup(NexusQuery nexusQuery, IServiceProvider serviceProvider, BlockQuery blockQuery, ILogger <BlockSyncCatchup> logger, RedisCommand redisCommand, BlockInsertCommand blockInsert, BlockCacheCommand cacheCommand) { _nexusQuery = nexusQuery; _serviceProvider = serviceProvider; _blockQuery = blockQuery; _logger = logger; _redisCommand = redisCommand; _blockInsert = blockInsert; _cacheCommand = cacheCommand; _cancelBlockStream = new CancellationTokenSource(); }
public ObjectResult Get(string id) { logger.LogDebug("Consuntado último bloque"); var query = new BlockQuery(node.Blockchain); var block = query.Execute(Base58.Decode(id)); if (block == null) { return(NotFound("No tengo ningún bloque con ese hash")); } return(Ok(block)); }
/// <summary> /// get event information /// </summary> /// <param name="blockHash">block hash</param> /// <returns>the event information</returns> public EventInfoResponse GetEventData(string blockHash) { var query = new BlockQuery() { Hash = blockHash }; var response = client.getEventByHash(query); if (response.Error != null) { throw new RClientException(response.Error.Messages.ToString()); } return(response); }
/// <summary> /// get the block information using block hash /// </summary> /// <param name="blockHash">block hash</param> /// <returns>block information</returns> public BlockInfo ShowBlock(string blockHash) { var blockQuery = new BlockQuery() { Hash = blockHash }; var response = client.getBlock(blockQuery); //CheckResponse(response); if (response.Error != null) { throw new RClientException(response.Error.Messages.ToString()); } return(response.BlockInfo); }
public IActionResult GetBlocks(int fromIndex, int count) { if (count < 0) { return(BadRequest("'count' must be positive.")); } if (fromIndex < 0) { fromIndex = 0; } List <BlockApiModel> result = BlockQuery.GetBlocks(fromIndex, count); return(Ok(result)); }
private void AssertBlockNotEmpty(BlockQuery block) { Assert.True(block.Block.Header.Height > 0); Assert.NotNull(block.Block.Header.Version); Assert.NotNull(block.Block.Header.AppHash); Assert.NotNull(block.Block.Header.ChainId); Assert.NotNull(block.Block.Header.ConsensusHash); Assert.NotNull(block.Block.Header.DataHash); Assert.NotNull(block.Block.Header.EvidenceHash); Assert.NotNull(block.Block.Header.ProposerAddress); Assert.NotNull(block.Block.Header.ValidatorsHash); Assert.NotNull(block.Block.Header.LastBlockId.Hash); Assert.NotNull(block.Block.Header.LastBlockId.Parts.Hash); Assert.NotNull(block.Block.Header.LastCommitHash); Assert.NotNull(block.Block.Header.LastResultsHash); Assert.NotNull(block.Block.Header.NextValidatorsHash); }
public BlockSyncFixture() { var sc = new ServiceCollection(); Settings.BuildConfig(sc); Settings.AttachConfig(sc.BuildServiceProvider(), true); var testDb = new NexusTestDesignTimeDbContextFactory().CreateDbContext(null); Client = new NxsClient(Settings.Connection.Nexus); InsertCommand = new BlockInsertCommand(); DeleteCommand = new BlockDeleteCommand(); AddressAggregator = new AddressAggregatorCommand(); Mapper = new AutoMapperConfig().GetMapper(); NexusQuery = new NexusQuery(Client, Mapper); BlockQuery = new BlockQuery(testDb, Mapper); AddressQuery = new AddressQuery(testDb, null); }
public void ReadBlock(BlockQuery block, int x, int y, int z) { int chunkX = x, chunkY = y, chunkZ = z; VoxelChunk.ConvertWorldToChunk(ref chunkX, ref chunkY, ref chunkZ); var chunk = GetChunk(chunkX, chunkY, chunkZ); Voxel voxel; if (chunk != null) { VoxelChunk.ConvertWorldToLocal(ref x, ref y, ref z); voxel = chunk.GetVoxel(x, y, z); } else { voxel = new Voxel(); } //TODO: Properly query for core voxel if current voxel.IsPointer block.Set(voxel, chunk, x, y, z); }
public BlockRewardCatchup(ILogger <BlockRewardCatchup> logger, NexusDb nexusDb, BlockQuery blockQuery) { _logger = logger; _nexusDb = nexusDb; _blockQuery = blockQuery; }
public TransactionsController(BlockQuery blockQuery, TransactionQuery transactionQuery) { _blockQuery = blockQuery; _transactionQuery = transactionQuery; }
public List <BlockSyncApiModel> GetBlocksForSync(int fromIndex, int count) { List <BlockSyncApiModel> blocks = BlockQuery.GetBlocksForSync(fromIndex, count); return(blocks); }
public IActionResult GettAllBlocks() { List <BlockApiModel> lastBlock = BlockQuery.GetAllBlocks(); return(Ok(lastBlock)); }
public BlocksController(BlockQuery blockQuery, BlockCacheCommand cacheCommand) { _blockQuery = blockQuery; _cacheCommand = cacheCommand; }
public IActionResult Get() { List <BlockSyncApiModel> blocks = BlockQuery.All(); return(AsJson(blocks)); }
public LayoutHub(RedisCommand redisCommand, BlockQuery blockQuery, ExchangeQuery exchangeQuery) { _redisCommand = redisCommand; _blockQuery = blockQuery; _exchangeQuery = exchangeQuery; }
public BlockCacheCommand(RedisCommand redisCommand, BlockQuery blockQuery) { _redisCommand = redisCommand; _blockQuery = blockQuery; }
public IActionResult GetLastBlock(int count) { List <BlockApiModel> lastBlock = BlockQuery.GetLastBlocks(count); return(Ok(lastBlock)); }
public AddressAggregateCatchup(ILogger <AddressAggregateCatchup> logger, BlockQuery blockQuery, AddressAggregatorCommand addressAggregator) { _logger = logger; _blockQuery = blockQuery; _addressAggregator = addressAggregator; }