hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
irohad.cpp File Reference
#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/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/iroha_conf_literals.hpp"
#include "main/iroha_conf_loader.hpp"
#include "main/raw_block_loader.hpp"
#include "validators/field_validator.hpp"
Include dependency graph for irohad.cpp:

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")
 
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)
 
logger::LoggerManagerTreePtr getDefaultLogManager ()
 
std::shared_ptr< shared_model::interface::CommonObjectsFactorygetCommonObjectsFactory ()
 
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
 
std::promise< void > exit_requested
 

Function Documentation

DEFINE_bool ( overwrite_ledger  ,
false  ,
"Overwrite ledger data if existing"   
)

Creating boolean flag for overwriting already existing block storage

Here is the caller graph for this function:

DEFINE_string ( config  ,
""  ,
"Specify iroha provisioning path."   
)

Creating input argument for the configuration file location.

Here is the caller graph for this function:

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.

Here is the caller graph for this function:

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 ( )

Here is the caller graph for this function:

logger::LoggerManagerTreePtr getDefaultLogManager ( )

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the call graph for this function:

Here is the caller graph for this function:

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.

Parameters
flag_name- flag name. Must be 'config' in this case
path- file name. Should be path to the config file
Returns
true if argument is valid

Here is the caller graph for this function:

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.

Parameters
flag_name- flag name. Must be 'keypair_name' in this case
path- file name. Should be path to the keypair files
Returns
true if argument is valid

Here is the call graph for this function:

static bool validateVerbosity ( const char *  flagname,
const std::string &  val 
)
static

Here is the call graph for this function:

Variable Documentation

std::promise<void> exit_requested
const std::string kListenIp = "0.0.0.0"
static

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

const std::string kLogSettingsFromConfigFile = "config_file"
static
const uint32_t kMaxRoundsDelayDefault = 3000
static
const uint32_t kMstExpirationTimeDefault = 1440
static
const uint32_t kStaleStreamMaxRoundsDefault = 2
static