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 IrohadConfig &config, std::unique_ptr< iroha::ametsuchi::PostgresOptions > pg_opt, const std::string &listen_ip, const boost::optional< shared_model::crypto::Keypair > &keypair, logger::LoggerManagerTreePtr logger_manager, iroha::StartupWsvDataPolicy startup_wsv_data_policy, iroha::StartupWsvSynchronizationPolicy startup_wsv_sync_policy, std::shared_ptr< const iroha::network::GrpcChannelParams > grpc_channel_params, const boost::optional< iroha::GossipPropagationStrategyParams > &opt_mst_gossip_params, boost::optional< IrohadConfig::InterPeerTls > inter_peer_tls_config=boost::none)
 
virtual RunResult init ()
 
RunResult restoreWsv ()
 
RunResult validateKeypair ()
 
virtual RunResult dropStorage ()
 
RunResult resetWsv ()
 
RunResult run ()
 
virtual ~Irohad ()
 

Public Attributes

std::unique_ptr< iroha::ametsuchi::PostgresOptionspg_opt_
 
std::shared_ptr< iroha::ametsuchi::Storagestorage
 

Protected Member Functions

virtual RunResult initStorage (iroha::StartupWsvDataPolicy startup_wsv_data_policy)
 
RunResult initTlsCredentials ()
 
RunResult initPeerCertProvider ()
 
RunResult initClientFactory ()
 
virtual RunResult initCryptoProvider ()
 
virtual RunResult initBatchParser ()
 
virtual RunResult initValidators ()
 
virtual RunResult initNetworkClient ()
 
virtual RunResult initFactories ()
 
virtual RunResult initPersistentCache ()
 
virtual RunResult initPendingTxsStorageWithCache ()
 
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

IrohadConfig config_
 
const std::string listen_ip_
 
boost::optional< shared_model::crypto::Keypairkeypair_
 
iroha::StartupWsvSynchronizationPolicy startup_wsv_sync_policy_
 
std::shared_ptr< const iroha::network::GrpcChannelParamsgrpc_channel_params_
 
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_
 
std::optional< std::unique_ptr< iroha::ametsuchi::VmCaller > > vm_caller_
 
rxcpp::observable< shared_model::interface::types::HashTypefinalized_txs_
 
iroha::ordering::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< iroha::network::GenericClientFactoryinter_peer_client_factory_
 
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 IrohadConfig config,
std::unique_ptr< iroha::ametsuchi::PostgresOptions pg_opt,
const std::string &  listen_ip,
const boost::optional< shared_model::crypto::Keypair > &  keypair,
logger::LoggerManagerTreePtr  logger_manager,
iroha::StartupWsvDataPolicy  startup_wsv_data_policy,
iroha::StartupWsvSynchronizationPolicy  startup_wsv_sync_policy,
std::shared_ptr< const iroha::network::GrpcChannelParams grpc_channel_params,
const boost::optional< iroha::GossipPropagationStrategyParams > &  opt_mst_gossip_params,
boost::optional< IrohadConfig::InterPeerTls inter_peer_tls_config = boost::none 
)

Constructor that initializes common iroha pipeline

Parameters
pg_opt- connection options for PostgresSQL
listen_ip- ip address for opening ports (internal & torii) not considered as expired (in minutes)
keypair- public and private keys for crypto signer
logger_manager- the logger manager to use
startup_wsv_data_policy-
See also
StartupWsvDataPolicy
Parameters
grpc_channel_params- parameters for all grpc clients
opt_mst_gossip_params- parameters for Gossip MST propagation (optional). If not provided, disables mst processing support
See also
iroha::torii::TlsParams
Parameters
inter_peer_tls_config- set up TLS in peer-to-peer communication TODO mboldyrev 03.11.2018 IR-1844 Refactor the constructor.

Configuring iroha daemon

Here is the call graph for this function:

◆ ~Irohad()

Irohad::~Irohad ( )
virtual

Member Function Documentation

◆ dropStorage()

Irohad::RunResult Irohad::dropStorage ( )
virtual

Drop wsv and block store

Here is the call graph for this function:

◆ 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:

◆ initClientFactory()

Irohad::RunResult Irohad::initClientFactory ( )
protected

Initializing channel pool.

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 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:

◆ initPendingTxsStorageWithCache()

Irohad::RunResult Irohad::initPendingTxsStorageWithCache ( )
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 ( iroha::StartupWsvDataPolicy  startup_wsv_data_policy)
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:

◆ resetWsv()

Irohad::RunResult Irohad::resetWsv ( )
Here is the call graph for this function:
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 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_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

◆ config_

IrohadConfig Irohad::config_
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

◆ finalized_txs_

rxcpp::observable<shared_model::interface::types::HashType> Irohad::finalized_txs_
protected

◆ grpc_channel_params_

std::shared_ptr<const iroha::network::GrpcChannelParams> Irohad::grpc_channel_params_
protected

◆ inter_peer_client_factory_

std::shared_ptr<iroha::network::GenericClientFactory> Irohad::inter_peer_client_factory_
protected

◆ inter_peer_tls_config_

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

◆ internal_server

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

◆ keypair_

boost::optional<shared_model::crypto::Keypair> Irohad::keypair_
protected

◆ 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

◆ 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_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::ordering::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

◆ pg_opt_

std::unique_ptr<iroha::ametsuchi::PostgresOptions> Irohad::pg_opt_

◆ pool_wrapper_

std::shared_ptr<iroha::ametsuchi::PoolWrapper> Irohad::pool_wrapper_
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

◆ startup_wsv_sync_policy_

iroha::StartupWsvSynchronizationPolicy Irohad::startup_wsv_sync_policy_
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_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_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

◆ vm_caller_

std::optional<std::unique_ptr<iroha::ametsuchi::VmCaller> > Irohad::vm_caller_
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: