Scorum
Blockchain history API

Provide set of getters to retrive information about blocks, transactions and operations. More...

Public API

std::map< uint32_t, applied_operationscorum::blockchain_history::blockchain_history_api::get_ops_history (uint32_t from_op, uint32_t limit, applied_operation_type type_of_operation) const
 This method returns all operations in ids range [from-limit, from]. More...
 
std::map< uint32_t, applied_operationscorum::blockchain_history::blockchain_history_api::get_ops_history_by_time (const fc::time_point_sec &from, const fc::time_point_sec &to, uint32_t from_op, uint32_t limit) const
 This method returns all operations in timestamp range [from, to]. More...
 
std::map< uint32_t, applied_operationscorum::blockchain_history::blockchain_history_api::get_ops_in_block (uint32_t block_num, applied_operation_type type_of_operation) const
 Returns sequence of operations included/generated in a specified block. More...
 
annotated_signed_transaction scorum::blockchain_history::blockchain_history_api::get_transaction (transaction_id_type trx_id) const
 This method returns signed transaction by transaction id. More...
 
optional< block_headerscorum::blockchain_history::blockchain_history_api::get_block_header (uint32_t block_num) const
 Retrieve a block header. More...
 
std::map< uint32_t, block_headerscorum::blockchain_history::blockchain_history_api::get_block_headers_history (uint32_t block_num, uint32_t limit) const
 Retrieve the list of block headers in range [from-limit, from]. More...
 
optional< signed_block_api_objscorum::blockchain_history::blockchain_history_api::get_block (uint32_t block_num) const
 Retrieve a full, signed block. More...
 
std::map< uint32_t, signed_block_api_objscorum::blockchain_history::blockchain_history_api::get_blocks_history (uint32_t block_num, uint32_t limit) const
 Retrieve the list of signed block from block log (irreversible blocks) in range [from-limit, from]. More...
 
std::vector< block_api_objectscorum::blockchain_history::blockchain_history_api::get_blocks (uint32_t from, uint32_t limit) const
 Retrieve the list of blocks from block log in range [from-limit, from]. More...
 

Detailed Description

Provide set of getters to retrive information about blocks, transactions and operations.

Require: blockchain_history_plugin

Function Documentation

◆ get_block()

optional< signed_block_api_obj > scorum::blockchain_history::blockchain_history_api::get_block ( uint32_t  block_num) const

Retrieve a full, signed block.

Parameters
block_numHeight of the block to be returned
Returns
the referenced block, or null if no matching block was found

Definition at line 352 of file blockchain_history_api.cpp.

◆ get_block_header()

optional< block_header > scorum::blockchain_history::blockchain_history_api::get_block_header ( uint32_t  block_num) const

Retrieve a block header.

Parameters
block_numHeight of the block whose header should be returned
Returns
header of the referenced block, or null if no matching block was found

Definition at line 347 of file blockchain_history_api.cpp.

◆ get_block_headers_history()

std::map< uint32_t, block_header > scorum::blockchain_history::blockchain_history_api::get_block_headers_history ( uint32_t  block_num,
uint32_t  limit 
) const

Retrieve the list of block headers in range [from-limit, from].

Parameters
block_numHeight of the block to be returned
limitthe maximum number of blocks that can be queried (0 to 100], must be less than from
Returns
the list of block headers

Definition at line 357 of file blockchain_history_api.cpp.

◆ get_blocks()

std::vector< block_api_object > scorum::blockchain_history::blockchain_history_api::get_blocks ( uint32_t  from,
uint32_t  limit 
) const

Retrieve the list of blocks from block log in range [from-limit, from].

Parameters
fromHeight of the block to be returned
limitthe maximum number of blocks that can be queried (0 to 100], must be less than from
Returns
the list of signed blocks

Definition at line 373 of file blockchain_history_api.cpp.

◆ get_blocks_history()

std::map< uint32_t, signed_block_api_obj > scorum::blockchain_history::blockchain_history_api::get_blocks_history ( uint32_t  block_num,
uint32_t  limit 
) const

Retrieve the list of signed block from block log (irreversible blocks) in range [from-limit, from].

Parameters
block_numHeight of the block to be returned
limitthe maximum number of blocks that can be queried (0 to 100], must be less than from
Returns
the list of signed blocks

Definition at line 365 of file blockchain_history_api.cpp.

◆ get_ops_history()

std::map< uint32_t, applied_operation > scorum::blockchain_history::blockchain_history_api::get_ops_history ( uint32_t  from_op,
uint32_t  limit,
applied_operation_type  type_of_operation 
) const

This method returns all operations in ids range [from-limit, from].

Parameters
from_op- the operation number, -1 means most recent, limit is the number of operations before from.
limit- the maximum number of items that can be queried (0 to 100], must be less than from
type_of_operationOperations type (all = 0, not_virt = 1, virt = 2, market = 3)

Definition at line 291 of file blockchain_history_api.cpp.

◆ get_ops_history_by_time()

std::map< uint32_t, applied_operation > scorum::blockchain_history::blockchain_history_api::get_ops_history_by_time ( const fc::time_point_sec &  from,
const fc::time_point_sec &  to,
uint32_t  from_op,
uint32_t  limit 
) const

This method returns all operations in timestamp range [from, to].

Parameters
from- the time from start searching operations
to- the time until end searching operations
from_op- the operation number, -1 means most recent, limit is the number of operations before from.
limit- the maximum number of items that can be queried (0 to 100], must be less than from

Definition at line 310 of file blockchain_history_api.cpp.

◆ get_ops_in_block()

std::map< uint32_t, applied_operation > scorum::blockchain_history::blockchain_history_api::get_ops_in_block ( uint32_t  block_num,
applied_operation_type  type_of_operation 
) const

Returns sequence of operations included/generated in a specified block.

Parameters
block_numBlock height of specified block
type_of_operationOperations type (all = 0, not_virt = 1, virt = 2, market = 3)

Definition at line 320 of file blockchain_history_api.cpp.

◆ get_transaction()

annotated_signed_transaction scorum::blockchain_history::blockchain_history_api::get_transaction ( transaction_id_type  trx_id) const

This method returns signed transaction by transaction id.

Parameters
trx_idtransaction id
Returns
annotated signed transaction

Definition at line 338 of file blockchain_history_api.cpp.