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

#include "block_loader.hpp"

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

Public Member Functions

virtual rxcpp::observable< std::shared_ptr< shared_model::interface::Block > > retrieveBlocks (const shared_model::interface::types::HeightType height, const shared_model::crypto::PublicKey &peer_pubkey)=0
 
virtual boost::optional< std::shared_ptr< shared_model::interface::Block > > retrieveBlock (const shared_model::crypto::PublicKey &peer_pubkey, const shared_model::interface::types::HashType &block_hash)=0
 
virtual ~BlockLoader ()=default
 

Detailed Description

Interface for downloading blocks from a network

Constructor & Destructor Documentation

virtual iroha::network::BlockLoader::~BlockLoader ( )
virtualdefault

Member Function Documentation

virtual boost::optional<std::shared_ptr<shared_model::interface::Block> > iroha::network::BlockLoader::retrieveBlock ( const shared_model::crypto::PublicKey peer_pubkey,
const shared_model::interface::types::HashType block_hash 
)
pure virtual

Retrieve block by its block_hash from given peer

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

Implemented in iroha::network::BlockLoaderImpl.

virtual rxcpp::observable<std::shared_ptr<shared_model::interface::Block> > iroha::network::BlockLoader::retrieveBlocks ( const shared_model::interface::types::HeightType  height,
const shared_model::crypto::PublicKey peer_pubkey 
)
pure virtual

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

Implemented in iroha::network::BlockLoaderImpl.


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