Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | List of all members
golos::application::database_api Class Reference

The database_api class implements the RPC API for the chain database. More...

#include <database_api.hpp>

Public Member Functions

 database_api (const golos::application::api_context &ctx)
 
 ~database_api ()
 
void set_subscribe_callback (std::function< void(const variant &)> cb, bool clear_filter)
 
void set_pending_transaction_callback (std::function< void(const variant &)> cb)
 
void set_block_applied_callback (std::function< void(const variant &block_header)> cb)
 
void cancel_all_subscriptions ()
 Stop receiving any notifications. More...
 
std::vector< tag_api_objget_trending_tags (std::string after_tag, uint32_t limit) const
 
std::vector< category_api_objget_trending_categories (std::string after, uint32_t limit) const
 
std::vector< category_api_objget_best_categories (std::string after, uint32_t limit) const
 
std::vector< category_api_objget_active_categories (std::string after, uint32_t limit) const
 
std::vector< category_api_objget_recent_categories (std::string after, uint32_t limit) const
 
std::vector< account_name_type > get_active_witnesses () const
 
std::vector< account_name_type > get_miner_queue () const
 
state get_state (std::string path) const
 
optional< block_header > get_block_header (uint32_t block_num) const
 Retrieve a block header. More...
 
optional< signed_block > get_block (uint32_t block_num) const
 Retrieve a full, signed block. More...
 
std::vector< applied_operationget_ops_in_block (uint32_t block_num, bool only_virtual=true) const
 Get sequence of operations included/generated within a particular block. More...
 
fc::variant_object get_config () const
 Retrieve compile-time constants. More...
 
size_t get_free_memory () const
 Retrieve database unused memory amount. More...
 
dynamic_global_property_object get_dynamic_global_properties () const
 Retrieve the current dynamic_global_property_object. More...
 
chain_properties< 0, 17, 0 > get_chain_properties () const
 
price< 0, 17, 0 > get_current_median_history_price () const
 
feed_history_api_obj get_feed_history () const
 
witness_schedule_object get_witness_schedule () const
 
hardfork_version get_hardfork_version () const
 
scheduled_hardfork get_next_scheduled_hardfork () const
 
reward_fund_object get_reward_fund (string name) const
 
asset< 0, 17, 0 > get_name_cost (std::string name) const
 
std::vector< extended_accountget_accounts (std::vector< std::string > names) const
 
std::vector< optional< account_api_obj > > lookup_account_names (const std::vector< std::string > &account_names) const
 Get a list of accounts by name. More...
 
std::set< std::string > lookup_accounts (const std::string &lower_bound_name, uint32_t limit) const
 Get names and IDs for registered accounts. More...
 
vector< asset< 0, 17, 0 > > get_account_balances (account_name_type name, const flat_set< asset_name_type > &assets) const
 Get an account's balances in various assets. More...
 
uint64_t get_account_count () const
 Get the total number of accounts registered with the blockchain. More...
 
std::vector< owner_authority_history_api_objget_owner_history (std::string account) const
 
optional< account_recovery_request_api_objget_recovery_request (std::string account) const
 
optional< escrow_objectget_escrow (std::string from, uint32_t escrow_id) const
 
std::vector< withdraw_routeget_withdraw_routes (std::string account, withdraw_route_type type=outgoing) const
 
optional< account_bandwidth_objectget_account_bandwidth (std::string account, bandwidth_type type) const
 
std::vector< savings_withdraw_api_objget_savings_withdraw_from (std::string account) const
 
std::vector< savings_withdraw_api_objget_savings_withdraw_to (std::string account) const
 
vector< vesting_delegation_objectget_vesting_delegations (string account, string from, uint32_t limit=100) const
 
vector< vesting_delegation_expiration_objectget_expiring_vesting_delegations (string account, time_point_sec from, uint32_t limit=100) const
 
std::vector< optional< witness_api_obj > > get_witnesses (const std::vector< witness_object::id_type > &witness_ids) const
 Get a list of witnesses by ID. More...
 
std::vector< convert_request_objectget_conversion_requests (const std::string &account_name) const
 
fc::optional< witness_api_objget_witness_by_account (std::string account_name) const
 Get the witness owned by a given account. More...
 
std::vector< witness_api_objget_witnesses_by_vote (std::string from, uint32_t limit) const
 
std::set< account_name_type > lookup_witness_accounts (const std::string &lower_bound_name, uint32_t limit) const
 Get names and IDs for registered witnesses. More...
 
uint64_t get_witness_count () const
 Get the total number of witnesses registered with the blockchain. More...
 
vector< optional< asset_object > > get_assets (const vector< asset_name_type > &asset_symbols) const
 Get a list of assets by ID. More...
 
vector< optional< asset_object > > get_assets_by_issuer (string issuer) const
 
vector< optional< asset_dynamic_data_object > > get_assets_dynamic_data (const vector< asset_name_type > &asset_symbols) const
 
vector< optional< asset_bitasset_data_object > > get_bitassets_data (const vector< asset_name_type > &asset_symbols) const
 
vector< asset_objectlist_assets (const asset_name_type &lower_bound_symbol, uint32_t limit) const
 Get assets alphabetically by symbol name. More...
 
std::string get_transaction_hex (const signed_transaction &trx) const
 Get a hexdump of the serialized binary form of a transaction. More...
 
annotated_signed_transaction get_transaction (transaction_id_type trx_id) const
 
std::set< public_key_type > get_required_signatures (const signed_transaction &trx, const flat_set< public_key_type > &available_keys) const
 
std::set< public_key_type > get_potential_signatures (const signed_transaction &trx) const
 
bool verify_authority (const signed_transaction &trx) const
 
bool verify_account_authority (const std::string &name, const flat_set< public_key_type > &signers) const
 
std::vector< vote_stateget_active_votes (std::string author, std::string permlink) const
 
std::vector< account_voteget_account_votes (std::string voter) const
 
discussion get_content (std::string author, std::string permlink) const
 
std::vector< discussionget_content_replies (std::string parent, std::string parent_permlink) const
 
std::vector< pair< std::string, uint32_t > > get_tags_used_by_author (const std::string &author) const
 
std::vector< discussionget_discussions_by_trending (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_created (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_active (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_cashout (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_payout (const discussion_query &query) const
 
std::vector< discussionget_post_discussions_by_payout (const discussion_query &query) const
 
std::vector< discussionget_comment_discussions_by_payout (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_votes (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_children (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_hot (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_feed (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_blog (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_comments (const discussion_query &query) const
 
std::vector< discussionget_discussions_by_promoted (const discussion_query &query) const
 
std::vector< discussionget_replies_by_last_update (account_name_type start_author, std::string start_permlink, uint32_t limit) const
 
std::vector< discussionget_discussions_by_author_before_date (std::string author, std::string start_permlink, time_point_sec before_date, uint32_t limit) const
 
std::map< uint32_t, applied_operationget_account_history (std::string account, uint64_t from, uint32_t limit) const
 
asset< 0, 17, 0 > get_payout_extension_cost (const string &author, const string &permlink, fc::time_point_sec time) const
 
fc::time_point_sec get_payout_extension_time (const string &author, const string &permlink, asset< 0, 17, 0 > cost) const
 
vector< proposal_objectget_proposed_transactions (account_name_type name) const
 
void on_api_startup ()
 
discussion get_discussion (comment_object::id_type, uint32_t truncate_body=0) const
 
template<typename Object , typename DatabaseIndex , typename DiscussionIndex , typename CommentIndex , typename Index , typename StartItr >
std::multimap< Object, discussion, DiscussionIndex > get_discussions (const discussion_query &query, const std::string &tag, comment_object::id_type parent, const Index &tidx, StartItr tidx_itr, const std::function< bool(const comment_api_object &c)> &filter, const std::function< bool(const comment_api_object &c)> &exit, const std::function< bool(const Object &)> &tag_exit, bool ignore_parent) const
 

Detailed Description

The database_api class implements the RPC API for the chain database.

This API exposes accessors on the database which query state tracked by a blockchain validating node. This API is read-only; all modifications to the database must be performed via transactions. Transactions are broadcast via the network_broadcast_api.

Definition at line 64 of file database_api.hpp.

Constructor & Destructor Documentation

◆ database_api()

golos::application::database_api::database_api ( const golos::application::api_context ctx)

Definition at line 231 of file database_api.cpp.

◆ ~database_api()

golos::application::database_api::~database_api ( )

Definition at line 234 of file database_api.cpp.

Member Function Documentation

◆ cancel_all_subscriptions()

void golos::application::database_api::cancel_all_subscriptions ( )

Stop receiving any notifications.

This unsubscribes from all subscribed markets and objects.

Definition at line 215 of file database_api.cpp.

◆ get_account_balances()

vector< asset< 0, 17, 0 > > golos::application::database_api::get_account_balances ( account_name_type  name,
const flat_set< asset_name_type > &  assets 
) const

Get an account's balances in various assets.

Parameters
nameof the account to get balances for
assetsnames of the assets to get balances of; if empty, get all assets account has a balance in
Returns
Balances of the account

Definition at line 688 of file database_api.cpp.

◆ get_account_bandwidth()

optional< account_bandwidth_object > golos::application::database_api::get_account_bandwidth ( std::string  account,
bandwidth_type  type 
) const

Definition at line 562 of file database_api.cpp.

◆ get_account_count()

uint64_t golos::application::database_api::get_account_count ( ) const

Get the total number of accounts registered with the blockchain.

Definition at line 461 of file database_api.cpp.

◆ get_account_history()

std::map< uint32_t, applied_operation > golos::application::database_api::get_account_history ( std::string  account,
uint64_t  from,
uint32_t  limit 
) const

Account operations have sequence numbers from 0 to N where N is the most recent operation. This method returns operations in the range [from-limit, from]

Parameters
from- the absolute sequence 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 1000], must be less than from

Definition at line 1172 of file database_api.cpp.

◆ get_account_votes()

std::vector< account_vote > golos::application::database_api::get_account_votes ( std::string  voter) const

Definition at line 1000 of file database_api.cpp.

◆ get_accounts()

std::vector< extended_account > golos::application::database_api::get_accounts ( std::vector< std::string >  names) const

Definition at line 385 of file database_api.cpp.

◆ get_active_categories()

std::vector< category_api_obj > golos::application::database_api::get_active_categories ( std::string  after,
uint32_t  limit 
) const

Definition at line 2103 of file database_api.cpp.

◆ get_active_votes()

std::vector< vote_state > golos::application::database_api::get_active_votes ( std::string  author,
std::string  permlink 
) const

if permlink is "" then it will return all votes for author

Definition at line 970 of file database_api.cpp.

◆ get_active_witnesses()

std::vector< account_name_type > golos::application::database_api::get_active_witnesses ( ) const

Definition at line 2170 of file database_api.cpp.

◆ get_assets()

vector< optional< asset_object > > golos::application::database_api::get_assets ( const vector< asset_name_type > &  asset_symbols) const

Get a list of assets by ID.

Parameters
asset_symbolsIDs of the assets to retrieve
Returns
The assets corresponding to the provided IDs

This function has semantics identical to get_objects

Definition at line 721 of file database_api.cpp.

◆ get_assets_by_issuer()

vector< optional< asset_object > > golos::application::database_api::get_assets_by_issuer ( string  issuer) const

Definition at line 742 of file database_api.cpp.

◆ get_assets_dynamic_data()

vector< optional< asset_dynamic_data_object > > golos::application::database_api::get_assets_dynamic_data ( const vector< asset_name_type > &  asset_symbols) const

Definition at line 757 of file database_api.cpp.

◆ get_best_categories()

std::vector< category_api_obj > golos::application::database_api::get_best_categories ( std::string  after,
uint32_t  limit 
) const

Definition at line 2094 of file database_api.cpp.

◆ get_bitassets_data()

vector< optional< asset_bitasset_data_object > > golos::application::database_api::get_bitassets_data ( const vector< asset_name_type > &  asset_symbols) const

Definition at line 779 of file database_api.cpp.

◆ get_block()

optional< signed_block > golos::application::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 276 of file database_api.cpp.

◆ get_block_header()

optional< block_header > golos::application::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 262 of file database_api.cpp.

◆ get_chain_properties()

chain_properties< 0, 17, 0 > golos::application::database_api::get_chain_properties ( ) const

Definition at line 335 of file database_api.cpp.

◆ get_comment_discussions_by_payout()

vector< discussion > golos::application::database_api::get_comment_discussions_by_payout ( const discussion_query query) const

Definition at line 1462 of file database_api.cpp.

◆ get_config()

fc::variant_object golos::application::database_api::get_config ( ) const

Retrieve compile-time constants.

Definition at line 315 of file database_api.cpp.

◆ get_content()

discussion golos::application::database_api::get_content ( std::string  author,
std::string  permlink 
) const

Definition at line 956 of file database_api.cpp.

◆ get_content_replies()

std::vector< discussion > golos::application::database_api::get_content_replies ( std::string  parent,
std::string  parent_permlink 
) const

Definition at line 1112 of file database_api.cpp.

◆ get_conversion_requests()

std::vector< convert_request_object > golos::application::database_api::get_conversion_requests ( const std::string &  account_name) const

Definition at line 943 of file database_api.cpp.

◆ get_current_median_history_price()

price< 0, 17, 0 > golos::application::database_api::get_current_median_history_price ( ) const

Definition at line 347 of file database_api.cpp.

◆ get_discussion()

discussion golos::application::database_api::get_discussion ( comment_object::id_type  id,
uint32_t  truncate_body = 0 
) const

Definition at line 1258 of file database_api.cpp.

◆ get_discussions()

template<typename Object , typename DatabaseIndex , typename DiscussionIndex , typename CommentIndex , typename Index , typename StartItr >
std::multimap<Object, discussion, DiscussionIndex> golos::application::database_api::get_discussions ( const discussion_query query,
const std::string &  tag,
comment_object::id_type  parent,
const Index &  tidx,
StartItr  tidx_itr,
const std::function< bool(const comment_api_object &c)> &  filter,
const std::function< bool(const comment_api_object &c)> &  exit,
const std::function< bool(const Object &)> &  tag_exit,
bool  ignore_parent 
) const

Definition at line 1289 of file database_api.cpp.

◆ get_discussions_by_active()

std::vector< discussion > golos::application::database_api::get_discussions_by_active ( const discussion_query query) const

Used to retrieve the list of discussions sorted by last activity time

Parameters
querydiscussion_query
Returns
vector of discussions sorted by last activity time

Definition at line 1579 of file database_api.cpp.

◆ get_discussions_by_author_before_date()

std::vector< discussion > golos::application::database_api::get_discussions_by_author_before_date ( std::string  author,
std::string  start_permlink,
time_point_sec  before_date,
uint32_t  limit 
) const

This method is used to fetch all posts/comments by start_author that occur after before_date and start_permlink with up to limit being returned.

If start_permlink is empty then only before_date will be considered. If both are specified the eariler to the two metrics will be used. This should allow easy pagination.

Definition at line 2183 of file database_api.cpp.

◆ get_discussions_by_blog()

std::vector< discussion > golos::application::database_api::get_discussions_by_blog ( const discussion_query query) const

Used to retrieve the list of discussions from the blog of a specific author

Parameters
querydiscussion_query
Attention
discussion_query::select_authors must be set and must contain the discussion_query::start_author param if the last one is not null
Returns
vector of discussions from the blog of authors in discussion_query::select_authors

Definition at line 2000 of file database_api.cpp.

◆ get_discussions_by_cashout()

std::vector< discussion > golos::application::database_api::get_discussions_by_cashout ( const discussion_query query) const

Used to retrieve the list of discussions sorted by cashout time

Parameters
querydiscussion_query
Returns
vector of discussions sorted by last cashout time

Definition at line 1622 of file database_api.cpp.

◆ get_discussions_by_children()

std::vector< discussion > golos::application::database_api::get_discussions_by_children ( const discussion_query query) const

Used to retrieve the list of discussions sorted by children posts amount

Parameters
querydiscussion_query
Returns
vector of discussions sorted by children posts amount

Definition at line 1750 of file database_api.cpp.

◆ get_discussions_by_comments()

std::vector< discussion > golos::application::database_api::get_discussions_by_comments ( const discussion_query query) const

Definition at line 2021 of file database_api.cpp.

◆ get_discussions_by_created()

std::vector< discussion > golos::application::database_api::get_discussions_by_created ( const discussion_query query) const

Used to retrieve the list of discussions sorted by created time

Parameters
querydiscussion_query
Returns
vector of discussions sorted by created time

Definition at line 1537 of file database_api.cpp.

◆ get_discussions_by_feed()

std::vector< discussion > golos::application::database_api::get_discussions_by_feed ( const discussion_query query) const

Used to retrieve the list of discussions from the feed of a specific author

Parameters
querydiscussion_query
Attention
discussion_query::select_authors must be set and must contain the discussion_query::start_author param if the last one is not null
Returns
vector of discussions from the feed of authors in discussion_query::select_authors

Definition at line 1921 of file database_api.cpp.

◆ get_discussions_by_hot()

std::vector< discussion > golos::application::database_api::get_discussions_by_hot ( const discussion_query query) const

Used to retrieve the list of discussions sorted by hot amount

Parameters
querydiscussion_query
Returns
vector of discussions sorted by hot amount

Definition at line 1787 of file database_api.cpp.

◆ get_discussions_by_payout()

std::vector< discussion > golos::application::database_api::get_discussions_by_payout ( const discussion_query query) const

Used to retrieve the list of discussions sorted by net rshares amount

Parameters
querydiscussion_query
Returns
vector of discussions sorted by net rshares amount

Definition at line 1669 of file database_api.cpp.

◆ get_discussions_by_promoted()

std::vector< discussion > golos::application::database_api::get_discussions_by_promoted ( const discussion_query query) const

Used to retrieve the list of discussions sorted by promoted balance amount

Parameters
querydiscussion_query
Returns
vector of discussions sorted by promoted balance amount

Definition at line 1499 of file database_api.cpp.

◆ get_discussions_by_trending()

std::vector< discussion > golos::application::database_api::get_discussions_by_trending ( const discussion_query query) const

Used to retrieve the list of first payout discussions sorted by rshares^2 amount

Parameters
querydiscussion_query
Returns
vector of first payout mode discussions sorted by rshares^2 amount

Definition at line 1388 of file database_api.cpp.

◆ get_discussions_by_votes()

std::vector< discussion > golos::application::database_api::get_discussions_by_votes ( const discussion_query query) const

Used to retrieve the list of discussions sorted by direct votes amount

Parameters
querydiscussion_query
Returns
vector of discussions sorted by direct votes amount

Definition at line 1714 of file database_api.cpp.

◆ get_dynamic_global_properties()

dynamic_global_property_object golos::application::database_api::get_dynamic_global_properties ( ) const

Retrieve the current dynamic_global_property_object.

Definition at line 329 of file database_api.cpp.

◆ get_escrow()

optional< escrow_object > golos::application::database_api::get_escrow ( std::string  from,
uint32_t  escrow_id 
) const

Definition at line 502 of file database_api.cpp.

◆ get_expiring_vesting_delegations()

vector< vesting_delegation_expiration_object > golos::application::database_api::get_expiring_vesting_delegations ( string  account,
time_point_sec  from,
uint32_t  limit = 100 
) const

Definition at line 2273 of file database_api.cpp.

◆ get_feed_history()

feed_history_api_obj golos::application::database_api::get_feed_history ( ) const

Definition at line 341 of file database_api.cpp.

◆ get_free_memory()

size_t golos::application::database_api::get_free_memory ( ) const

Retrieve database unused memory amount.

Definition at line 321 of file database_api.cpp.

◆ get_hardfork_version()

hardfork_version golos::application::database_api::get_hardfork_version ( ) const

Definition at line 363 of file database_api.cpp.

◆ get_miner_queue()

std::vector< account_name_type > golos::application::database_api::get_miner_queue ( ) const

Definition at line 2154 of file database_api.cpp.

◆ get_name_cost()

asset< 0, 17, 0 > golos::application::database_api::get_name_cost ( std::string  name) const

Definition at line 2364 of file database_api.cpp.

◆ get_next_scheduled_hardfork()

scheduled_hardfork golos::application::database_api::get_next_scheduled_hardfork ( ) const

Definition at line 369 of file database_api.cpp.

◆ get_ops_in_block()

std::vector< applied_operation > golos::application::database_api::get_ops_in_block ( uint32_t  block_num,
bool  only_virtual = true 
) const

Get sequence of operations included/generated within a particular block.

Parameters
block_numHeight of the block whose generated virtual operations should be returned
only_virtualWhether to only include virtual operations in returned results (default: true)
Returns
sequence of operations included/generated within the block

Definition at line 286 of file database_api.cpp.

◆ get_owner_history()

std::vector< owner_authority_history_api_obj > golos::application::database_api::get_owner_history ( std::string  account) const

Definition at line 471 of file database_api.cpp.

◆ get_payout_extension_cost()

asset< 0, 17, 0 > golos::application::database_api::get_payout_extension_cost ( const string &  author,
const string &  permlink,
fc::time_point_sec  time 
) const

Used to retrieve comment payout window extension cost by time

Parameters
authorcomment author
permlinkcomment permlink
timedeadline time the payout window pretends to be extended for
Returns
SBD amount required to set payout window duration up to time passed

Definition at line 1194 of file database_api.cpp.

◆ get_payout_extension_time()

fc::time_point_sec golos::application::database_api::get_payout_extension_time ( const string &  author,
const string &  permlink,
asset< 0, 17, 0 >  cost 
) const

Used o retrieve comment payout window extension time by cost

Parameters
authorcomment author
permlinkcomment permlink
costSBD amount pretended to be spent on extension
Returns
deadline time the payout window pretends to be extended for

Definition at line 1199 of file database_api.cpp.

◆ get_post_discussions_by_payout()

vector< discussion > golos::application::database_api::get_post_discussions_by_payout ( const discussion_query query) const

Definition at line 1426 of file database_api.cpp.

◆ get_potential_signatures()

std::set< public_key_type > golos::application::database_api::get_potential_signatures ( const signed_transaction &  trx) const

This method will return the set of all public keys that could possibly sign for a given transaction. This call can be used by wallets to filter their set of public keys to just the relevant subset prior to calling get_required_signatures to get the minimum subset.

Definition at line 863 of file database_api.cpp.

◆ get_proposed_transactions()

vector< proposal_object > golos::application::database_api::get_proposed_transactions ( account_name_type  name) const
Returns
the set of proposed transactions relevant to the specified account id.

Definition at line 2374 of file database_api.cpp.

◆ get_recent_categories()

std::vector< category_api_obj > golos::application::database_api::get_recent_categories ( std::string  after,
uint32_t  limit 
) const

Definition at line 2112 of file database_api.cpp.

◆ get_recovery_request()

optional< account_recovery_request_api_obj > golos::application::database_api::get_recovery_request ( std::string  account) const

Definition at line 487 of file database_api.cpp.

◆ get_replies_by_last_update()

std::vector< discussion > golos::application::database_api::get_replies_by_last_update ( account_name_type  start_parent_author,
std::string  start_permlink,
uint32_t  limit 
) const

Return the active discussions with the highest cumulative pending payouts without respect to category, total pending payout means the pending payout of all children as well.

This method can be used to fetch replies to an account.

The first call should be (account_to_retrieve replies, "", limit) Subsequent calls should be (last_author, last_permlink, limit)

Definition at line 1138 of file database_api.cpp.

◆ get_required_signatures()

std::set< public_key_type > golos::application::database_api::get_required_signatures ( const signed_transaction &  trx,
const flat_set< public_key_type > &  available_keys 
) const

This API will take a partially signed transaction and a set of public keys that the owner has the ability to sign for and return the minimal subset of public keys that should add signatures to the transaction.

Definition at line 841 of file database_api.cpp.

◆ get_reward_fund()

reward_fund_object golos::application::database_api::get_reward_fund ( string  name) const

Definition at line 2355 of file database_api.cpp.

◆ get_savings_withdraw_from()

std::vector< savings_withdraw_api_obj > golos::application::database_api::get_savings_withdraw_from ( std::string  account) const

Definition at line 2225 of file database_api.cpp.

◆ get_savings_withdraw_to()

std::vector< savings_withdraw_api_obj > golos::application::database_api::get_savings_withdraw_to ( std::string  account) const

Definition at line 2239 of file database_api.cpp.

◆ get_state()

state golos::application::database_api::get_state ( std::string  path) const

This API is a short-cut for returning all of the state required for a particular URL with a single query.

remove '/' from front

FETCH CATEGORY STATE

END FETCH CATEGORY STATE

pull a complete discussion

Definition at line 2395 of file database_api.cpp.

◆ get_tags_used_by_author()

std::vector< pair< std::string, uint32_t > > golos::application::database_api::get_tags_used_by_author ( const std::string &  author) const

Used to retrieve top 1000 tags list used by an author sorted by most frequently used

Parameters
authorselect tags of this author
Returns
vector of top 1000 tags used by an author sorted by most frequently used

Definition at line 1204 of file database_api.cpp.

◆ get_transaction()

annotated_signed_transaction golos::application::database_api::get_transaction ( transaction_id_type  trx_id) const

Definition at line 2293 of file database_api.cpp.

◆ get_transaction_hex()

std::string golos::application::database_api::get_transaction_hex ( const signed_transaction &  trx) const

Get a hexdump of the serialized binary form of a transaction.

Definition at line 831 of file database_api.cpp.

◆ get_trending_categories()

std::vector< category_api_obj > golos::application::database_api::get_trending_categories ( std::string  after,
uint32_t  limit 
) const

Definition at line 2067 of file database_api.cpp.

◆ get_trending_tags()

std::vector< tag_api_obj > golos::application::database_api::get_trending_tags ( std::string  after_tag,
uint32_t  limit 
) const

Definition at line 1225 of file database_api.cpp.

◆ get_vesting_delegations()

vector< vesting_delegation_object > golos::application::database_api::get_vesting_delegations ( string  account,
string  from,
uint32_t  limit = 100 
) const

Definition at line 2254 of file database_api.cpp.

◆ get_withdraw_routes()

std::vector< withdraw_route > golos::application::database_api::get_withdraw_routes ( std::string  account,
withdraw_route_type  type = outgoing 
) const

Definition at line 515 of file database_api.cpp.

◆ get_witness_by_account()

fc::optional< witness_api_obj > golos::application::database_api::get_witness_by_account ( 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 601 of file database_api.cpp.

◆ get_witness_count()

uint64_t golos::application::database_api::get_witness_count ( ) const

Get the total number of witnesses registered with the blockchain.

Definition at line 672 of file database_api.cpp.

◆ get_witness_schedule()

witness_schedule_object golos::application::database_api::get_witness_schedule ( ) const

Definition at line 357 of file database_api.cpp.

◆ get_witnesses()

std::vector< optional< witness_api_obj > > golos::application::database_api::get_witnesses ( const std::vector< witness_object::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 580 of file database_api.cpp.

◆ get_witnesses_by_vote()

std::vector< witness_api_obj > golos::application::database_api::get_witnesses_by_vote ( 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 607 of file database_api.cpp.

◆ list_assets()

vector< asset_object > golos::application::database_api::list_assets ( const asset_name_type &  lower_bound_symbol,
uint32_t  limit 
) const

Get assets alphabetically by symbol name.

Parameters
lower_bound_symbolLower bound of symbol names to retrieve
limitMaximum number of assets to fetch (must not exceed 100)
Returns
The assets found

Definition at line 801 of file database_api.cpp.

◆ lookup_account_names()

std::vector< optional< account_api_obj > > golos::application::database_api::lookup_account_names ( const std::vector< std::string > &  account_names) const

Get a list of accounts by name.

Parameters
account_namesNames of the accounts to retrieve
Returns
The accounts holding the provided names

This function has semantics identical to get_objects

Definition at line 416 of file database_api.cpp.

◆ lookup_accounts()

std::set< std::string > golos::application::database_api::lookup_accounts ( const std::string &  lower_bound_name,
uint32_t  limit 
) const

Get names and IDs for registered accounts.

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

Definition at line 441 of file database_api.cpp.

◆ lookup_witness_accounts()

std::set< account_name_type > golos::application::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 642 of file database_api.cpp.

◆ on_api_startup()

void golos::application::database_api::on_api_startup ( )

Definition at line 253 of file database_api.cpp.

◆ set_block_applied_callback()

void golos::application::database_api::set_block_applied_callback ( std::function< void(const variant &block_header)>  cb)

Definition at line 196 of file database_api.cpp.

◆ set_pending_transaction_callback()

void golos::application::database_api::set_pending_transaction_callback ( std::function< void(const variant &)>  cb)

Definition at line 186 of file database_api.cpp.

◆ set_subscribe_callback()

void golos::application::database_api::set_subscribe_callback ( std::function< void(const variant &)>  cb,
bool  clear_filter 
)

Definition at line 168 of file database_api.cpp.

◆ verify_account_authority()

bool golos::application::database_api::verify_account_authority ( const std::string &  name,
const flat_set< public_key_type > &  signers 
) const

Definition at line 915 of file database_api.cpp.

◆ verify_authority()

bool golos::application::database_api::verify_authority ( const signed_transaction &  trx) const
Returns
true of the trx has all of the required signatures, otherwise throws an exception

Definition at line 898 of file database_api.cpp.


The documentation for this class was generated from the following files: