CatapultServer
v0.5.0.1 (Elephant)
|
Go to the documentation of this file.
24 #include <zmq_addon.hpp>
30 struct TransactionElement;
31 struct TransactionInfo;
32 class TransactionRegistry;
33 struct TransactionStatus;
37 namespace catapult {
namespace zeromq {
76 explicit ZeroMqEntityPublisher(
unsigned short port, std::unique_ptr<model::NotificationPublisher>&& pNotificationPublisher);
108 const std::string& topicName,
Definition: ZeroMqEntityPublisher.cpp:35
ZeroMqEntityPublisher(unsigned short port, std::unique_ptr< model::NotificationPublisher > &&pNotificationPublisher)
Creates a zeromq entity publisher around port and pNotificationPublisher.
Definition: ZeroMqEntityPublisher.cpp:123
std::unique_ptr< thread::IoThreadPool > m_pPool
Definition: ZeroMqEntityPublisher.cpp:90
#define CATAPULT_LOG(SEV)
Writes a log entry to the default logger with SEV severity.
Definition: Logging.h:340
const Hash256 & EntityHash
Definition: ZeroMqEntityPublisher.cpp:118
consumer< zmq::multipart_t & > MessagePayloadBuilder
Definition: ZeroMqEntityPublisher.h:104
const model::UnresolvedAddressSet * OptionalAddresses
Definition: ZeroMqEntityPublisher.cpp:120
std::unique_ptr< model::NotificationPublisher > m_pNotificationPublisher
Definition: ZeroMqEntityPublisher.h:114
const model::Transaction & Transaction
Definition: ZeroMqEntityPublisher.cpp:117
zmq::socket_t m_zmqSocket
Definition: ZeroMqEntityPublisher.cpp:89
SynchronizedPublisher(unsigned short port)
Definition: ZeroMqEntityPublisher.cpp:61
A removed partial transaction.
TransactionMarker
Markers for publishing transaction related messages.
Definition: ZeroMqEntityPublisher.h:49
Hash256 EntityHash
Entity hash.
Definition: Elements.h:66
std::vector< zmq::multipart_t > m_messages
Definition: ZeroMqEntityPublisher.cpp:56
def warning(*args)
Definition: colorPrint.py:10
void publishCosignature(const model::TransactionInfo &parentTransactionInfo, const Key &signer, const Signature &signature)
Publishes a cosignature composed of transaction info (parentTransactionInfo), signer and signature.
Definition: ZeroMqEntityPublisher.cpp:218
A zeromq entity publisher.
Definition: ZeroMqEntityPublisher.h:73
const model::Block & Block
Block entity.
Definition: Elements.h:63
void publishTransactionHash(TransactionMarker topicMarker, const model::TransactionInfo &transactionInfo)
Publishes a transaction hash using topicMarker and transactionInfo.
Definition: ZeroMqEntityPublisher.cpp:190
void publish(const std::string &topicName, TransactionMarker topicMarker, const WeakTransactionInfo &transactionInfo, const MessagePayloadBuilder &payloadBuilder)
Definition: ZeroMqEntityPublisher.cpp:229
UnresolvedAddressSet ExtractAddresses(const Transaction &transaction, const NotificationPublisher ¬ificationPublisher)
Extracts all addresses that are involved in transaction using notificationPublisher.
Definition: TransactionUtils.cpp:64
Definition: ZeroMqEntityPublisher.cpp:93
A transaction status.
Definition: TransactionStatus.h:29
An added unconfirmed transaction.
WeakTransactionInfo(const model::TransactionElement &element)
Definition: ZeroMqEntityPublisher.cpp:102
catapult::GenerationHash GenerationHash
Generation hash of the block.
Definition: Elements.h:69
WeakTransactionInfo(const model::TransactionInfo &transactionInfo)
Definition: ZeroMqEntityPublisher.cpp:95
void flush(zmq::socket_t &zmqSocket)
Definition: ZeroMqEntityPublisher.cpp:45
A transaction and its associated metadata.
Definition: EntityInfo.h:104
std::function< T()> supplier
A (stateless) supplier function.
Definition: functions.h:39
MessageGroup(const supplier< std::string > &errorMessageGenerator)
Definition: ZeroMqEntityPublisher.cpp:37
void queue(std::unique_ptr< MessageGroup > &&pMessageGroup)
Definition: ZeroMqEntityPublisher.cpp:79
std::unique_ptr< IoThreadPool > CreateIoThreadPool(size_t numWorkerThreads, const char *name)
Definition: IoThreadPool.cpp:146
BlockMarker
Markers for publishing block related messages.
Definition: ZeroMqEntityPublisher.h:40
std::unique_ptr< SynchronizedPublisher > m_pSynchronizedPublisher
Definition: ZeroMqEntityPublisher.h:116
void publishBlockHeader(const model::BlockElement &blockElement)
Publishes the block header in blockElement.
Definition: ZeroMqEntityPublisher.cpp:142
~SynchronizedPublisher()
Definition: ZeroMqEntityPublisher.cpp:72
std::unordered_set< UnresolvedAddress, utils::ArrayHasher< UnresolvedAddress > > UnresolvedAddressSet
Unordered set of unresolved addresses.
Definition: ContainerTypes.h:44
An added partial transaction.
void add(zmq::multipart_t &&message)
Definition: ZeroMqEntityPublisher.cpp:41
void publishTransactionStatus(const model::Transaction &transaction, const Hash256 &hash, uint32_t status)
Publishes a transaction status composed of transaction, hash and status.
Definition: ZeroMqEntityPublisher.cpp:210
Processing element for a transaction composed of a transaction and metadata.
Definition: Elements.h:33
Processing element for a block composed of a block and metadata.
Definition: Elements.h:55
Timestamp Deadline
Transaction deadline.
Definition: Transaction.h:38
Definition: AddressExtractionExtension.cpp:28
constexpr size_t Hash256_Size
Definition: src/catapult/types.h:34
Definition: ZeroMqEntityPublisher.cpp:59
WeakTransactionInfo(const model::Transaction &transaction, const Hash256 &hash)
Definition: ZeroMqEntityPublisher.cpp:109
const Hash256 & MerkleComponentHash
Definition: ZeroMqEntityPublisher.cpp:119
Hash256 EntityHash
Entity hash.
Definition: EntityInfo.h:48
A detached cosignature.
Definition: Cosignature.h:38
std::vector< uint8_t > CreateTopic(TransactionMarker marker, const UnresolvedAddress &address)
Creates a topic around marker and address.
Definition: PublisherUtils.cpp:25
void publishTransaction(TransactionMarker topicMarker, const model::TransactionElement &transactionElement, Height height)
Publishes a transaction using topicMarker, transactionElement and height.
Definition: ZeroMqEntityPublisher.cpp:176
std::function< void(TArgs...)> consumer
A consumer function.
Definition: functions.h:35
A removed unconfirmed transaction.
zmq::context_t m_zmqContext
Definition: ZeroMqEntityPublisher.cpp:88
supplier< std::string > m_errorMessageGenerator
Definition: ZeroMqEntityPublisher.cpp:55
void publishDropBlocks(Height height)
Publishes the height after which all blocks were dropped.
Definition: ZeroMqEntityPublisher.cpp:155
Binary layout for a transaction.
Definition: Transaction.h:32