Electroneum
Namespaces | Macros | Functions | Variables
blockchain_import.cpp File Reference
#include <atomic>
#include <cstdio>
#include <algorithm>
#include <fstream>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/chrono.hpp>
#include <unistd.h>
#include <openssl/sha.h>
#include "misc_log_ex.h"
#include "bootstrap_file.h"
#include "bootstrap_serialization.h"
#include "blocks/blocks.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "serialization/binary_utils.h"
#include "serialization/json_utils.h"
#include "include_base_utils.h"
#include "blockchain_db/db_types.h"
#include "cryptonote_core/cryptonote_core.h"
#include "common/dns_utils.h"
Include dependency graph for blockchain_import.cpp:

Namespaces

 anonymous_namespace{blockchain_import.cpp}
 

Macros

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "bcutil"
 

Functions

int get_db_flags_from_mode (const std::string &db_mode)
 
int parse_db_arguments (const std::string &db_arg_str, std::string &db_type, int &db_flags)
 
int pop_blocks (cryptonote::core &core, int num_blocks)
 
int check_flush (cryptonote::core &core, std::vector< block_complete_entry > &blocks, bool force)
 
int import_from_file (cryptonote::core &core, const std::string &import_file_path, uint64_t block_stop=0)
 
void sha256_hash_string (unsigned char hash[SHA256_DIGEST_LENGTH], char outputBuffer[65])
 
void calc_sha256 (const char *path, char output[65])
 
bool validate_file_checksum_against_dns (std::string import_file_path)
 
int main (int argc, char *argv[])
 

Variables

bool anonymous_namespace{blockchain_import.cpp}::opt_batch = true
 
bool anonymous_namespace{blockchain_import.cpp}::opt_verify = true
 
bool anonymous_namespace{blockchain_import.cpp}::opt_resume = true
 
bool anonymous_namespace{blockchain_import.cpp}::opt_testnet = true
 
bool anonymous_namespace{blockchain_import.cpp}::opt_stagenet = true
 
uint64_t anonymous_namespace{blockchain_import.cpp}::db_batch_size = 20000
 
uint64_t anonymous_namespace{blockchain_import.cpp}::db_batch_size_verify = 5000
 
std::string anonymous_namespace{blockchain_import.cpp}::refresh_string = "\r \r"
 

Macro Definition Documentation

◆ ELECTRONEUM_DEFAULT_LOG_CATEGORY

#define ELECTRONEUM_DEFAULT_LOG_CATEGORY   "bcutil"

Function Documentation

◆ calc_sha256()

void calc_sha256 ( const char *  path,
char  output[65] 
)

◆ check_flush()

int check_flush ( cryptonote::core core,
std::vector< block_complete_entry > &  blocks,
bool  force 
)

◆ get_db_flags_from_mode()

int get_db_flags_from_mode ( const std::string &  db_mode)

◆ import_from_file()

int import_from_file ( cryptonote::core core,
const std::string &  import_file_path,
uint64_t  block_stop = 0 
)

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ parse_db_arguments()

int parse_db_arguments ( const std::string &  db_arg_str,
std::string &  db_type,
int &  db_flags 
)

◆ pop_blocks()

int pop_blocks ( cryptonote::core core,
int  num_blocks 
)

◆ sha256_hash_string()

void sha256_hash_string ( unsigned char  hash[SHA256_DIGEST_LENGTH],
char  outputBuffer[65] 
)

◆ validate_file_checksum_against_dns()

bool validate_file_checksum_against_dns ( std::string  import_file_path)