Electroneum
MicroCore.h
Go to the documentation of this file.
1 #ifndef ETN01_MICROCORE_H
2 #define ETN01_MICROCORE_H
3 
4 #include <iostream>
5 
6 #include "electroneum_headers.h"
7 #include "tools.h"
8 
9 namespace etneg
10 {
11  using namespace cryptonote;
12  using namespace crypto;
13  using namespace std;
14 
23  class MicroCore
24  {
26 
29 
30  public:
31  MicroCore();
32 
33  bool init(const string &_blockchain_path, bool testnet = false);
34 
35  Blockchain& get_core();
36 
37  bool get_block_by_height(const uint64_t &height, block &blk);
38 
39  bool get_tx(const crypto::hash &tx_hash, transaction &tx);
40 
41  bool get_tx(const string &tx_hash, transaction &tx);
42 
43  bool find_output_in_tx(const transaction &tx, const public_key &output_pubkey, tx_out &out, size_t &output_index);
44 
45  bool get_tx_hash_from_output_pubkey(const public_key &output_pubkey, const uint64_t &block_height, crypto::hash &tx_hash, transaction &tx_found);
46 
47  uint64_t get_blk_timestamp(uint64_t blk_height);
48 
49  string get_blkchain_path();
50 
51  virtual ~MicroCore();
52  };
53 
54  bool init_blockchain(const string &path, MicroCore *&mcore, Blockchain *&core_storage, bool testnet = false);
55 
56 }
57 
58 #endif
tx_memory_pool m_mempool
Definition: MicroCore.h:27
Definition: cryptonote_basic.h:382
uint64_t height
Definition: blockchain.cpp:87
Definition: db_lmdb.cpp:259
crypto namespace.
Definition: crypto.cpp:47
Definition: block_queue.cpp:41
Definition: MicroCore.h:23
string blockchain_path
Definition: MicroCore.h:25
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
bool init_blockchain(const string &path, MicroCore *&mcore, Blockchain *&core_storage, bool testnet)
Definition: MicroCore.cpp:305
POD_CLASS public_key
Definition: crypto.h:65
Transaction pool, handles transactions which are not part of a block.
Definition: tx_pool.h:93
POD_CLASS hash
Definition: hash.h:46
Blockchain m_blockchain_storage
Definition: MicroCore.h:28
Definition: cryptonote_basic.h:149
Definition: cryptonote_basic.h:198
Definition: MicroCore.cpp:13
Definition: blockchain.h:80