#include <chrono>#include <csignal>#include <fstream>#include <thread>#include <gflags/gflags.h>#include <grpc++/grpc++.h>#include "ametsuchi/storage.hpp"#include "backend/protobuf/common_objects/proto_common_objects_factory.hpp"#include "common/bind.hpp"#include "common/files.hpp"#include "common/irohad_version.hpp"#include "common/result.hpp"#include "crypto/keys_manager_impl.hpp"#include "logger/logger.hpp"#include "logger/logger_manager.hpp"#include "main/application.hpp"#include "main/impl/pg_connection_init.hpp"#include "main/iroha_conf_literals.hpp"#include "main/iroha_conf_loader.hpp"#include "main/raw_block_loader.hpp"#include "util/status_notifier.hpp"#include "util/utility_service.hpp"#include "validators/field_validator.hpp"
Functions | |
| bool | validate_config (const char *flag_name, std::string const &path) |
| bool | validate_keypair_name (const char *flag_name, std::string const &path) |
| DEFINE_string (config, "", "Specify iroha provisioning path.") | |
| DEFINE_validator (config, &validate_config) | |
| DEFINE_string (genesis_block, "", "Specify file with initial block") | |
| DEFINE_string (keypair_name, "", "Specify name of .pub and .priv files") | |
| DEFINE_validator (keypair_name, &validate_keypair_name) | |
| DEFINE_bool (overwrite_ledger, false, "Overwrite ledger data if existing") | |
| DEFINE_bool (reuse_state, false, "Try to reuse existing state data at startup.") | |
| static bool | validateVerbosity (const char *flagname, const std::string &val) |
| DEFINE_string (verbosity, kLogSettingsFromConfigFile, "Log verbosity") | |
| Verbosity flag for spdlog configuration. More... | |
| DEFINE_validator (verbosity, &validateVerbosity) | |
| std::lock_guard< std::mutex > | shutdown_wait_locker (shutdown_wait_mutex) |
| void | initUtilityService (const IrohadConfig::UtilityService &config, iroha::utility_service::UtilityService::ShutdownCallback shutdown_callback, logger::LoggerManagerTreePtr log_manager) |
| logger::LoggerManagerTreePtr | getDefaultLogManager () |
| std::shared_ptr< shared_model::interface::CommonObjectsFactory > | getCommonObjectsFactory () |
| int | main (int argc, char *argv[]) |
Variables | |
| static const std::string | kListenIp = "0.0.0.0" |
| static const std::string | kLogSettingsFromConfigFile = "config_file" |
| static const uint32_t | kMstExpirationTimeDefault = 1440 |
| static const uint32_t | kMaxRoundsDelayDefault = 3000 |
| static const uint32_t | kStaleStreamMaxRoundsDefault = 2 |
| static const std::string | kDefaultWorkingDatabaseName {"iroha_default"} |
| static const std::chrono::milliseconds | kExitCheckPeriod {1000} |
| std::sig_atomic_t | caught_signal = 0 |
| std::promise< void > | exit_requested |
| std::shared_ptr< iroha::utility_service::UtilityService > | utility_service |
| std::unique_ptr< iroha::network::ServerRunner > | utility_server |
| std::mutex | shutdown_wait_mutex |
| std::shared_ptr< iroha::utility_service::StatusNotifier > | daemon_status_notifier |
| DEFINE_bool | ( | overwrite_ledger | , |
| false | , | ||
| "Overwrite ledger data if existing" | |||
| ) |
Creating boolean flag for overwriting already existing block storage

| DEFINE_bool | ( | reuse_state | , |
| false | , | ||
| "Try to reuse existing state data at startup." | |||
| ) |
| DEFINE_string | ( | config | , |
| "" | , | ||
| "Specify iroha provisioning path." | |||
| ) |
Creating input argument for the configuration file location.

| DEFINE_string | ( | genesis_block | , |
| "" | , | ||
| "Specify file with initial block" | |||
| ) |
Creating input argument for the genesis block file location.
| DEFINE_string | ( | keypair_name | , |
| "" | , | ||
| "Specify name of .pub and .priv files" | |||
| ) |
Creating input argument for the keypair files location.
| DEFINE_string | ( | verbosity | , |
| kLogSettingsFromConfigFile | , | ||
| "Log verbosity" | |||
| ) |
Verbosity flag for spdlog configuration.
| DEFINE_validator | ( | config | , |
| & | validate_config | ||
| ) |
Registering validator for the configuration file location.

| DEFINE_validator | ( | keypair_name | , |
| & | validate_keypair_name | ||
| ) |
Registering validator for the keypair files location.
| DEFINE_validator | ( | verbosity | , |
| & | validateVerbosity | ||
| ) |
| std::shared_ptr<shared_model::interface::CommonObjectsFactory> getCommonObjectsFactory | ( | ) |

| logger::LoggerManagerTreePtr getDefaultLogManager | ( | ) |


| void initUtilityService | ( | const IrohadConfig::UtilityService & | config, |
| iroha::utility_service::UtilityService::ShutdownCallback | shutdown_callback, | ||
| logger::LoggerManagerTreePtr | log_manager | ||
| ) |

| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
if there are any blocks in blockstore, then true
genesis block file is specified as launch parameter
overwrite ledger flag was set as launch parameter

| std::lock_guard<std::mutex> shutdown_wait_locker | ( | shutdown_wait_mutex | ) |
| bool validate_config | ( | const char * | flag_name, |
| std::string const & | path | ||
| ) |
Gflag validator. Validator for the configuration file path input argument. Path is considered to be valid if it is not empty.
| flag_name | - flag name. Must be 'config' in this case |
| path | - file name. Should be path to the config file |

| bool validate_keypair_name | ( | const char * | flag_name, |
| std::string const & | path | ||
| ) |
Gflag validator. Validator for the keypair files path input argument. Path is considered to be valid if it is not empty.
| flag_name | - flag name. Must be 'keypair_name' in this case |
| path | - file name. Should be path to the keypair files |

|
static |

| std::sig_atomic_t caught_signal = 0 |
| std::shared_ptr<iroha::utility_service::StatusNotifier> daemon_status_notifier |
| std::promise<void> exit_requested |
|
static |
|
static |
|
static |
Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
|
static |
|
static |
|
static |
|
static |
| std::mutex shutdown_wait_mutex |
| std::unique_ptr<iroha::network::ServerRunner> utility_server |
| std::shared_ptr<iroha::utility_service::UtilityService> utility_service |