hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::network::BlockLoaderImpl Class Reference

#include "block_loader_impl.hpp"

Inheritance diagram for iroha::network::BlockLoaderImpl:
Inheritance graph
Collaboration diagram for iroha::network::BlockLoaderImpl:
Collaboration graph

Public Types

using Service = proto::Loader
 
using ClientFactory = iroha::network::ClientFactory< Service >
 

Public Member Functions

 BlockLoaderImpl (std::shared_ptr< ametsuchi::PeerQueryFactory > peer_query_factory, std::shared_ptr< shared_model::proto::ProtoBlockFactory > factory, logger::LoggerPtr log, std::unique_ptr< ClientFactory > client_factory)
 
expected::Result< std::unique_ptr< BlockReader > > retrieveBlocks (const shared_model::interface::types::HeightType height, shared_model::interface::types::PublicKeyHexStringView peer_pubkey) override
 
iroha::expected::Result< std::unique_ptr< shared_model::interface::Block >, std::string > retrieveBlock (shared_model::interface::types::PublicKeyHexStringView peer_pubkey, shared_model::interface::types::HeightType block_height) override
 
- Public Member Functions inherited from iroha::network::BlockLoader
virtual ~BlockLoader ()=default
 

Member Typedef Documentation

◆ ClientFactory

◆ Service

Constructor & Destructor Documentation

◆ BlockLoaderImpl()

BlockLoaderImpl::BlockLoaderImpl ( std::shared_ptr< ametsuchi::PeerQueryFactory peer_query_factory,
std::shared_ptr< shared_model::proto::ProtoBlockFactory factory,
logger::LoggerPtr  log,
std::unique_ptr< ClientFactory client_factory 
)

Member Function Documentation

◆ retrieveBlock()

Result< std::unique_ptr< Block >, std::string > BlockLoaderImpl::retrieveBlock ( shared_model::interface::types::PublicKeyHexStringView  peer_pubkey,
shared_model::interface::types::HeightType  block_height 
)
overridevirtual

Retrieve block by its block_height from given peer

Parameters
peer_pubkey- peer for requesting blocks
block_height- requested block height
Returns
block on success, nullopt on failure TODO 14/02/17 () IR-960 rework method with returning result

Implements iroha::network::BlockLoader.

Here is the call graph for this function:

◆ retrieveBlocks()

Result< std::unique_ptr< BlockReader > > BlockLoaderImpl::retrieveBlocks ( const shared_model::interface::types::HeightType  height,
shared_model::interface::types::PublicKeyHexStringView  peer_pubkey 
)
overridevirtual

Retrieve block from given peer starting from current top

Parameters
height- top block height in requester's peer storage
peer_pubkey- peer for requesting blocks
Returns

Implements iroha::network::BlockLoader.


The documentation for this class was generated from the following files: