Scorum
Functions
Witnesses

Witnesses. More...

Functions

std::vector< optional< witness_api_obj > > scorum::app::database_api::get_witnesses (const std::vector< witness_id_type > &witness_ids) const
 Get a list of witnesses by ID. More...
 
fc::optional< witness_api_objscorum::app::database_api::get_witness_by_account (const std::string &account_name) const
 Get the witness owned by a given account. More...
 
std::vector< witness_api_objscorum::app::database_api::get_witnesses_by_vote (const std::string &from, uint32_t limit) const
 
std::set< account_name_typescorum::app::database_api::lookup_witness_accounts (const std::string &lower_bound_name, uint32_t limit) const
 Get names and IDs for registered witnesses. More...
 
std::vector< account_name_typescorum::app::database_api::get_active_witnesses () const
 
uint64_t scorum::app::database_api::get_witness_count () const
 Get the total number of witnesses registered with the blockchain. More...
 

Detailed Description

Witnesses.

Function Documentation

◆ get_active_witnesses()

std::vector< account_name_type > scorum::app::database_api::get_active_witnesses ( ) const

Definition at line 1014 of file database_api.cpp.

◆ get_witness_by_account()

fc::optional< witness_api_obj > scorum::app::database_api::get_witness_by_account ( const std::string &  account_name) const

Get the witness owned by a given account.

Parameters
accountThe name of the account whose witness should be retrieved
Returns
The witness object, or null if the account does not have a witness

Definition at line 591 of file database_api.cpp.

◆ get_witness_count()

uint64_t scorum::app::database_api::get_witness_count ( ) const

Get the total number of witnesses registered with the blockchain.

Definition at line 661 of file database_api.cpp.

◆ get_witnesses()

std::vector< optional< witness_api_obj > > scorum::app::database_api::get_witnesses ( const std::vector< witness_id_type > &  witness_ids) const

Get a list of witnesses by ID.

Parameters
witness_idsIDs of the witnesses to retrieve
Returns
The witnesses corresponding to the provided IDs

This function has semantics identical to get_objects

Definition at line 572 of file database_api.cpp.

◆ get_witnesses_by_vote()

std::vector< witness_api_obj > scorum::app::database_api::get_witnesses_by_vote ( const std::string &  from,
uint32_t  limit 
) const

This method is used to fetch witnesses with pagination.

Returns
an array of count witnesses sorted by total votes after witness from with at most ‘limit’ results.

Definition at line 596 of file database_api.cpp.

◆ lookup_witness_accounts()

std::set< account_name_type > scorum::app::database_api::lookup_witness_accounts ( const std::string &  lower_bound_name,
uint32_t  limit 
) const

Get names and IDs for registered witnesses.

Parameters
lower_bound_nameLower bound of the first name to return
limitMaximum number of results to return – must not exceed 1000
Returns
Map of witness names to corresponding IDs

Definition at line 634 of file database_api.cpp.