CatapultServer  v0.5.0.1 (Elephant)
catapult::handlers Namespace Reference

Classes

class  BasicProducer
 A base class for producers. More...
 
class  BatchHandlerFactory
 Factory for creating a handler that returns batch of entities. More...
 
class  CacheEntryInfosProducerFactory
 Cache entry infos producer factory. More...
 
struct  HeightRequestInfo
 Information about a height request. More...
 
class  HeightRequestProcessor
 Helper for processing height requests. More...
 
struct  PullBlocksHandlerConfiguration
 Configuration for pull blocks handler. More...
 

Typedefs

using NodeConsumer = consumer< const ionet::Node & >
 Consumes a node. More...
 
using NodesConsumer = consumer< const ionet::NodeSet & >
 Consumes multiple nodes. More...
 
using NodesSupplier = supplier< ionet::NodeSet >
 Supplies nodes. More...
 
using CosignatureRangeHandler = RangeHandler< model::DetachedCosignature >
 Prototype for a function that processes a range of detached cosignatures. More...
 
using ConfirmedTimestampedHashesProducerFactory = RawPointerProducerFactory< state::TimestampedHash, state::TimestampedHash >
 Alias for creating a confirmed timestamped hashes producer given a range of hashes. More...
 
template<typename KeyType >
using CacheEntryInfoProducer = supplier< std::shared_ptr< const model::CacheEntryInfo< KeyType > >>
 Cache entry info producer. More...
 
template<typename TEntity >
using RangeHandler = consumer< model::AnnotatedEntityRange< TEntity > && >
 A handler for processing an annotated entity range. More...
 
using BlockRangeHandler = RangeHandler< model::Block >
 Prototype for a function that processes a range of blocks. More...
 
using TransactionRangeHandler = RangeHandler< model::Transaction >
 Prototype for a function that processes a range of transactions. More...
 
template<typename TIdentifier , typename TEntity >
using SharedPointerProducerFactory = std::function< supplier< std::shared_ptr< const TEntity > >(const model::EntityRange< TIdentifier > &)>
 Accepts a range and returns a producer that produces specified shared pointer elements. More...
 
template<typename TIdentifier , typename TEntity >
using RawPointerProducerFactory = std::function< supplier< const TEntity * >(const model::EntityRange< TIdentifier > &)>
 Accepts a range and returns a producer that produces specified raw pointer elements. More...
 
using UnconfirmedTransactions = std::vector< std::shared_ptr< const model::Transaction > >
 Transactions returned by the unconfirmed transactions retriever. More...
 
using UtRetriever = std::function< UnconfirmedTransactions(BlockFeeMultiplier, const utils::ShortHashesSet &)>
 Prototype for a function that retrieves unconfirmed transactions given a set of short hashes. More...
 

Functions

void RegisterNodeDiscoveryPushPingHandler (ionet::ServerPacketHandlers &handlers, model::NetworkIdentifier networkIdentifier, const NodeConsumer &nodeConsumer)
 
void RegisterNodeDiscoveryPullPingHandler (ionet::ServerPacketHandlers &handlers, const std::shared_ptr< const ionet::NetworkNode > &pLocalNode)
 
void RegisterNodeDiscoveryPushPeersHandler (ionet::ServerPacketHandlers &handlers, const NodesConsumer &nodesConsumer)
 Registers a node discovery push peers handler in handlers that forwards received nodes to nodesConsumer. More...
 
void RegisterNodeDiscoveryPullPeersHandler (ionet::ServerPacketHandlers &handlers, const NodesSupplier &nodesSupplier)
 Registers a node discovery pull peers handler in handlers that responds with nodes from nodesSupplier. More...
 
void RegisterPushCosignaturesHandler (ionet::ServerPacketHandlers &handlers, const CosignatureRangeHandler &cosignatureRangeHandler)
 Registers a push cosignatures handler in handlers that forwards cosignatures to cosignatureRangeHandler. More...
 
void RegisterPushPartialTransactionsHandler (ionet::ServerPacketHandlers &handlers, const model::TransactionRegistry &registry, const TransactionRangeHandler &transactionRangeHandler)
 
void RegisterPullPartialTransactionInfosHandler (ionet::ServerPacketHandlers &handlers, const CosignedTransactionInfosRetriever &transactionInfosRetriever)
 
void RegisterTimeSyncNetworkTimeHandler (ionet::ServerPacketHandlers &handlers, const extensions::ExtensionManager::NetworkTimeSupplier &networkTimeSupplier)
 Registers a time sync network time handler in handlers that responds with communication timestamps using networkTimeSupplier. More...
 
ConfirmedTimestampedHashesProducerFactory CreateConfirmedTimestampedHashesProducerFactory (const cache::HashCache &hashCache)
 Creates a confirmed timestamped hashes producer factory around hashCache. More...
 
void RegisterConfirmTimestampedHashesHandler (ionet::ServerPacketHandlers &handlers, const ConfirmedTimestampedHashesProducerFactory &confirmedTimestampedHashesProducerFactory)
 
void RegisterPushBlockHandler (ionet::ServerPacketHandlers &handlers, const model::TransactionRegistry &registry, const BlockRangeHandler &blockRangeHandler)
 
void RegisterPullBlockHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage)
 Registers a pull block handler in handlers that responds with a block in storage. More...
 
void RegisterChainInfoHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage, const model::ChainScoreSupplier &chainScoreSupplier)
 
void RegisterBlockHashesHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage, uint32_t maxHashes)
 Registers a block hashes handler in handlers that responds with at most maxHashes hashes in storage. More...
 
void RegisterPullBlocksHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage, const PullBlocksHandlerConfiguration &config)
 
void RegisterDiagnosticCountersHandler (ionet::ServerPacketHandlers &handlers, const std::vector< utils::DiagnosticCounter > &counters)
 Registers a diagnostic counters handler in handlers that responds with the current values of counters. More...
 
void RegisterDiagnosticNodesHandler (ionet::ServerPacketHandlers &handlers, const ionet::NodeContainer &nodeContainer)
 Registers a diagnostic nodes handler in handlers that responds with info about all (active) partner nodes in nodeContainer. More...
 
void RegisterDiagnosticBlockStatementHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage)
 Registers a diagnostic block statement handler in handlers that responds with data from storage. More...
 
template<typename TEntity >
auto CreatePushEntityHandler (const model::TransactionRegistry &registry, const RangeHandler< TEntity > &rangeHandler)
 
void RegisterSubCacheMerkleRootsHandler (ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage)
 
template<typename TPacket , typename TCache >
void RegisterStatePathHandler (ionet::ServerPacketHandlers &handlers, const TCache &cache)
 Registers a handler in handlers that responds with serialized state path produced by querying cache. More...
 
void RegisterPushTransactionsHandler (ionet::ServerPacketHandlers &handlers, const model::TransactionRegistry &registry, const TransactionRangeHandler &transactionRangeHandler)
 
void RegisterPullTransactionsHandler (ionet::ServerPacketHandlers &handlers, const UtRetriever &utRetriever)
 

Typedef Documentation

◆ BlockRangeHandler

Prototype for a function that processes a range of blocks.

◆ CacheEntryInfoProducer

template<typename KeyType >
using catapult::handlers::CacheEntryInfoProducer = typedef supplier<std::shared_ptr<const model::CacheEntryInfo<KeyType> >>

Cache entry info producer.

◆ ConfirmedTimestampedHashesProducerFactory

Alias for creating a confirmed timestamped hashes producer given a range of hashes.

◆ CosignatureRangeHandler

Prototype for a function that processes a range of detached cosignatures.

◆ NodeConsumer

Consumes a node.

◆ NodesConsumer

Consumes multiple nodes.

◆ NodesSupplier

Supplies nodes.

◆ RangeHandler

template<typename TEntity >
using catapult::handlers::RangeHandler = typedef consumer<model::AnnotatedEntityRange<TEntity>&&>

A handler for processing an annotated entity range.

◆ RawPointerProducerFactory

template<typename TIdentifier , typename TEntity >
using catapult::handlers::RawPointerProducerFactory = typedef std::function<supplier<const TEntity*> (const model::EntityRange<TIdentifier>&)>

Accepts a range and returns a producer that produces specified raw pointer elements.

◆ SharedPointerProducerFactory

template<typename TIdentifier , typename TEntity >
using catapult::handlers::SharedPointerProducerFactory = typedef std::function<supplier<std::shared_ptr<const TEntity> > (const model::EntityRange<TIdentifier>&)>

Accepts a range and returns a producer that produces specified shared pointer elements.

◆ TransactionRangeHandler

Prototype for a function that processes a range of transactions.

◆ UnconfirmedTransactions

using catapult::handlers::UnconfirmedTransactions = typedef std::vector<std::shared_ptr<const model::Transaction> >

Transactions returned by the unconfirmed transactions retriever.

◆ UtRetriever

Prototype for a function that retrieves unconfirmed transactions given a set of short hashes.

Function Documentation

◆ CreateConfirmedTimestampedHashesProducerFactory()

ConfirmedTimestampedHashesProducerFactory catapult::handlers::CreateConfirmedTimestampedHashesProducerFactory ( const cache::HashCache hashCache)

Creates a confirmed timestamped hashes producer factory around hashCache.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ CreatePushEntityHandler()

template<typename TEntity >
auto catapult::handlers::CreatePushEntityHandler ( const model::TransactionRegistry registry,
const RangeHandler< TEntity > &  rangeHandler 
)

Creates a push handler that forwards a received entity range to rangeHandler given a registry composed of supported transaction types.

Here is the call graph for this function:

◆ RegisterBlockHashesHandler()

void catapult::handlers::RegisterBlockHashesHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage,
uint32_t  maxHashes 
)

Registers a block hashes handler in handlers that responds with at most maxHashes hashes in storage.

Here is the call graph for this function:

◆ RegisterChainInfoHandler()

void catapult::handlers::RegisterChainInfoHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage,
const model::ChainScoreSupplier chainScoreSupplier 
)

Registers a chain info handler in handlers that responds with the height of the chain in storage and the score of the chain returned by chainScoreSupplier.

Here is the call graph for this function:

◆ RegisterConfirmTimestampedHashesHandler()

void catapult::handlers::RegisterConfirmTimestampedHashesHandler ( ionet::ServerPacketHandlers handlers,
const ConfirmedTimestampedHashesProducerFactory confirmedTimestampedHashesProducerFactory 
)

Registers a confirm timestamped hashes handler in handlers that responds with timestamped hashes not filtered by a producer from confirmedTimestampedHashesProducerFactory.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ RegisterDiagnosticBlockStatementHandler()

void catapult::handlers::RegisterDiagnosticBlockStatementHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage 
)

Registers a diagnostic block statement handler in handlers that responds with data from storage.

Here is the call graph for this function:

◆ RegisterDiagnosticCountersHandler()

void catapult::handlers::RegisterDiagnosticCountersHandler ( ionet::ServerPacketHandlers handlers,
const std::vector< utils::DiagnosticCounter > &  counters 
)

Registers a diagnostic counters handler in handlers that responds with the current values of counters.

Here is the call graph for this function:

◆ RegisterDiagnosticNodesHandler()

void catapult::handlers::RegisterDiagnosticNodesHandler ( ionet::ServerPacketHandlers handlers,
const ionet::NodeContainer nodeContainer 
)

Registers a diagnostic nodes handler in handlers that responds with info about all (active) partner nodes in nodeContainer.

Here is the call graph for this function:

◆ RegisterNodeDiscoveryPullPeersHandler()

void catapult::handlers::RegisterNodeDiscoveryPullPeersHandler ( ionet::ServerPacketHandlers handlers,
const NodesSupplier nodesSupplier 
)

Registers a node discovery pull peers handler in handlers that responds with nodes from nodesSupplier.

Here is the call graph for this function:

◆ RegisterNodeDiscoveryPullPingHandler()

void catapult::handlers::RegisterNodeDiscoveryPullPingHandler ( ionet::ServerPacketHandlers handlers,
const std::shared_ptr< const ionet::NetworkNode > &  pLocalNode 
)

Registers a node discovery pull ping handler in handlers that responds with pLocalNode.

Note
shared_ptr is used to avoid copying into packet.
Here is the call graph for this function:

◆ RegisterNodeDiscoveryPushPeersHandler()

void catapult::handlers::RegisterNodeDiscoveryPushPeersHandler ( ionet::ServerPacketHandlers handlers,
const NodesConsumer nodesConsumer 
)

Registers a node discovery push peers handler in handlers that forwards received nodes to nodesConsumer.

Here is the call graph for this function:

◆ RegisterNodeDiscoveryPushPingHandler()

void catapult::handlers::RegisterNodeDiscoveryPushPingHandler ( ionet::ServerPacketHandlers handlers,
model::NetworkIdentifier  networkIdentifier,
const NodeConsumer nodeConsumer 
)

Registers a node discovery push ping handler in handlers that forwards node information to nodeConsumer given the current network identifier (networkIdentifier).

Here is the call graph for this function:

◆ RegisterPullBlockHandler()

void catapult::handlers::RegisterPullBlockHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage 
)

Registers a pull block handler in handlers that responds with a block in storage.

Here is the call graph for this function:

◆ RegisterPullBlocksHandler()

void catapult::handlers::RegisterPullBlocksHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage,
const PullBlocksHandlerConfiguration config 
)

Registers a pull blocks handler in handlers that responds with blocks from storage according to behavior specified in config.

Here is the call graph for this function:

◆ RegisterPullPartialTransactionInfosHandler()

void catapult::handlers::RegisterPullPartialTransactionInfosHandler ( ionet::ServerPacketHandlers handlers,
const partialtransaction::CosignedTransactionInfosRetriever transactionInfosRetriever 
)

Registers a pull partial transactions handler in handlers that responds with partial transactions returned by the retriever (transactionInfosRetriever).

Here is the call graph for this function:

◆ RegisterPullTransactionsHandler()

void catapult::handlers::RegisterPullTransactionsHandler ( ionet::ServerPacketHandlers handlers,
const UtRetriever utRetriever 
)

Registers a pull transactions handler in handlers that responds with unconfirmed transactions returned by the retriever (utRetriever).

Here is the call graph for this function:

◆ RegisterPushBlockHandler()

void catapult::handlers::RegisterPushBlockHandler ( ionet::ServerPacketHandlers handlers,
const model::TransactionRegistry registry,
const BlockRangeHandler blockRangeHandler 
)

Registers a push block handler in handlers that validates a block and, if valid, forwards it to blockRangeHandler given a registry composed of known transactions.

Here is the call graph for this function:

◆ RegisterPushCosignaturesHandler()

void catapult::handlers::RegisterPushCosignaturesHandler ( ionet::ServerPacketHandlers handlers,
const CosignatureRangeHandler cosignatureRangeHandler 
)

Registers a push cosignatures handler in handlers that forwards cosignatures to cosignatureRangeHandler.

Here is the call graph for this function:

◆ RegisterPushPartialTransactionsHandler()

void catapult::handlers::RegisterPushPartialTransactionsHandler ( ionet::ServerPacketHandlers handlers,
const model::TransactionRegistry registry,
const TransactionRangeHandler transactionRangeHandler 
)

Registers a push partial transactions handler in handlers that forwards transactions to transactionRangeHandler given a registry composed of known transactions.

Here is the call graph for this function:

◆ RegisterPushTransactionsHandler()

void catapult::handlers::RegisterPushTransactionsHandler ( ionet::ServerPacketHandlers handlers,
const model::TransactionRegistry registry,
const TransactionRangeHandler transactionRangeHandler 
)

Registers a push transactions handler in handlers that forwards transactions to transactionRangeHandler given a registry composed of known transactions.

Here is the call graph for this function:

◆ RegisterStatePathHandler()

template<typename TPacket , typename TCache >
void catapult::handlers::RegisterStatePathHandler ( ionet::ServerPacketHandlers handlers,
const TCache &  cache 
)

Registers a handler in handlers that responds with serialized state path produced by querying cache.

Here is the call graph for this function:

◆ RegisterSubCacheMerkleRootsHandler()

void catapult::handlers::RegisterSubCacheMerkleRootsHandler ( ionet::ServerPacketHandlers handlers,
const io::BlockStorageCache storage 
)

Registers a sub cache merkle roots handler in handlers that responds with the sub cache merkle roots at a specified height from storage.

Here is the call graph for this function:

◆ RegisterTimeSyncNetworkTimeHandler()

void catapult::handlers::RegisterTimeSyncNetworkTimeHandler ( ionet::ServerPacketHandlers handlers,
const extensions::ExtensionManager::NetworkTimeSupplier networkTimeSupplier 
)

Registers a time sync network time handler in handlers that responds with communication timestamps using networkTimeSupplier.

Here is the call graph for this function: