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

#include "storage_base.hpp"

Inheritance diagram for iroha::ametsuchi::StorageBase:
Inheritance graph
Collaboration diagram for iroha::ametsuchi::StorageBase:
Collaboration graph

Public Types

using StoreBlockResult = iroha::expected::Result< void, std::string >
 

Public Member Functions

 StorageBase (StorageBase &&)=delete
 
 StorageBase (StorageBase const &)=delete
 
StorageBaseoperator= (StorageBase &&)=delete
 
StorageBaseoperator= (StorageBase const &)=delete
 
boost::optional< std::shared_ptr< PeerQuery > > createPeerQuery () const override
 
bool preparedCommitEnabled () const override
 Check if prepared commits are enabled. More...
 
boost::optional< std::shared_ptr< BlockQuery > > createBlockQuery () const override
 
logger::LoggerManagerTreePtr logManager () const
 
auto & blockIsPrepared ()
 
std::shared_ptr< BlockStorageblockStore () const
 
std::shared_ptr< shared_model::interface::PermissionToStringpermConverter () const
 
logger::LoggerPtr log () const
 
std::shared_ptr< PendingTransactionStoragependingTxStorage () const
 
auto & temporaryBlockStorageFactory ()
 
std::shared_ptr< shared_model::interface::QueryResponseFactoryqueryResponseFactory () const
 
std::optional< std::reference_wrapper< const VmCaller > > vmCaller () const
 
boost::optional< std::shared_ptr< const iroha::LedgerState > > ledgerState () const
 
void ledgerState (boost::optional< std::shared_ptr< const iroha::LedgerState >> const &value)
 
expected::Result< void, std::string > insertBlock (std::shared_ptr< const shared_model::interface::Block > block) override
 
expected::Result< void, std::string > dropBlockStorage () override
 
boost::optional< std::shared_ptr< const iroha::LedgerState > > getLedgerState () const override
 
CommitResult commit (std::unique_ptr< MutableStorage > mutable_storage) override
 
void prepareBlockImpl (std::unique_ptr< TemporaryWsv > wsv, DatabaseTransaction &db_context)
 
StoreBlockResult storeBlock (std::shared_ptr< const shared_model::interface::Block > block)
 
 StorageBase (boost::optional< std::shared_ptr< const iroha::LedgerState >> ledger_state, std::shared_ptr< BlockStorage > block_store, std::shared_ptr< shared_model::interface::PermissionToString > perm_converter, std::shared_ptr< PendingTransactionStorage > pending_txs_storage, std::shared_ptr< shared_model::interface::QueryResponseFactory > query_response_factory, std::unique_ptr< BlockStorageFactory > temporary_block_storage_factory, std::optional< std::reference_wrapper< const VmCaller >> vm_caller_ref, logger::LoggerManagerTreePtr log_manager, std::string const &prepared_block_name, std::function< void(std::shared_ptr< shared_model::interface::Block const >)> callback, bool prepared_blocks_enabled)
 
 ~StorageBase ()
 
- Public Member Functions inherited from iroha::ametsuchi::Storage
virtual std::shared_ptr< WsvQuerygetWsvQuery () const =0
 
virtual std::shared_ptr< BlockQuerygetBlockQuery () const =0
 
virtual expected::Result< std::unique_ptr< CommandExecutor >, std::string > createCommandExecutor ()=0
 
virtual expected::Result< void, std::string > insertPeer (const shared_model::interface::Peer &peer)=0
 
virtual iroha::expected::Result< std::unique_ptr< MutableStorage >, std::string > createMutableStorage (std::shared_ptr< CommandExecutor > command_executor, BlockStorageFactory &storage_factory)=0
 
virtual expected::Result< void, std::string > resetPeers ()=0
 
virtual void freeConnections ()=0
 
virtual ~Storage ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::TemporaryFactory
virtual std::unique_ptr< TemporaryWsvcreateTemporaryWsv (std::shared_ptr< CommandExecutor > command_executor)=0
 
virtual void prepareBlock (std::unique_ptr< TemporaryWsv > wsv)=0
 
virtual ~TemporaryFactory ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::MutableFactory
virtual iroha::expected::Result< std::unique_ptr< MutableStorage >, std::string > createMutableStorage (std::shared_ptr< CommandExecutor > command_executor)=0
 
virtual CommitResult commitPrepared (std::shared_ptr< const shared_model::interface::Block > block)=0
 
virtual ~MutableFactory ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::PeerQueryFactory
virtual ~PeerQueryFactory ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::BlockQueryFactory
virtual ~BlockQueryFactory ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::QueryExecutorFactory
virtual iroha::expected::Result< std::unique_ptr< QueryExecutor >, std::string > createQueryExecutor (std::shared_ptr< PendingTransactionStorage > pending_txs_storage, std::shared_ptr< shared_model::interface::QueryResponseFactory > response_factory) const =0
 
virtual ~QueryExecutorFactory ()=default
 
- Public Member Functions inherited from iroha::ametsuchi::SettingQueryFactory
virtual boost::optional< std::unique_ptr< SettingQuery > > createSettingQuery () const =0
 
virtual ~SettingQueryFactory ()=default
 

Protected Member Functions

CommitResult commitPreparedImpl (std::shared_ptr< const shared_model::interface::Block > block, DatabaseTransaction &db_context, WsvCommand &wsv_command, WsvQuery &wsv_query, std::unique_ptr< Indexer > indexer)
 

Member Typedef Documentation

◆ StoreBlockResult

Constructor & Destructor Documentation

◆ StorageBase() [1/3]

iroha::ametsuchi::StorageBase::StorageBase ( StorageBase &&  )
delete

◆ StorageBase() [2/3]

iroha::ametsuchi::StorageBase::StorageBase ( StorageBase const &  )
delete

◆ StorageBase() [3/3]

iroha::ametsuchi::StorageBase::StorageBase ( boost::optional< std::shared_ptr< const iroha::LedgerState >>  ledger_state,
std::shared_ptr< BlockStorage block_store,
std::shared_ptr< shared_model::interface::PermissionToString perm_converter,
std::shared_ptr< PendingTransactionStorage pending_txs_storage,
std::shared_ptr< shared_model::interface::QueryResponseFactory query_response_factory,
std::unique_ptr< BlockStorageFactory temporary_block_storage_factory,
std::optional< std::reference_wrapper< const VmCaller >>  vm_caller_ref,
logger::LoggerManagerTreePtr  log_manager,
std::string const &  prepared_block_name,
std::function< void(std::shared_ptr< shared_model::interface::Block const >)>  callback,
bool  prepared_blocks_enabled 
)

◆ ~StorageBase()

iroha::ametsuchi::StorageBase::~StorageBase ( )

Member Function Documentation

◆ blockIsPrepared()

auto& iroha::ametsuchi::StorageBase::blockIsPrepared ( )
inline
Here is the caller graph for this function:

◆ blockStore()

std::shared_ptr<BlockStorage> iroha::ametsuchi::StorageBase::blockStore ( ) const
inline
Here is the caller graph for this function:

◆ commit()

CommitResult iroha::ametsuchi::StorageBase::commit ( std::unique_ptr< MutableStorage mutableStorage)
overridevirtual

Commit mutable storage to Ametsuchi. This transforms Ametsuchi to the new state consistent with MutableStorage.

Parameters
mutableStorage
Returns
the status of commit

Implements iroha::ametsuchi::MutableFactory.

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

◆ commitPreparedImpl()

CommitResult iroha::ametsuchi::StorageBase::commitPreparedImpl ( std::shared_ptr< const shared_model::interface::Block block,
DatabaseTransaction db_context,
WsvCommand wsv_command,
WsvQuery wsv_query,
std::unique_ptr< Indexer indexer 
)
protected
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createBlockQuery()

boost::optional<std::shared_ptr<BlockQuery> > iroha::ametsuchi::StorageBase::createBlockQuery ( ) const
inlineoverridevirtual

Creates a block query from the current state.

Returns
Created block query

Implements iroha::ametsuchi::BlockQueryFactory.

◆ createPeerQuery()

boost::optional< std::shared_ptr< PeerQuery > > iroha::ametsuchi::StorageBase::createPeerQuery ( ) const
overridevirtual

Creates a peer query from the current state.

Returns
Created peer query

Implements iroha::ametsuchi::PeerQueryFactory.

Here is the call graph for this function:

◆ dropBlockStorage()

expected::Result< void, std::string > iroha::ametsuchi::StorageBase::dropBlockStorage ( )
overridevirtual

Remove all blocks from block storage.

Implements iroha::ametsuchi::Storage.

◆ getLedgerState()

boost::optional< std::shared_ptr< const iroha::LedgerState > > iroha::ametsuchi::StorageBase::getLedgerState ( ) const
overridevirtual

◆ insertBlock()

expected::Result< void, std::string > iroha::ametsuchi::StorageBase::insertBlock ( std::shared_ptr< const shared_model::interface::Block block)
overridevirtual

Raw insertion of blocks without validation

Parameters
block- block for insertion
Returns
true if inserted

Implements iroha::ametsuchi::Storage.

Here is the call graph for this function:

◆ ledgerState() [1/2]

boost::optional<std::shared_ptr<const iroha::LedgerState> > iroha::ametsuchi::StorageBase::ledgerState ( ) const
inline
Here is the caller graph for this function:

◆ ledgerState() [2/2]

void iroha::ametsuchi::StorageBase::ledgerState ( boost::optional< std::shared_ptr< const iroha::LedgerState >> const &  value)
inline

◆ log()

logger::LoggerPtr iroha::ametsuchi::StorageBase::log ( ) const
inline
Here is the caller graph for this function:

◆ logManager()

logger::LoggerManagerTreePtr iroha::ametsuchi::StorageBase::logManager ( ) const
inline
Here is the caller graph for this function:

◆ operator=() [1/2]

StorageBase& iroha::ametsuchi::StorageBase::operator= ( StorageBase &&  )
delete

◆ operator=() [2/2]

StorageBase& iroha::ametsuchi::StorageBase::operator= ( StorageBase const &  )
delete

◆ pendingTxStorage()

std::shared_ptr<PendingTransactionStorage> iroha::ametsuchi::StorageBase::pendingTxStorage ( ) const
inline
Here is the caller graph for this function:

◆ permConverter()

std::shared_ptr<shared_model::interface::PermissionToString> iroha::ametsuchi::StorageBase::permConverter ( ) const
inline
Here is the caller graph for this function:

◆ prepareBlockImpl()

void iroha::ametsuchi::StorageBase::prepareBlockImpl ( std::unique_ptr< TemporaryWsv wsv,
DatabaseTransaction db_context 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ preparedCommitEnabled()

bool iroha::ametsuchi::StorageBase::preparedCommitEnabled ( ) const
overridevirtual

Check if prepared commits are enabled.

Implements iroha::ametsuchi::MutableFactory.

◆ queryResponseFactory()

std::shared_ptr<shared_model::interface::QueryResponseFactory> iroha::ametsuchi::StorageBase::queryResponseFactory ( ) const
inline
Here is the caller graph for this function:

◆ storeBlock()

StorageBase::StoreBlockResult iroha::ametsuchi::StorageBase::storeBlock ( std::shared_ptr< const shared_model::interface::Block block)

add block to block storage

Here is the call graph for this function:

◆ temporaryBlockStorageFactory()

auto& iroha::ametsuchi::StorageBase::temporaryBlockStorageFactory ( )
inline
Here is the caller graph for this function:

◆ vmCaller()

std::optional<std::reference_wrapper<const VmCaller> > iroha::ametsuchi::StorageBase::vmCaller ( ) const
inline
Here is the caller graph for this function:

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