#include <ledger_enclave.h>
|
static std::vector< uint8_t > | get_entry (const uint8_t *&data, size_t &size) |
|
static void | skip_entry (const uint8_t *&data, size_t &size) |
|
|
static constexpr size_t | FRAME_SIZE = sizeof(uint32_t) |
|
◆ LedgerEnclave()
◆ commit()
void consensus::LedgerEnclave::commit |
( |
Index |
idx | ) |
|
|
inline |
Commit the ledger at a given index.
- Parameters
-
◆ get_entry()
static std::vector< uint8_t > consensus::LedgerEnclave::get_entry |
( |
const uint8_t *& |
data, |
|
|
size_t & |
size |
|
) |
| |
|
inlinestatic |
Retrieve a single entry, advancing offset to the next entry.
- Parameters
-
data | Serialised entries |
size | Size of overall serialised entries |
- Returns
- Raw entry as a vector
◆ init()
void consensus::LedgerEnclave::init |
( |
Index |
idx = 0 , |
|
|
Index |
recovery_start_idx = 0 |
|
) |
| |
|
inline |
Initialise ledger at a given index (e.g. after a snapshot)
- Parameters
-
idx | Index to start ledger from |
recovery_start_idx | Index at which the recovery starts |
◆ put_entry() [1/2]
void consensus::LedgerEnclave::put_entry |
( |
const std::vector< uint8_t > & |
entry, |
|
|
bool |
globally_committable, |
|
|
ccf::kv::Term |
term, |
|
|
ccf::kv::Version |
index |
|
) |
| |
|
inline |
Put a single entry to be written to the ledger, when primary.
- Parameters
-
entry | Serialised entry |
globally_committable | True if entry is signature transaction |
term | Consensus term of entry |
index | Index (seqno) of entry |
◆ put_entry() [2/2]
void consensus::LedgerEnclave::put_entry |
( |
const uint8_t * |
data, |
|
|
size_t |
size, |
|
|
bool |
globally_committable, |
|
|
ccf::kv::Term |
term, |
|
|
ccf::kv::Version |
index |
|
) |
| |
|
inline |
Put a single entry to be written the ledger, when primary.
- Parameters
-
data | Serialised entry start |
size | Serialised entry size |
globally_committable | True if entry is signature transaction |
term | Consensus term of entry |
index | Index (seqno) of entry |
Note: The entry should already contain its own header.
◆ skip_entry()
static void consensus::LedgerEnclave::skip_entry |
( |
const uint8_t *& |
data, |
|
|
size_t & |
size |
|
) |
| |
|
inlinestatic |
Skip a single entry, when backup.
Does not write any entry to the legder.
- Parameters
-
data | Serialised entries |
size | Size of overall serialised entries |
◆ truncate()
void consensus::LedgerEnclave::truncate |
( |
Index |
idx | ) |
|
|
inline |
Truncate the ledger at a given index.
- Parameters
-
idx | Index to truncate from |
◆ FRAME_SIZE
constexpr size_t consensus::LedgerEnclave::FRAME_SIZE = sizeof(uint32_t) |
|
staticconstexpr |
The documentation for this class was generated from the following file: