Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::Storage Class Referenceabstract

#include "storage.hpp"

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

Public Member Functions

virtual std::shared_ptr< WsvQuerygetWsvQuery () const =0
virtual std::shared_ptr< BlockQuerygetBlockQuery () const =0
virtual bool insertBlock (std::shared_ptr< const shared_model::interface::Block > block)=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 std::unique_ptr< MutableStoragecreateMutableStorage (std::shared_ptr< CommandExecutor > command_executor, BlockStorageFactory &storage_factory)=0
virtual rxcpp::observable< std::shared_ptr< const shared_model::interface::Block > > on_commit ()=0
virtual void resetPeers ()=0
virtual expected::Result< void, std::string > dropBlockStorage ()=0
virtual boost::optional< std::shared_ptr< const iroha::LedgerState > > getLedgerState () const =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 std::unique_ptr< MutableStoragecreateMutableStorage (std::shared_ptr< CommandExecutor > command_executor)=0
virtual CommitResult commit (std::unique_ptr< MutableStorage > mutableStorage)=0
virtual bool preparedCommitEnabled () const =0
 Check if prepared commits are enabled. More...
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 boost::optional< std::shared_ptr< PeerQuery > > createPeerQuery () const =0
virtual ~PeerQueryFactory ()=default
- Public Member Functions inherited from iroha::ametsuchi::BlockQueryFactory
virtual boost::optional< std::shared_ptr< BlockQuery > > createBlockQuery () const =0
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

Detailed Description

Storage interface, which allows queries on current committed state, and creation of state which can be mutated with blocks and transactions

Constructor & Destructor Documentation

◆ ~Storage()

virtual iroha::ametsuchi::Storage::~Storage ( )

Member Function Documentation

◆ createCommandExecutor()

virtual expected::Result<std::unique_ptr<CommandExecutor>, std::string> iroha::ametsuchi::Storage::createCommandExecutor ( )
pure virtual

Create new command executor that holds a database session within.

The command executor or string error message.

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

◆ createMutableStorage()

virtual std::unique_ptr<MutableStorage> iroha::ametsuchi::Storage::createMutableStorage ( std::shared_ptr< CommandExecutor command_executor,
BlockStorageFactory storage_factory 
pure virtual

Creates a mutable storage from the current state

Created mutable storage.

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

◆ dropBlockStorage()

virtual expected::Result<void, std::string> iroha::ametsuchi::Storage::dropBlockStorage ( )
pure virtual

Remove all blocks from block storage.

Implemented in iroha::ametsuchi::StorageImpl.

◆ freeConnections()

virtual void iroha::ametsuchi::Storage::freeConnections ( )
pure virtual

◆ getBlockQuery()

virtual std::shared_ptr<BlockQuery> iroha::ametsuchi::Storage::getBlockQuery ( ) const
pure virtual

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

◆ getLedgerState()

virtual boost::optional<std::shared_ptr<const iroha::LedgerState> > iroha::ametsuchi::Storage::getLedgerState ( ) const
pure virtual

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

◆ getWsvQuery()

virtual std::shared_ptr<WsvQuery> iroha::ametsuchi::Storage::getWsvQuery ( ) const
pure virtual

◆ insertBlock()

virtual bool iroha::ametsuchi::Storage::insertBlock ( std::shared_ptr< const shared_model::interface::Block block)
pure virtual

Raw insertion of blocks without validation

block- block for insertion
true if inserted

Implemented in iroha::ametsuchi::StorageImpl.

◆ insertPeer()

virtual expected::Result<void, std::string> iroha::ametsuchi::Storage::insertPeer ( const shared_model::interface::Peer peer)
pure virtual

Insert a peer into WSV

peer- peer to insert
error reason if not inserted

Implemented in iroha::ametsuchi::StorageImpl.

◆ on_commit()

virtual rxcpp::observable< std::shared_ptr<const shared_model::interface::Block> > iroha::ametsuchi::Storage::on_commit ( )
pure virtual

method called when block is written to the storage

observable with the Block committed

Implemented in iroha::ametsuchi::StorageImpl.

◆ resetPeers()

virtual void iroha::ametsuchi::Storage::resetPeers ( )
pure virtual

Removes all peers from WSV

Implemented in iroha::ametsuchi::StorageImpl.

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