BitShares-Core
7.0.2
BitShares blockchain node software and command-line wallet software
|
used by node reports status to client or fetch data from client More...
#include <node.hpp>
Public Member Functions | |
virtual | ~node_delegate ()=default |
virtual bool | has_item (const net::item_id &id)=0 |
virtual bool | handle_block (const graphene::net::block_message &blk_msg, bool sync_mode, std::vector< message_hash_type > &contained_transaction_msg_ids)=0 |
Called when a new block comes in from the network. More... | |
virtual void | handle_transaction (const graphene::net::trx_message &trx_msg)=0 |
Called when a new transaction comes in from the network. More... | |
virtual void | handle_message (const message &message_to_process)=0 |
Called when a new message comes in from the network other than a block or a transaction. Currently there are no other possible messages, so this should never be called. More... | |
virtual std::vector< item_hash_t > | get_block_ids (const std::vector< item_hash_t > &blockchain_synopsis, uint32_t &remaining_item_count, uint32_t limit=2000)=0 |
virtual message | get_item (const item_id &id)=0 |
virtual chain_id_type | get_chain_id () const =0 |
virtual std::vector< item_hash_t > | get_blockchain_synopsis (const item_hash_t &reference_point, uint32_t number_of_blocks_after_reference_point)=0 |
virtual void | sync_status (uint32_t item_type, uint32_t item_count)=0 |
virtual void | connection_count_changed (uint32_t c)=0 |
virtual uint32_t | get_block_number (const item_hash_t &block_id)=0 |
virtual fc::time_point_sec | get_block_time (const item_hash_t &block_id)=0 |
virtual item_hash_t | get_head_block_id () const =0 |
virtual uint32_t | estimate_last_known_fork_from_git_revision_timestamp (uint32_t unix_timestamp) const =0 |
virtual void | error_encountered (const std::string &message, const fc::oexception &error)=0 |
virtual uint8_t | get_current_block_interval_in_seconds () const =0 |
used by node reports status to client or fetch data from client
|
virtualdefault |
|
pure virtual |
Call any time the number of connected peers changes.
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Assuming all data elements are ordered in some way, this method should return up to limit ids that occur after from_id. On return, remaining_item_count will be set to the number of items in our blockchain after the last item returned in the result, or 0 if the result contains the last item in the blockchain
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper.
|
pure virtual |
|
pure virtual |
Returns the time a block was produced (if block_id = 0, returns genesis time). If we don't know about the block, returns time_point_sec::min()
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
Returns a synopsis of the blockchain used for syncing. This consists of a list of selected item hashes from our current preferred blockchain, exponentially falling off into the past. Horrible explanation.
If the blockchain is empty, it will return the empty list. If the blockchain has one block, it will return a list containing just that block. If it contains more than one block: the first element in the list will be the hash of the highest numbered block that we cannot undo the second element will be the hash of an item at the half way point in the undoable segment of the blockchain the third will be ~3/4 of the way through the undoable segment of the block chain the fourth will be at ~7/8... &c. the last item in the list will be the hash of the most recent block on our preferred chain
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Given the hash of the requested data, fetch the body.
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
Called when a new block comes in from the network.
blk_msg | the message which contains the block |
sync_mode | true if the message was fetched through the sync process, false during normal operation |
contained_transaction_msg_ids | container for the transactions to write back into |
exception | if error validating the item, otherwise the item is safe to broadcast on. |
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper.
|
pure virtual |
Called when a new message comes in from the network other than a block or a transaction. Currently there are no other possible messages, so this should never be called.
exception | if error validating the item, otherwise the item is safe to broadcast on. |
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
Called when a new transaction comes in from the network.
exception | if error validating the item, otherwise the item is safe to broadcast on. |
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.
|
pure virtual |
If delegate has the item, the network has no need to fetch it.
Implemented in graphene::app::detail::application_impl, and graphene::net::detail::statistics_gathering_node_delegate_wrapper.
|
pure virtual |
Call this after the call to handle_message succeeds.
item_type | the type of the item we're synchronizing, will be the same as item passed to the sync_from() call |
item_count | the number of items known to the node that haven't been sent to handle_item() yet. After item_count more calls to handle_item(), the node will be in sync |
Implemented in graphene::net::detail::statistics_gathering_node_delegate_wrapper, and graphene::app::detail::application_impl.