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

#include "application.hpp"

Collaboration diagram for Irohad:
Collaboration graph

Public Types

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

Public Member Functions

 Irohad (const boost::optional< std::string > &block_store_dir, std::unique_ptr< iroha::ametsuchi::PostgresOptions > pg_opt, const std::string &listen_ip, size_t torii_port, size_t internal_port, size_t max_proposal_size, std::chrono::milliseconds proposal_delay, std::chrono::milliseconds vote_delay, std::chrono::minutes mst_expiration_time, const shared_model::crypto::Keypair &keypair, std::chrono::milliseconds max_rounds_delay, size_t stale_stream_max_rounds, boost::optional< shared_model::interface::types::PeerList > opt_alternative_peers, logger::LoggerManagerTreePtr logger_manager, const boost::optional< iroha::GossipPropagationStrategyParams > &opt_mst_gossip_params=boost::none, const boost::optional< iroha::torii::TlsParams > &torii_tls_params=boost::none, boost::optional< IrohadConfig::InterPeerTls > inter_peer_tls_config=boost::none)
 
virtual RunResult init ()
 
RunResult restoreWsv ()
 
RunResult validateKeypair ()
 
virtual void dropStorage ()
 
RunResult run ()
 
virtual ~Irohad ()
 

Public Attributes

shared_model::crypto::Keypair keypair
 
std::shared_ptr< iroha::ametsuchi::Storagestorage
 

Protected Member Functions

virtual RunResult initStorage (std::unique_ptr< iroha::ametsuchi::PostgresOptions > pg_opt)
 
RunResult initTlsCredentials ()
 
RunResult initPeerCertProvider ()
 
virtual RunResult initCryptoProvider ()
 
virtual RunResult initBatchParser ()
 
virtual RunResult initValidators ()
 
virtual RunResult initNetworkClient ()
 
virtual RunResult initFactories ()
 
virtual RunResult initPersistentCache ()
 
virtual RunResult initOrderingGate ()
 
virtual RunResult initSimulator ()
 
virtual RunResult initConsensusCache ()
 
virtual RunResult initBlockLoader ()
 
virtual RunResult initConsensusGate ()
 
virtual RunResult initSynchronizer ()
 
virtual RunResult initPeerCommunicationService ()
 
virtual RunResult initStatusBus ()
 
virtual RunResult initMstProcessor ()
 
virtual RunResult initPendingTxsStorage ()
 
virtual RunResult initTransactionCommandService ()
 
virtual RunResult initQueryService ()
 
virtual RunResult initSettings ()
 
virtual RunResult initValidatorsConfigs ()
 
virtual RunResult initWsvRestorer ()
 

Protected Attributes

const boost::optional< std::string > block_store_dir_
 
const std::string listen_ip_
 
size_t torii_port_
 
boost::optional< iroha::torii::TlsParamstorii_tls_params_
 
size_t internal_port_
 
size_t max_proposal_size_
 
std::chrono::milliseconds proposal_delay_
 
std::chrono::milliseconds vote_delay_
 
bool is_mst_supported_
 
std::chrono::minutes mst_expiration_time_
 
std::chrono::milliseconds max_rounds_delay_
 
size_t stale_stream_max_rounds_
 
const boost::optional< shared_model::interface::types::PeerListopt_alternative_peers_
 
boost::optional< iroha::GossipPropagationStrategyParamsopt_mst_gossip_params_
 
boost::optional< IrohadConfig::InterPeerTlsinter_peer_tls_config_
 
boost::optional< std::shared_ptr< const iroha::network::TlsCredentials > > my_inter_peer_tls_creds_
 
boost::optional< std::shared_ptr< const iroha::network::TlsCredentials > > torii_tls_creds_
 
boost::optional< std::shared_ptr< const iroha::network::PeerTlsCertificatesProvider > > peer_tls_certificates_provider_
 
std::unique_ptr< iroha::PendingTransactionStorageInitpending_txs_storage_init
 
std::shared_ptr< iroha::PendingTransactionStoragepending_txs_storage_
 
std::shared_ptr< shared_model::interface::QueryResponseFactoryquery_response_factory_
 
iroha::network::OnDemandOrderingInit ordering_init
 
std::unique_ptr< iroha::consensus::yac::YacInityac_init
 
iroha::network::BlockLoaderInit loader_init
 
std::shared_ptr< iroha::ametsuchi::PoolWrapperpool_wrapper_
 
std::shared_ptr< const shared_model::validation::Settingssettings_
 
std::shared_ptr< iroha::ametsuchi::WsvRestorerwsv_restorer_
 
std::shared_ptr< shared_model::crypto::AbstractCryptoModelSigner< shared_model::interface::Block > > crypto_signer_
 
std::shared_ptr< shared_model::interface::TransactionBatchParserbatch_parser
 
std::shared_ptr< shared_model::validation::ValidatorsConfigvalidators_config_
 
std::shared_ptr< shared_model::validation::ValidatorsConfigproposal_validators_config_
 
std::shared_ptr< shared_model::validation::ValidatorsConfigblock_validators_config_
 
std::shared_ptr< iroha::validation::StatefulValidatorstateful_validator
 
std::shared_ptr< iroha::validation::ChainValidatorchain_validator
 
std::shared_ptr< iroha::network::AsyncGrpcClient< google::protobuf::Empty > > async_call_
 
std::shared_ptr< shared_model::interface::TransactionBatchFactorytransaction_batch_factory_
 
std::shared_ptr< shared_model::interface::AbstractTransportFactory< shared_model::interface::Transaction, iroha::protocol::Transaction > > transaction_factory
 
std::shared_ptr< shared_model::interface::AbstractTransportFactory< shared_model::interface::Query, iroha::protocol::Query > > query_factory
 
std::shared_ptr< shared_model::interface::AbstractTransportFactory< shared_model::interface::BlocksQuery, iroha::protocol::BlocksQuery > > blocks_query_factory
 
std::shared_ptr< iroha::ametsuchi::TxPresenceCachepersistent_cache
 
std::shared_ptr< shared_model::interface::AbstractTransportFactory< shared_model::interface::Proposal, iroha::protocol::Proposal > > proposal_factory
 
std::shared_ptr< iroha::network::OrderingGateordering_gate
 
std::shared_ptr< iroha::simulator::Simulatorsimulator
 
std::shared_ptr< iroha::consensus::ConsensusResultCacheconsensus_result_cache_
 
std::shared_ptr< iroha::network::BlockLoaderblock_loader
 
std::shared_ptr< iroha::synchronizer::Synchronizersynchronizer
 
std::shared_ptr< iroha::network::PeerCommunicationServicepcs
 
std::shared_ptr< iroha::torii::StatusBusstatus_bus_
 
std::shared_ptr< iroha::network::MstTransportmst_transport
 
std::shared_ptr< iroha::MstProcessormst_processor
 
std::shared_ptr< iroha::torii::CommandServicecommand_service
 
std::shared_ptr< iroha::torii::CommandServiceTransportGrpccommand_service_transport
 
std::shared_ptr< iroha::torii::QueryServicequery_service
 
std::shared_ptr< iroha::network::ConsensusGateconsensus_gate
 
rxcpp::composite_subscription consensus_gate_objects_lifetime
 
rxcpp::subjects::subject< iroha::consensus::GateObjectconsensus_gate_objects
 
rxcpp::composite_subscription consensus_gate_events_subscription
 
std::unique_ptr< iroha::network::ServerRunnertorii_server
 
boost::optional< std::unique_ptr< iroha::network::ServerRunner > > torii_tls_server = boost::none
 
std::unique_ptr< iroha::network::ServerRunnerinternal_server
 
logger::LoggerManagerTreePtr log_manager_
 application root log manager More...
 
logger::LoggerPtr log_
 log for local messages More...
 

Member Typedef Documentation

◆ RunResult

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

Constructor & Destructor Documentation

◆ Irohad()

Irohad::Irohad ( const boost::optional< std::string > &  block_store_dir,
std::unique_ptr< iroha::ametsuchi::PostgresOptions pg_opt,
const std::string &  listen_ip,
size_t  torii_port,
size_t  internal_port,
size_t  max_proposal_size,
std::chrono::milliseconds  proposal_delay,
std::chrono::milliseconds  vote_delay,
std::chrono::minutes  mst_expiration_time,
const shared_model::crypto::Keypair keypair,
std::chrono::milliseconds  max_rounds_delay,
size_t  stale_stream_max_rounds,
boost::optional< shared_model::interface::types::PeerList opt_alternative_peers,
logger::LoggerManagerTreePtr  logger_manager,
const boost::optional< iroha::GossipPropagationStrategyParams > &  opt_mst_gossip_params = boost::none,
const boost::optional< iroha::torii::TlsParams > &  torii_tls_params = boost::none,
boost::optional< IrohadConfig::InterPeerTls inter_peer_tls_config = boost::none 
)

Constructor that initializes common iroha pipeline

Parameters
block_store_dir- folder where blocks will be stored
pg_opt- connection options for PostgresSQL
listen_ip- ip address for opening ports (internal & torii)
torii_port- port for torii binding
internal_port- port for internal communication - ordering service, consensus, and block loader
max_proposal_size- maximum transactions that possible appears in one proposal
proposal_delay- maximum waiting time util emitting new proposal
vote_delay- waiting time before sending vote to next peer
mst_expiration_time- maximum time until until MST transaction is not considered as expired (in minutes)
keypair- public and private keys for crypto signer
max_rounds_delay- maximum delay between consecutive rounds without transactions
stale_stream_max_rounds- maximum number of rounds between consecutive status emissions
opt_alternative_peers- optional alternative initial peers list
logger_manager- the logger manager to use
opt_mst_gossip_params- parameters for Gossip MST propagation (optional). If not provided, disables mst processing support TODO mboldyrev 03.11.2018 IR-1844 Refactor the constructor.
torii_tls_params- optional TLS params for torii.
See also
iroha::torii::TlsParams
Parameters
inter_peer_tls_config- set up TLS in peer-to-peer communication

Configuring iroha daemon

Here is the call graph for this function:

◆ ~Irohad()

Irohad::~Irohad ( )
virtual

Member Function Documentation

◆ dropStorage()

void Irohad::dropStorage ( )
virtual

Drop wsv and block store

Dropping iroha daemon storage

◆ init()

Irohad::RunResult Irohad::init ( )
virtual

Initialization of whole objects in system

Initializing iroha daemon

Here is the call graph for this function:

◆ initBatchParser()

Irohad::RunResult Irohad::initBatchParser ( )
protectedvirtual
Here is the caller graph for this function:

◆ initBlockLoader()

Irohad::RunResult Irohad::initBlockLoader ( )
protectedvirtual

Initializing block loader

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

◆ initConsensusCache()

Irohad::RunResult Irohad::initConsensusCache ( )
protectedvirtual

Initializing consensus block cache

Here is the caller graph for this function:

◆ initConsensusGate()

Irohad::RunResult Irohad::initConsensusGate ( )
protectedvirtual

Initializing consensus gate

Here is the caller graph for this function:

◆ initCryptoProvider()

Irohad::RunResult Irohad::initCryptoProvider ( )
protectedvirtual

Initializing crypto provider

Here is the caller graph for this function:

◆ initFactories()

Irohad::RunResult Irohad::initFactories ( )
protectedvirtual
Here is the caller graph for this function:

◆ initMstProcessor()

Irohad::RunResult Irohad::initMstProcessor ( )
protectedvirtual
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initNetworkClient()

Irohad::RunResult Irohad::initNetworkClient ( )
protectedvirtual

Initializing network client

Here is the caller graph for this function:

◆ initOrderingGate()

Irohad::RunResult Irohad::initOrderingGate ( )
protectedvirtual

Initializing ordering gate

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

◆ initPeerCertProvider()

Irohad::RunResult Irohad::initPeerCertProvider ( )
protected

Initializing peers' certificates provider.

Here is the caller graph for this function:

◆ initPeerCommunicationService()

Irohad::RunResult Irohad::initPeerCommunicationService ( )
protectedvirtual

Initializing peer communication service

Here is the caller graph for this function:

◆ initPendingTxsStorage()

Irohad::RunResult Irohad::initPendingTxsStorage ( )
protectedvirtual
Here is the caller graph for this function:

◆ initPersistentCache()

Irohad::RunResult Irohad::initPersistentCache ( )
protectedvirtual

Initializing persistent cache

Here is the caller graph for this function:

◆ initQueryService()

Irohad::RunResult Irohad::initQueryService ( )
protectedvirtual

Initializing query command service

Here is the caller graph for this function:

◆ initSettings()

Irohad::RunResult Irohad::initSettings ( )
protectedvirtual

Initializing setting query

Here is the caller graph for this function:

◆ initSimulator()

Irohad::RunResult Irohad::initSimulator ( )
protectedvirtual

Initializing iroha verified proposal creator and block creator

Here is the caller graph for this function:

◆ initStatusBus()

Irohad::RunResult Irohad::initStatusBus ( )
protectedvirtual
Here is the caller graph for this function:

◆ initStorage()

Irohad::RunResult Irohad::initStorage ( std::unique_ptr< iroha::ametsuchi::PostgresOptions pg_opt)
protectedvirtual

Initializing iroha daemon storage

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

◆ initSynchronizer()

Irohad::RunResult Irohad::initSynchronizer ( )
protectedvirtual

Initializing synchronizer

Here is the caller graph for this function:

◆ initTlsCredentials()

Irohad::RunResult Irohad::initTlsCredentials ( )
protected

Initializing own TLS credentials.

Here is the caller graph for this function:

◆ initTransactionCommandService()

Irohad::RunResult Irohad::initTransactionCommandService ( )
protectedvirtual

Initializing transaction command service

Here is the caller graph for this function:

◆ initValidators()

Irohad::RunResult Irohad::initValidators ( )
protectedvirtual

Initializing validators

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

◆ initValidatorsConfigs()

Irohad::RunResult Irohad::initValidatorsConfigs ( )
protectedvirtual

Initializing validators' configs

Here is the caller graph for this function:

◆ initWsvRestorer()

Irohad::RunResult Irohad::initWsvRestorer ( )
protectedvirtual

Initialize WSV restorer

Here is the caller graph for this function:

◆ restoreWsv()

Irohad::RunResult Irohad::restoreWsv ( )

Restore World State View

Returns
void value on success, error message otherwise
Here is the caller graph for this function:

◆ run()

Irohad::RunResult Irohad::run ( )

Run worker threads for start performing

Returns
void value on success, error message otherwise

Run iroha daemon

◆ validateKeypair()

Irohad::RunResult Irohad::validateKeypair ( )

Check that the provided keypair is present in the ledger

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

Member Data Documentation

◆ async_call_

std::shared_ptr<iroha::network::AsyncGrpcClient<google::protobuf::Empty> > Irohad::async_call_
protected

◆ batch_parser

std::shared_ptr<shared_model::interface::TransactionBatchParser> Irohad::batch_parser
protected

◆ block_loader

std::shared_ptr<iroha::network::BlockLoader> Irohad::block_loader
protected

◆ block_store_dir_

const boost::optional<std::string> Irohad::block_store_dir_
protected

◆ block_validators_config_

std::shared_ptr<shared_model::validation::ValidatorsConfig> Irohad::block_validators_config_
protected

◆ blocks_query_factory

std::shared_ptr<shared_model::interface::AbstractTransportFactory< shared_model::interface::BlocksQuery, iroha::protocol::BlocksQuery> > Irohad::blocks_query_factory
protected

◆ chain_validator

std::shared_ptr<iroha::validation::ChainValidator> Irohad::chain_validator
protected

◆ command_service

std::shared_ptr<iroha::torii::CommandService> Irohad::command_service
protected

◆ command_service_transport

std::shared_ptr<iroha::torii::CommandServiceTransportGrpc> Irohad::command_service_transport
protected

◆ consensus_gate

std::shared_ptr<iroha::network::ConsensusGate> Irohad::consensus_gate
protected

◆ consensus_gate_events_subscription

rxcpp::composite_subscription Irohad::consensus_gate_events_subscription
protected

◆ consensus_gate_objects

rxcpp::subjects::subject<iroha::consensus::GateObject> Irohad::consensus_gate_objects
protected

◆ consensus_gate_objects_lifetime

rxcpp::composite_subscription Irohad::consensus_gate_objects_lifetime
protected

◆ consensus_result_cache_

std::shared_ptr<iroha::consensus::ConsensusResultCache> Irohad::consensus_result_cache_
protected

◆ crypto_signer_

std::shared_ptr<shared_model::crypto::AbstractCryptoModelSigner< shared_model::interface::Block> > Irohad::crypto_signer_
protected

◆ inter_peer_tls_config_

boost::optional<IrohadConfig::InterPeerTls> Irohad::inter_peer_tls_config_
protected

◆ internal_port_

size_t Irohad::internal_port_
protected

◆ internal_server

std::unique_ptr<iroha::network::ServerRunner> Irohad::internal_server
protected

◆ is_mst_supported_

bool Irohad::is_mst_supported_
protected

◆ keypair

◆ listen_ip_

const std::string Irohad::listen_ip_
protected

◆ loader_init

iroha::network::BlockLoaderInit Irohad::loader_init
protected

◆ log_

logger::LoggerPtr Irohad::log_
protected

log for local messages

◆ log_manager_

logger::LoggerManagerTreePtr Irohad::log_manager_
protected

application root log manager

◆ max_proposal_size_

size_t Irohad::max_proposal_size_
protected

◆ max_rounds_delay_

std::chrono::milliseconds Irohad::max_rounds_delay_
protected

◆ mst_expiration_time_

std::chrono::minutes Irohad::mst_expiration_time_
protected

◆ mst_processor

std::shared_ptr<iroha::MstProcessor> Irohad::mst_processor
protected

◆ mst_transport

std::shared_ptr<iroha::network::MstTransport> Irohad::mst_transport
protected

◆ my_inter_peer_tls_creds_

boost::optional<std::shared_ptr<const iroha::network::TlsCredentials> > Irohad::my_inter_peer_tls_creds_
protected

◆ opt_alternative_peers_

const boost::optional<shared_model::interface::types::PeerList> Irohad::opt_alternative_peers_
protected

◆ opt_mst_gossip_params_

boost::optional<iroha::GossipPropagationStrategyParams> Irohad::opt_mst_gossip_params_
protected

◆ ordering_gate

std::shared_ptr<iroha::network::OrderingGate> Irohad::ordering_gate
protected

◆ ordering_init

iroha::network::OnDemandOrderingInit Irohad::ordering_init
protected

◆ pcs

std::shared_ptr<iroha::network::PeerCommunicationService> Irohad::pcs
protected

◆ peer_tls_certificates_provider_

boost::optional< std::shared_ptr<const iroha::network::PeerTlsCertificatesProvider> > Irohad::peer_tls_certificates_provider_
protected

◆ pending_txs_storage_

std::shared_ptr<iroha::PendingTransactionStorage> Irohad::pending_txs_storage_
protected

◆ pending_txs_storage_init

std::unique_ptr<iroha::PendingTransactionStorageInit> Irohad::pending_txs_storage_init
protected

◆ persistent_cache

std::shared_ptr<iroha::ametsuchi::TxPresenceCache> Irohad::persistent_cache
protected

◆ pool_wrapper_

std::shared_ptr<iroha::ametsuchi::PoolWrapper> Irohad::pool_wrapper_
protected

◆ proposal_delay_

std::chrono::milliseconds Irohad::proposal_delay_
protected

◆ proposal_factory

std::shared_ptr<shared_model::interface::AbstractTransportFactory< shared_model::interface::Proposal, iroha::protocol::Proposal> > Irohad::proposal_factory
protected

◆ proposal_validators_config_

std::shared_ptr<shared_model::validation::ValidatorsConfig> Irohad::proposal_validators_config_
protected

◆ query_factory

std::shared_ptr<shared_model::interface::AbstractTransportFactory< shared_model::interface::Query, iroha::protocol::Query> > Irohad::query_factory
protected

◆ query_response_factory_

std::shared_ptr<shared_model::interface::QueryResponseFactory> Irohad::query_response_factory_
protected

◆ query_service

std::shared_ptr<iroha::torii::QueryService> Irohad::query_service
protected

◆ settings_

std::shared_ptr<const shared_model::validation::Settings> Irohad::settings_
protected

◆ simulator

std::shared_ptr<iroha::simulator::Simulator> Irohad::simulator
protected

◆ stale_stream_max_rounds_

size_t Irohad::stale_stream_max_rounds_
protected

◆ stateful_validator

std::shared_ptr<iroha::validation::StatefulValidator> Irohad::stateful_validator
protected

◆ status_bus_

std::shared_ptr<iroha::torii::StatusBus> Irohad::status_bus_
protected

◆ storage

std::shared_ptr<iroha::ametsuchi::Storage> Irohad::storage

◆ synchronizer

std::shared_ptr<iroha::synchronizer::Synchronizer> Irohad::synchronizer
protected

◆ torii_port_

size_t Irohad::torii_port_
protected

◆ torii_server

std::unique_ptr<iroha::network::ServerRunner> Irohad::torii_server
protected

◆ torii_tls_creds_

boost::optional<std::shared_ptr<const iroha::network::TlsCredentials> > Irohad::torii_tls_creds_
protected

◆ torii_tls_params_

boost::optional<iroha::torii::TlsParams> Irohad::torii_tls_params_
protected

◆ torii_tls_server

boost::optional<std::unique_ptr<iroha::network::ServerRunner> > Irohad::torii_tls_server = boost::none
protected

◆ transaction_batch_factory_

std::shared_ptr<shared_model::interface::TransactionBatchFactory> Irohad::transaction_batch_factory_
protected

◆ transaction_factory

std::shared_ptr<shared_model::interface::AbstractTransportFactory< shared_model::interface::Transaction, iroha::protocol::Transaction> > Irohad::transaction_factory
protected

◆ validators_config_

std::shared_ptr<shared_model::validation::ValidatorsConfig> Irohad::validators_config_
protected

◆ vote_delay_

std::chrono::milliseconds Irohad::vote_delay_
protected

◆ wsv_restorer_

std::shared_ptr<iroha::ametsuchi::WsvRestorer> Irohad::wsv_restorer_
protected

◆ yac_init

std::unique_ptr<iroha::consensus::yac::YacInit> Irohad::yac_init
protected

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