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...
 
optional< signed_block > graphene::app::database_api::get_block (uint32_t block_num) const
 Retrieve a full, signed block. 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< signed_transaction > graphene::app::database_api::get_recent_transaction_by_id (const transaction_id_type &id) const
 If the transaction has not expired, this method will return the transaction for the given ID 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...
 
optional< signed_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...
 

Detailed Description

Function Documentation

optional< signed_block > 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 392 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 379 of file database_api.cpp.

optional< signed_transaction > graphene::app::database_api::get_recent_transaction_by_id ( const transaction_id_type id) const

If the transaction has not expired, this method will return the transaction for the given ID 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.

Parameters
idID of the transaction to retrieve

Definition at line 412 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

Definition at line 402 of file database_api.cpp.

optional< signed_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

Definition at line 434 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 452 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 407 of file database_api.cpp.