|
Monero
|
Sends ZMQ PUB messages on cryptonote events. More...
#include <zmq_pub.h>
Classes | |
| struct | chain_main |
| Callable for send_chain_main with weak ownership to zmq_pub object. More... | |
| struct | miner_data |
| Callable for send_miner_data with weak ownership to zmq_pub object. More... | |
| struct | txpool_add |
| Callable for send_txpool_add with weak ownership to zmq_pub object. More... | |
Public Member Functions | |
| zmq_pub (void *context) | |
| zmq_pub (const zmq_pub &)=delete | |
| zmq_pub (zmq_pub &&)=delete | |
| ~zmq_pub () | |
| zmq_pub & | operator= (const zmq_pub &)=delete |
| zmq_pub & | operator= (zmq_pub &&)=delete |
| bool | sub_request (const boost::string_ref message) |
| Process a client subscription request (from XPUB sockets). Thread-safe. | |
| bool | relay_to_pub (void *relay, void *pub) |
| std::size_t | send_chain_main (std::uint64_t height, epee::span< const cryptonote::block > blocks) |
| std::size_t | send_miner_data (uint8_t major_version, uint64_t height, const crypto::hash &prev_id, const crypto::hash &seed_hash, difficulty_type diff, uint64_t median_weight, uint64_t already_generated_coins, const std::vector< tx_block_template_backlog_entry > &tx_backlog) |
| std::size_t | send_txpool_add (std::vector< cryptonote::txpool_event > txes) |
Static Public Member Functions | |
| static constexpr const char * | relay_endpoint () noexcept |
Private Attributes | |
| net::zmq::socket | relay_ |
| std::deque< std::vector< txpool_event > > | txes_ |
| std::array< std::size_t, 2 > | chain_subs_ |
| std::array< std::size_t, 1 > | miner_subs_ |
| std::array< std::size_t, 2 > | txpool_subs_ |
| boost::mutex | sync_ |
| Synchronizes counts in *_subs_ arrays. | |
Sends ZMQ PUB messages on cryptonote events.
Clients must ensure that all transaction(s) are notified before any blocks they are contained in, and must ensure that each block is notified in chain order. An external lock must be held by clients during the entire txpool check and notification sequence and (a possibly second) lock is held during the entire block check and notification sequence. Otherwise, events could be sent in a different order than processed.
|
explicit |
|
delete |
|
delete |
| cryptonote::listener::zmq_pub::~zmq_pub | ( | ) |
|
inlinestaticconstexprnoexcept |
| bool cryptonote::listener::zmq_pub::relay_to_pub | ( | void * | relay, |
| void * | pub ) |
Forward ZMQ messages sent to relay via send_chain_main or send_txpool_add to pub. Used by ZmqServer.
| std::size_t cryptonote::listener::zmq_pub::send_chain_main | ( | std::uint64_t | height, |
| epee::span< const cryptonote::block > | blocks ) |
Send a ZMQ_PUB notification for a change to the main chain. Thread-safe.
| std::size_t cryptonote::listener::zmq_pub::send_miner_data | ( | uint8_t | major_version, |
| uint64_t | height, | ||
| const crypto::hash & | prev_id, | ||
| const crypto::hash & | seed_hash, | ||
| difficulty_type | diff, | ||
| uint64_t | median_weight, | ||
| uint64_t | already_generated_coins, | ||
| const std::vector< tx_block_template_backlog_entry > & | tx_backlog ) |
Send a ZMQ_PUB notification for a new miner data. Thread-safe.
| std::size_t cryptonote::listener::zmq_pub::send_txpool_add | ( | std::vector< cryptonote::txpool_event > | txes | ) |
Send a ZMQ_PUB notification for new tx(es) being added to the local pool. Thread-safe.
| bool cryptonote::listener::zmq_pub::sub_request | ( | const boost::string_ref | message | ) |
Process a client subscription request (from XPUB sockets). Thread-safe.
|
private |
|
private |
|
private |
|
private |
Synchronizes counts in *_subs_ arrays.
|
private |
|
private |