hyperledger/iroha
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 reset ()=0
 
virtual expected::Result< void, std::string > resetWsv ()=0
 
virtual void resetPeers ()=0
 
virtual void dropStorage ()=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 boost::optional< std::shared_ptr< QueryExecutor > > 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

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

Member Function Documentation

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.

Returns
The command executor or string error message.

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

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

Returns
Created mutable storage.

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:

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

Remove all information from ledger Tables and the database will be removed too TODO: 2019-05-22 move method to TestStorage IR-493

Implemented in iroha::ametsuchi::StorageImpl.

virtual void iroha::ametsuchi::Storage::freeConnections ( )
pure virtual
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:

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

Raw insertion of blocks without validation

Parameters
block- block for insertion
Returns
true if inserted

Implemented in iroha::ametsuchi::StorageImpl.

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

Insert a peer into WSV

Parameters
peer- peer to insert
Returns
error reason if not inserted

Implemented in iroha::ametsuchi::StorageImpl.

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

Returns
observable with the Block committed

Implemented in iroha::ametsuchi::StorageImpl.

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

Remove all records from the tables and remove all the blocks

Implemented in iroha::ametsuchi::StorageImpl.

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

Removes all peers from WSV

Implemented in iroha::ametsuchi::StorageImpl.

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

Implemented in iroha::ametsuchi::StorageImpl.

Here is the caller graph for this function:


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