onion-wownero-blockchain-ex.../src/MicroCore.h

94 lines
1.8 KiB
C
Raw Permalink Normal View History

2016-04-06 06:53:37 +00:00
//
// Created by mwo on 5/11/15.
//
#ifndef XMREG01_MICROCORE_H
#define XMREG01_MICROCORE_H
#include <iostream>
#include "monero_headers.h"
#include "tools.h"
2016-04-06 06:53:37 +00:00
namespace xmreg
{
using namespace cryptonote;
using namespace crypto;
using namespace std;
/**
* Micro version of cryptonode::core class
* Micro version of constructor,
* init and destructor are implemted.
*
* Just enough to read the blockchain
* database for use in the example.
*/
class MicroCore {
2016-05-01 02:02:37 +00:00
string blockchain_path;
2016-04-06 06:53:37 +00:00
tx_memory_pool m_mempool;
Blockchain m_blockchain_storage;
hw::device* m_device;
network_type nettype;
2016-04-06 06:53:37 +00:00
public:
MicroCore();
bool
init(const string& _blockchain_path, network_type nt);
2016-04-06 06:53:37 +00:00
Blockchain&
get_core();
2018-08-07 03:53:25 +00:00
tx_memory_pool&
get_mempool();
2016-04-06 06:53:37 +00:00
bool
get_block_by_height(const uint64_t& height, block& blk);
bool
get_tx(const crypto::hash& tx_hash, transaction& tx);
2016-04-30 01:35:48 +00:00
bool
get_tx(const string& tx_hash, transaction& tx);
2016-04-06 06:53:37 +00:00
bool
find_output_in_tx(const transaction& tx,
const public_key& output_pubkey,
tx_out& out,
size_t& output_index);
uint64_t
get_blk_timestamp(uint64_t blk_height);
2018-08-07 03:53:25 +00:00
bool
get_block_complete_entry(block const& b, block_complete_entry& bce);
2016-05-01 02:02:37 +00:00
string
get_blkchain_path();
hw::device* const
get_device() const;
2016-04-06 06:53:37 +00:00
virtual ~MicroCore();
};
2016-04-07 05:41:15 +00:00
bool
init_blockchain(const string& path,
MicroCore& mcore,
Blockchain*& core_storage,
network_type nt);
2016-04-07 05:41:15 +00:00
2016-04-06 06:53:37 +00:00
}
#endif //XMREG01_MICROCORE_H