DECENT
Functions
Blocks and Transactions

Functions

optional< block_header > graphene::app::database_api::get_block_header (uint32_t block_num) const
 Retrieve a block header. More...
 
vector< optional< block_header > > graphene::app::database_api::get_block_headers (uint32_t block_num, uint32_t count) const
 Retrieve a list of block headers. More...
 
optional< signed_block_with_info > graphene::app::database_api::get_block (uint32_t block_num) const
 Retrieve a full, signed block. More...
 
vector< optional< signed_block_with_info > > graphene::app::database_api::get_blocks (uint32_t block_num, uint32_t count) const
 Retrieve a list of full, signed blocks. More...
 
processed_transaction graphene::app::database_api::get_transaction (uint32_t block_num, uint32_t trx_in_block) const
 Used to fetch an individual transaction. More...
 
fc::time_point_sec graphene::app::database_api::head_block_time () const
 Query the last local block. More...
 
optional< processed_transaction > graphene::app::database_api::get_transaction_by_id (const transaction_id_type &id) const
 This method will return the transaction for the given ID (transaction hash) or it will return null if it is not known. Just because it is not known does not mean it wasn't included in the blockchain. More...
 
transaction_id_type graphene::app::database_api::get_transaction_id (const signed_transaction &trx) const
 This method is used to convert a JSON transaction to its transaction ID. More...
 
vector< proposal_object > graphene::app::database_api::get_proposed_transactions (account_id_type id) const
 Get the set of proposed transactions relevant to the specified account id. More...
 

Detailed Description

Function Documentation

optional< signed_block_with_info > graphene::app::database_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 343 of file database_api.cpp.

optional< block_header > graphene::app::database_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 315 of file database_api.cpp.

vector< optional< block_header > > graphene::app::database_api::get_block_headers ( uint32_t  block_num,
uint32_t  count 
) const

Retrieve a list of block headers.

Parameters
block_numheight of the first block whose header should be returned
countnumber of block headers to return
Returns
headers of the referenced blocks

Definition at line 328 of file database_api.cpp.

vector< optional< signed_block_with_info > > graphene::app::database_api::get_blocks ( uint32_t  block_num,
uint32_t  count 
) const

Retrieve a list of full, signed blocks.

Parameters
block_numheight of the first block to be returned
countnumber of blocks to return
Returns
the referenced blocks

Definition at line 357 of file database_api.cpp.

vector< proposal_object > graphene::app::database_api::get_proposed_transactions ( account_id_type  id) const

Get the set of proposed transactions relevant to the specified account id.

Parameters
idthe account ID
Returns
a set of proposed transactions

Definition at line 1713 of file database_api.cpp.

processed_transaction graphene::app::database_api::get_transaction ( uint32_t  block_num,
uint32_t  trx_in_block 
) const

Used to fetch an individual transaction.

Parameters
block_numid of the block
trx_in_blockspecifies the position of the transaction within the block
Returns
the transaction
Exceptions
block_not_found_exception,block_does_not_contain_requested_trx_exception

Definition at line 383 of file database_api.cpp.

optional< processed_transaction > graphene::app::database_api::get_transaction_by_id ( const transaction_id_type id) const

This method will return the transaction for the given ID (transaction hash) or it will return null if it is not known. Just because it is not known does not mean it wasn't included in the blockchain.

Note
By default these objects are not tracked, the transaction_history_plugin must be loaded for these objects to be maintained.
Parameters
idID of the transaction to retrieve
Exceptions
block_not_found_exception,block_does_not_contain_requested_trx_exception

Definition at line 408 of file database_api.cpp.

transaction_id_type graphene::app::database_api::get_transaction_id ( const signed_transaction trx) const

This method is used to convert a JSON transaction to its transaction ID.

Parameters
trxSigned transaction
Returns
The transaction ID

Definition at line 425 of file database_api.cpp.

fc::time_point_sec graphene::app::database_api::head_block_time ( ) const

Query the last local block.

Returns
the block time

Definition at line 388 of file database_api.cpp.