CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
32 namespace model {
struct BlockChainConfiguration; }
35 namespace catapult {
namespace chain {
60 const std::shared_ptr<const api::ChainApi>& pLocalChainApi,
std::function< thread::future< ionet::NodeInteractionResultCode >(const TRemoteApi &)> RemoteNodeSynchronizer
Function signature for synchronizing with a remote node.
Definition: RemoteNodeSynchronizer.h:30
std::shared_ptr< UnprocessedElements > m_pUnprocessedElements
Definition: ChainSynchronizer.cpp:305
uint32_t MaxRollbackBlocks
Maximum number of blocks that can be rolled back.
Definition: ChainSynchronizer.h:54
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
std::shared_ptr< const api::ChainApi > m_pLocalChainApi
Definition: ChainSynchronizer.cpp:302
CompareChainsOptions m_compareChainOptions
Definition: ChainSynchronizer.cpp:303
AnnotatedEntityRange< Block > AnnotatedBlockRange
An annotated entity range composed of blocks.
Definition: AnnotatedEntityRange.h:54
def debug(*args)
Definition: Parser.py:46
Key m_sourcePublicKey
Definition: ChainSynchronizer.cpp:166
std::vector< model::BlockRange > m_ranges
Definition: ChainSynchronizer.cpp:167
utils::SpinLock m_spinLock
Definition: ChainSynchronizer.cpp:123
def warning(*args)
Definition: colorPrint.py:10
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
auto compose(future< TSeed > &&startFuture, TCreateNextFuture createNextFuture)
Definition: FutureUtils.h:102
uint32_t MaxBlocksPerSyncAttempt
Maximum number of blocks per sync attempt.
Definition: ChainSynchronizer.h:48
Combination of an entity range and optional context.
Definition: AnnotatedEntityRange.h:30
thread::future< CompareChainsResult > CompareChains(const api::ChainApi &local, const api::ChainApi &remote, const CompareChainsOptions &options)
Compares two chains (local and remote) with the specified options.
Definition: CompareChains.cpp:177
bool IsRemoteEvil(ChainComparisonCode code)
Gets a value indicating whether or not code indicates that the remote node is evil.
Definition: ChainComparisonCode.cpp:38
size_t m_numBytes
Definition: ChainSynchronizer.cpp:127
std::function< disruptor::DisruptorElementId(model::AnnotatedBlockRange &&, const disruptor::ProcessingCompleteFunc &)> CompletionAwareBlockRangeConsumerFunc
Function signature for delivering a block range to a consumer with an additional completion handler.
Definition: ChainSynchronizer.h:43
size_t m_numBlocks
Definition: ChainSynchronizer.cpp:165
CompletionStatus
Completion status.
Definition: DisruptorTypes.h:38
size_t NumBytes
Definition: ChainSynchronizer.cpp:37
uint64_t DisruptorElementId
Id of a disruptor element.
Definition: DisruptorTypes.h:32
consumer< model::BlockRange && > BlockRangeConsumerFunc
Function signature for delivering a block range to a consumer.
Definition: ChainSynchronizer.h:38
static EntityRange MergeRanges(std::vector< EntityRange > &&ranges)
Merges all ranges into a single range.
Definition: EntityRange.h:297
CompletionAwareBlockRangeConsumerFunc m_blockRangeConsumer
Definition: ChainSynchronizer.cpp:124
bool m_hasPendingSync
Definition: ChainSynchronizer.cpp:128
size_t m_maxSize
Definition: ChainSynchronizer.cpp:126
Configuration for customizing a chain synchronizer.
Definition: ChainSynchronizer.h:46
def info(*args)
Definition: forwardsValidation.py:12
uint32_t MaxChainBytesPerSyncAttempt
Maximum chain bytes per sync attempt.
Definition: ChainSynchronizer.h:51
catapult_error< std::runtime_error > catapult_runtime_error
Definition: exceptions.h:87
#define CATAPULT_THROW_INVALID_ARGUMENT_1(MESSAGE, PARAM1)
Macro used to throw a catapult invalid argument with a single parameter.
Definition: exceptions.h:183
consumer< DisruptorElementId, const ConsumerCompletionResult & > ProcessingCompleteFunc
Function signature for signaling that processing finished.
Definition: DisruptorTypes.h:117
std::queue< ElementInfo > m_elements
Definition: ChainSynchronizer.cpp:125
api::BlocksFromOptions m_blocksFromOptions
Definition: ChainSynchronizer.cpp:304
ChainComparisonCode
Possible chain comparison end states.
Definition: ChainComparisonCode.h:60
future< T > make_ready_future(T &&value)
Produces a future that is ready immediately and holds the given value.
Definition: Future.h:126
bool m_dirty
Definition: ChainSynchronizer.cpp:129
disruptor::DisruptorElementId Id
Definition: ChainSynchronizer.cpp:35
EntityRange< Block > BlockRange
An entity range composed of blocks.
Definition: RangeTypes.h:29
Processing of the entity is ongoing.
Definition: AddressExtractionExtension.cpp:28
RemoteNodeSynchronizer< api::RemoteChainApi > CreateChainSynchronizer(const std::shared_ptr< const api::ChainApi > &pLocalChainApi, const ChainSynchronizerConfiguration &config, const CompletionAwareBlockRangeConsumerFunc &blockRangeConsumer)
Definition: ChainSynchronizer.cpp:309
bool IsRemoteOutOfSync(ChainComparisonCode code)
Gets a value indicating whether or not code indicates that the remote node is out of sync.
Definition: ChainComparisonCode.cpp:34
RemoteNodeSynchronizer< typename TSynchronizer::RemoteApiType > CreateRemoteNodeSynchronizer(const std::shared_ptr< TSynchronizer > &pSynchronizer)
Creates a remote node synchronizer around pSynchronizer.
Definition: RemoteNodeSynchronizer.h:34
NodeInteractionResultCode
Possible node interaction result codes.
Definition: NodeInteractionResultCode.h:42
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
utils::ByteArray< Key_Size, Key_tag > Key
Definition: src/catapult/types.h:41
std::lock_guard< SpinLock > SpinLockGuard
A spin lock guard.
Definition: SpinLock.h:60
Height EndHeight
Definition: ChainSynchronizer.cpp:36