CatapultServer  v0.5.0.1 (Elephant)
BlockConsumers.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "BlockChainProcessor.h"
23 #include "BlockChainSyncHandlers.h"
24 #include "HashCheckOptions.h"
25 #include "InputUtils.h"
29 
30 namespace catapult {
31  namespace chain { struct CatapultState; }
32  namespace io { class BlockStorageCache; }
33  namespace model { class TransactionRegistry; }
34  namespace utils { class TimeSpan; }
35 }
36 
37 namespace catapult { namespace consumers {
38 
42  const GenerationHash& generationHash,
43  const model::TransactionRegistry& transactionRegistry);
44 
47  disruptor::ConstBlockConsumer CreateBlockHashCheckConsumer(const chain::TimeSupplier& timeSupplier, const HashCheckOptions& options);
48 
53  uint32_t maxChainSize,
54  const utils::TimeSpan& maxBlockFutureTime,
55  const chain::TimeSupplier& timeSupplier);
56 
59 
64  const std::shared_ptr<const validators::stateless::AggregateEntityValidator>& pValidator,
65  const std::shared_ptr<const validators::ParallelValidationPolicy>& pValidationPolicy,
66  const RequiresValidationPredicate& requiresValidationPredicate);
67 
74  cache::CatapultCache& cache,
75  state::CatapultState& state,
76  io::BlockStorageCache& storage,
77  uint32_t maxRollbackBlocks,
78  const BlockChainSyncHandlers& handlers);
79 
82 
85 
89 }}
InputUtils.h
ParallelValidationPolicy.h
catapult::consumers::CreateBlockChainCheckConsumer
disruptor::ConstBlockConsumer CreateBlockChainCheckConsumer(uint32_t maxChainSize, const utils::TimeSpan &maxBlockFutureTime, const chain::TimeSupplier &timeSupplier)
Definition: BlockChainCheckConsumer.cpp:91
catapult::disruptor::InputSource
InputSource
Possible consumer input sources.
Definition: InputSource.h:42
catapult::consumers::CreateBlockStatelessValidationConsumer
disruptor::ConstBlockConsumer CreateBlockStatelessValidationConsumer(const std::shared_ptr< const validators::stateless::AggregateEntityValidator > &pValidator, const std::shared_ptr< const validators::ParallelValidationPolicy > &pValidationPolicy, const RequiresValidationPredicate &requiresValidationPredicate)
Definition: StatelessValidationConsumer.cpp:65
catapult::disruptor::ConstBlockConsumer
DisruptorConsumerT< const BlockElements > ConstBlockConsumer
A const block disruptor consumer function.
Definition: DisruptorConsumer.h:41
catapult::consumers::CreateBlockChainSyncConsumer
disruptor::DisruptorConsumer CreateBlockChainSyncConsumer(cache::CatapultCache &cache, state::CatapultState &state, io::BlockStorageCache &storage, uint32_t maxRollbackBlocks, const BlockChainSyncHandlers &handlers)
Definition: BlockChainSyncConsumer.cpp:296
HashCheckOptions.h
BlockChainProcessor.h
catapult::disruptor::ConstDisruptorConsumer
DisruptorConsumerT< const ConsumerInput > ConstDisruptorConsumer
A const disruptor consumer function.
Definition: DisruptorConsumer.h:35
catapult::consumers::CreateNewBlockConsumer
disruptor::DisruptorConsumer CreateNewBlockConsumer(const NewBlockSink &newBlockSink, disruptor::InputSource sinkSourceMask)
catapult::consumers::CreateBlockHashCalculatorConsumer
disruptor::BlockConsumer CreateBlockHashCalculatorConsumer(const GenerationHash &generationHash, const model::TransactionRegistry &transactionRegistry)
Definition: HashCalculatorConsumer.cpp:72
DisruptorConsumer.h
catapult::model::MatchingEntityPredicate
predicate< BasicEntityType, Timestamp, const Hash256 & > MatchingEntityPredicate
Predicate for evaluating a timestamp, a hash and an entity type.
Definition: Elements.h:83
catapult::consumers::CreateBlockHashCheckConsumer
disruptor::ConstBlockConsumer CreateBlockHashCheckConsumer(const chain::TimeSupplier &timeSupplier, const HashCheckOptions &options)
Definition: HashCheckConsumer.cpp:56
catapult::io::BlockStorageCache
Definition: BlockStorageCache.h:97
catapult::consumers::BlockChainSyncHandlers
Handlers used by the block chain sync consumer.
Definition: BlockChainSyncHandlers.h:74
catapult::cache::CatapultCache
Central cache holding all sub caches.
Definition: CatapultCache.h:40
catapult::state::CatapultState
Stateful catapult information.
Definition: CatapultState.h:27
catapult::disruptor::BlockConsumer
DisruptorConsumerT< BlockElements > BlockConsumer
A block disruptor consumer function.
Definition: DisruptorConsumer.h:38
ChainFunctions.h
catapult::consumers::CreateBlockChainSyncCleanupConsumer
disruptor::ConstDisruptorConsumer CreateBlockChainSyncCleanupConsumer(const std::string &dataDirectory)
Creates a consumer that cleans up temporary state produced by the block chain sync consumer given dat...
Definition: BlockChainSyncCleanupConsumer.cpp:29
catapult::chain::TimeSupplier
supplier< Timestamp > TimeSupplier
Supplies a timestamp.
Definition: ChainFunctions.h:39
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::GenerationHash
utils::ByteArray< Hash256_Size, GenerationHash_tag > GenerationHash
Definition: src/catapult/types.h:53
catapult::consumers::NewBlockSink
consumer< const std::shared_ptr< const model::Block > & > NewBlockSink
Prototype for a function that is called with a new block.
Definition: BlockConsumers.h:84
BlockChainSyncHandlers.h
catapult::disruptor::DisruptorConsumer
DisruptorConsumerT< ConsumerInput > DisruptorConsumer
A disruptor consumer function.
Definition: DisruptorConsumer.h:32
catapult::consumers::RequiresValidationPredicate
model::MatchingEntityPredicate RequiresValidationPredicate
Predicate for checking whether or not an entity requires validation.
Definition: BlockConsumers.h:58
catapult::consumer
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35