hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha_conf_loader.cpp File Reference
#include "main/iroha_conf_loader.hpp"
#include <fstream>
#include <limits>
#include <sstream>
#include <rapidjson/document.h>
#include <rapidjson/error/en.h>
#include <rapidjson/istreamwrapper.h>
#include <rapidjson/rapidjson.h>
#include <boost/algorithm/string/join.hpp>
#include <boost/range/adaptor/map.hpp>
#include "cryptography/public_key.hpp"
#include "main/iroha_conf_literals.hpp"
Include dependency graph for iroha_conf_loader.cpp:

Classes

class  JsonDeserializerImpl
 

Functions

template<>
void JsonDeserializerImpl::getVal< std::string > (const std::string &path, std::string &dest, const rapidjson::Value &src)
 
template<>
void JsonDeserializerImpl::getVal< logger::LogLevel > (const std::string &path, logger::LogLevel &dest, const rapidjson::Value &src)
 
template<>
void JsonDeserializerImpl::getVal< logger::LogPatterns > (const std::string &path, logger::LogPatterns &dest, const rapidjson::Value &src)
 
template<>
void JsonDeserializerImpl::getVal< std::unique_ptr< logger::LoggerManagerTree > > (const std::string &path, std::unique_ptr< logger::LoggerManagerTree > &dest, const rapidjson::Value &src)
 
template<>
void JsonDeserializerImpl::getVal< std::unique_ptr< shared_model::interface::Peer > > (const std::string &path, std::unique_ptr< shared_model::interface::Peer > &dest, const rapidjson::Value &src)
 
template<>
void JsonDeserializerImpl::getVal< IrohadConfig::DbConfig > (const std::string &path, IrohadConfig::DbConfig &dest, const rapidjson::Value &src)
 
std::string reportJsonParsingError (const rapidjson::Document &doc, const std::string &conf_path, std::istream &input)
 
IrohadConfig parse_iroha_config (const std::string &conf_path, std::shared_ptr< shared_model::interface::CommonObjectsFactory > common_objects_factory)
 

Variables

static constexpr size_t kBadJsonPrintLength = 15
 
static constexpr size_t kBadJsonPrintOffsset = 5
 The offset of printed chunk towards file start from the error position. More...
 

Function Documentation

template<>
void JsonDeserializerImpl::getVal< IrohadConfig::DbConfig > ( const std::string &  path,
IrohadConfig::DbConfig dest,
const rapidjson::Value &  src 
)
inline
template<>
void JsonDeserializerImpl::getVal< logger::LogLevel > ( const std::string &  path,
logger::LogLevel dest,
const rapidjson::Value &  src 
)
inline
template<>
void JsonDeserializerImpl::getVal< logger::LogPatterns > ( const std::string &  path,
logger::LogPatterns dest,
const rapidjson::Value &  src 
)
inline
template<>
void JsonDeserializerImpl::getVal< std::string > ( const std::string &  path,
std::string &  dest,
const rapidjson::Value &  src 
)
inline
template<>
void JsonDeserializerImpl::getVal< std::unique_ptr< logger::LoggerManagerTree > > ( const std::string &  path,
std::unique_ptr< logger::LoggerManagerTree > &  dest,
const rapidjson::Value &  src 
)
inline
template<>
void JsonDeserializerImpl::getVal< std::unique_ptr< shared_model::interface::Peer > > ( const std::string &  path,
std::unique_ptr< shared_model::interface::Peer > &  dest,
const rapidjson::Value &  src 
)
inline

Here is the call graph for this function:

IrohadConfig parse_iroha_config ( const std::string &  conf_path,
std::shared_ptr< shared_model::interface::CommonObjectsFactory common_objects_factory 
)

parse and assert trusted peers json in iroha.conf

Parameters
conf_pathis a path to iroha's config
Returns
a parsed equivalent of that file

Here is the call graph for this function:

Here is the caller graph for this function:

std::string reportJsonParsingError ( const rapidjson::Document &  doc,
const std::string &  conf_path,
std::istream &  input 
)

Here is the caller graph for this function:

Variable Documentation

constexpr size_t kBadJsonPrintLength = 15
static

Copyright Soramitsu Co., Ltd. All Rights Reserved. SPDX-License-Identifier: Apache-2.0The length of the string around the error place to print in case of JSON syntax error.

constexpr size_t kBadJsonPrintOffsset = 5
static

The offset of printed chunk towards file start from the error position.