54 available_dbs =
"available: " + available_dbs;
58 bool blocks_dat =
false;
62 boost::filesystem::path output_file_path;
64 po::options_description desc_cmd_only(
"Command line options");
65 po::options_description desc_cmd_sett(
"Command line options and settings options");
70 "database", available_dbs.c_str(), default_db_type
86 po::options_description desc_options(
"Allowed options");
87 desc_options.add(desc_cmd_only).add(desc_cmd_sett);
102 std::cout << desc_options << std::endl;
117 if (opt_testnet && opt_stagenet)
119 std::cerr <<
"Can't specify more than one of --testnet and --stagenet" << std::endl;
131 std::cerr <<
"Invalid database type: " << db_type << std::endl;
138 output_file_path = boost::filesystem::path(m_config_folder) /
"export" /
BLOCKCHAIN_RAW;
139 LOG_PRINT_L0(
"Export output file: " << output_file_path.string());
152 LOG_PRINT_L0(
"Initializing source blockchain (BlockchainDB)");
160 LOG_ERROR(
"Attempted to use non-existent database type: " << db_type);
161 throw std::runtime_error(
"Attempting to use non-existent database type");
165 boost::filesystem::path folder(m_config_folder);
169 LOG_PRINT_L0(
"Loading blockchain from folder " << filename <<
" ...");
174 catch (
const std::exception& e)
188 LOG_PRINT_L0(
"Source blockchain storage initialized OK");
const char *const ELECTRONEUM_RELEASE_NAME
virtual std::string get_db_name() const =0
gets the name of the folder the BlockchainDB's file(s) should be in
bool store_blockchain_raw(cryptonote::Blockchain *cs, cryptonote::tx_memory_pool *txp, boost::filesystem::path &output_file, uint64_t use_block_height=0)
#define CHECK_AND_ASSERT_MES(expr, fail_ret_val, message)
void mlog_set_log(const char *log)
#define CATCH_ENTRY(location, return_val)
std::string mlog_get_default_log_path(const char *default_filename)
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size=MAX_LOG_FILE_SIZE, const std::size_t max_log_files=MAX_LOG_FILES)
const command_line::arg_descriptor< bool, false > arg_stagenet_on
const arg_descriptor< bool > arg_help
std::string blockchain_db_types(const std::string &sep)
virtual void open(const std::string &filename, const int db_flags=0)=0
open a db, or create it if necessary.
const char *const ELECTRONEUM_VERSION_FULL
bool blockchain_valid_db_type(const std::string &db_type)
const command_line::arg_descriptor< bool, false > arg_testnet_on
BlockchainDB * new_db(const std::string &db_type)
bool handle_error_helper(const boost::program_options::options_description &desc, F parser)
std::enable_if<!std::is_same< T, bool >::value, bool >::type has_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg)
const command_line::arg_descriptor< std::string > arg_log_level
unsigned __int64 uint64_t
const command_line::arg_descriptor< std::string, false, true, 2 > arg_data_dir
void add_arg(boost::program_options::options_description &description, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg, bool unique=true)
Transaction pool, handles transactions which are not part of a block.
uint32_t get_blockchain_pruning_seed() const
bool store_blockchain_raw(cryptonote::Blockchain *cs, cryptonote::tx_memory_pool *txp, boost::filesystem::path &output_file, uint64_t use_block_height=0)
The BlockchainDB backing store interface declaration/contract.
T get_arg(const boost::program_options::variables_map &vm, const arg_descriptor< T, false, true > &arg)
boost::program_options::basic_parsed_options< charT > parse_command_line(int argc, const charT *const argv[], const boost::program_options::options_description &desc, bool allow_unregistered=false)
bool init(BlockchainDB *db, const network_type nettype=MAINNET, bool offline=false, const cryptonote::test_options *test_options=NULL, difficulty_type fixed_difficulty=0, const GetCheckpointsCallback &get_checkpoints=nullptr, bool ignore_bsig=false, bool fallback_to_pow=false)
Initialize the Blockchain state.
std::string to_string(t_connection_type type)
bool is_arg_defaulted(const boost::program_options::variables_map &vm, const arg_descriptor< T, required, dependent, NUM_DEPS > &arg)