CatapultServer  v0.5.0.1 (Elephant)
ChainHandlers.h
Go to the documentation of this file.
1 
21 #pragma once
22 #include "HandlerTypes.h"
26 
27 namespace catapult { namespace io { class BlockStorageCache; } }
28 
29 namespace catapult { namespace handlers {
30 
34  ionet::ServerPacketHandlers& handlers,
35  const model::TransactionRegistry& registry,
36  const BlockRangeHandler& blockRangeHandler);
37 
39  void RegisterPullBlockHandler(ionet::ServerPacketHandlers& handlers, const io::BlockStorageCache& storage);
40 
44  ionet::ServerPacketHandlers& handlers,
45  const io::BlockStorageCache& storage,
46  const model::ChainScoreSupplier& chainScoreSupplier);
47 
49  void RegisterBlockHashesHandler(ionet::ServerPacketHandlers& handlers, const io::BlockStorageCache& storage, uint32_t maxHashes);
50 
54  uint32_t MaxBlocks;
55 
57  uint32_t MaxResponseBytes;
58  };
59 
64  const io::BlockStorageCache& storage,
65  const PullBlocksHandlerConfiguration& config);
66 }}
Block.h
PacketEntityUtils.h
HandlerUtils.h
catapult::Height
utils::BaseValue< uint64_t, Height_tag > Height
Definition: src/catapult/types.h:85
ChainHandlers.h
catapult::handlers::RegisterPushBlockHandler
void RegisterPushBlockHandler(ionet::ServerPacketHandlers &handlers, const model::TransactionRegistry &registry, const BlockRangeHandler &blockRangeHandler)
Definition: ChainHandlers.cpp:33
PacketPayloadFactory.h
catapult::handlers::RegisterBlockHashesHandler
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.
Definition: ChainHandlers.cpp:108
catapult::ionet::ServerPacketHandlers::registerHandler
void registerHandler(PacketType type, const PacketHandler &handler)
Registers a handler for the specified packet type.
Definition: PacketHandlers.cpp:100
catapult::io::BlockStorageCache::view
BlockStorageView view() const
Gets a read only view of the storage.
Definition: BlockStorageCache.cpp:176
catapult::model::ChainScoreSupplier
supplier< ChainScore > ChainScoreSupplier
Prototype for a function that returns a chain score.
Definition: ChainScore.h:120
PacketHandlers.h
catapult::handlers::RegisterPullBlocksHandler
void RegisterPullBlocksHandler(ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage, const PullBlocksHandlerConfiguration &config)
Definition: ChainHandlers.cpp:153
Packet_Type
static constexpr auto Packet_Type
Definition: RemoteNodeApi.cpp:33
catapult::io::BlockStorageCache
Definition: BlockStorageCache.h:97
forwardsValidation.info
def info(*args)
Definition: forwardsValidation.py:12
catapult::io::BlockStorageView::chainHeight
Height chainHeight() const
Gets the number of blocks.
Definition: BlockStorageCache.cpp:81
catapult::api::ChainInfoResponse
A chain info response.
Definition: ChainPackets.h:30
ChainScore.h
catapult::handlers::BlockRangeHandler
RangeHandler< model::Block > BlockRangeHandler
Prototype for a function that processes a range of blocks.
Definition: HandlerTypes.h:32
catapult::handlers::HeightRequestProcessor::Process
static HeightRequestInfo< TRequest > Process(const io::BlockStorageView &storage, const ionet::Packet &packet, ionet::ServerPacketHandlerContext &context, bool shouldAllowZeroHeight)
Definition: HeightRequestProcessor.h:66
catapult::handlers::PullBlocksHandlerConfiguration::MaxBlocks
uint32_t MaxBlocks
Maximum blocks to return.
Definition: ChainHandlers.h:54
catapult::ionet::PacketPayloadFactory::FromFixedSizeRange
static PacketPayload FromFixedSizeRange(PacketType type, model::EntityRange< TStructure > &&range)
Creates a packet payload with the specified packet type around a fixed size structure range.
Definition: PacketPayloadFactory.h:45
catapult::handlers::RegisterChainInfoHandler
void RegisterChainInfoHandler(ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage, const model::ChainScoreSupplier &chainScoreSupplier)
Definition: ChainHandlers.cpp:79
ChainPackets.h
catapult::handlers::PullBlocksHandlerConfiguration::MaxResponseBytes
uint32_t MaxResponseBytes
Maximum response bytes.
Definition: ChainHandlers.h:57
catapult::ionet::PacketPayload
A packet payload that can be written.
Definition: PacketPayload.h:29
catapult
Definition: AddressExtractionExtension.cpp:28
catapult::model::TransactionRegistry
A registry of transaction plugins.
Definition: TransactionPlugin.h:98
HandlerTypes.h
catapult::ionet::PacketPayloadFactory::FromEntities
static PacketPayload FromEntities(PacketType type, const std::vector< std::shared_ptr< TEntity >> &entities)
Creates a packet payload with the specified packet type around multiple entities.
Definition: PacketPayloadFactory.h:37
catapult::handlers::RegisterPullBlockHandler
void RegisterPullBlockHandler(ionet::ServerPacketHandlers &handlers, const io::BlockStorageCache &storage)
Registers a pull block handler in handlers that responds with a block in storage.
Definition: ChainHandlers.cpp:57
catapult::ionet::PacketPayloadFactory::FromEntity
static PacketPayload FromEntity(PacketType type, const std::shared_ptr< TEntity > &pEntity)
Creates a packet payload with the specified packet type around a single entity (pEntity).
Definition: PacketPayloadFactory.h:31
BlockStorageCache.h
catapult::ionet::IsPacketValid
constexpr bool IsPacketValid(const Packet &packet, PacketType type)
Checks if packet is valid with type.
Definition: Packet.h:75
catapult::handlers::PullBlocksHandlerConfiguration
Configuration for pull blocks handler.
Definition: ChainHandlers.h:52
catapult::ionet::ServerPacketHandlers
A collection of packet handlers where there is at most one handler per packet type.
Definition: PacketHandlers.h:62
catapult::api::PullBlockRequest
HeightPacket< ionet::PacketType::Pull_Block > PullBlockRequest
A pull block request.
Definition: ChainPackets.h:53
BlockUtils.h
HeightRequestProcessor.h
RangeTypes.h