|
Monero C++ Library
|
#include <monero_daemon_rpc.h>
Public Member Functions | |
| ~monero_daemon_rpc () override | |
| monero_daemon_rpc (const std::shared_ptr< monero_rpc_connection > &rpc) | |
| monero_daemon_rpc (const std::string &uri, const std::string &username="", const std::string &password="", const std::string &proxy_uri="", const std::string &zmq_uri="", const boost::optional< uint32_t > &timeout=boost::none) | |
| std::shared_ptr< monero_rpc_connection > | get_rpc_connection () const |
| bool | is_connected () |
| void | set_poll_period_in_ms (uint64_t period_ms) |
| std::set< monero_daemon_listener * > | get_listeners () override |
| void | add_listener (monero_daemon_listener &listener) override |
| void | remove_listener (monero_daemon_listener &listener) override |
| void | remove_listeners () override |
| monero_version | get_version () override |
| bool | is_trusted () override |
| uint64_t | get_height () override |
| std::string | get_block_hash (uint64_t height) override |
| std::shared_ptr< monero_block_template > | get_block_template (const std::string &wallet_address, const boost::optional< int > &reserve_size=boost::none) override |
| std::shared_ptr< monero_miner_data > | get_miner_data () override |
| std::string | calculate_pow (uint32_t major_version, uint64_t height, const std::string &block_blob, const std::string &seed_hash) override |
| std::shared_ptr< monero_add_auxiliary_pow_result > | add_auxiliary_pow (const std::string &block_template_blob, const std::vector< std::shared_ptr< monero_auxiliary_pow > > &aux_pow) override |
| std::shared_ptr< monero_block_header > | get_last_block_header () override |
| std::shared_ptr< monero_block_header > | get_block_header_by_hash (const std::string &hash) override |
| std::shared_ptr< monero_block_header > | get_block_header_by_height (uint64_t height) override |
| std::vector< std::shared_ptr< monero_block_header > > | get_block_headers_by_range (uint64_t start_height, uint64_t end_height) override |
| std::shared_ptr< monero_block > | get_block_by_hash (const std::string &hash) override |
| std::shared_ptr< monero_get_blocks_by_hash_result > | get_blocks_by_hash (const std::vector< std::string > &block_hashes, uint64_t start_height, bool prune, uint64_t max_block_count=0) override |
| std::shared_ptr< monero_block > | get_block_by_height (uint64_t height) override |
| std::vector< std::shared_ptr< monero_block > > | get_blocks_by_height (const std::vector< uint64_t > &heights) override |
| std::vector< std::shared_ptr< monero_block > > | get_blocks_by_range (boost::optional< uint64_t > start_height, boost::optional< uint64_t > end_height) override |
| std::vector< std::shared_ptr< monero_block > > | get_blocks_by_range_chunked (boost::optional< uint64_t > start_height, boost::optional< uint64_t > end_height, boost::optional< uint64_t > max_chunk_size) override |
| std::shared_ptr< monero_get_block_hashes_result > | get_block_hashes (const std::vector< std::string > &block_hashes) override |
| std::vector< std::shared_ptr< monero_tx > > | get_txs (const std::vector< std::string > &tx_hashes, bool prune=false) override |
| std::vector< std::string > | get_tx_hexes (const std::vector< std::string > &tx_hashes, bool prune=false) override |
| std::shared_ptr< monero_miner_tx_sum > | get_miner_tx_sum (uint64_t height, uint64_t num_blocks) override |
| std::shared_ptr< monero_fee_estimate > | get_fee_estimate (uint64_t grace_blocks=0) override |
| std::shared_ptr< monero_submit_tx_result > | submit_tx_hex (const std::string &tx_hex, bool do_not_relay=false) override |
| void | relay_txs_by_hash (const std::vector< std::string > &tx_hashes) override |
| std::shared_ptr< monero_tx_pool_stats > | get_tx_pool_stats () override |
| std::vector< std::shared_ptr< monero_tx > > | get_tx_pool () override |
| std::vector< std::string > | get_tx_pool_hashes () override |
| void | flush_tx_pool (const std::vector< std::string > &hashes) override |
| void | flush_tx_pool () override |
| void | flush_tx_pool (const std::string &hash) override |
| std::vector< monero_key_image_spent_status > | get_key_image_spent_statuses (const std::vector< std::string > &key_images) override |
| std::vector< uint64_t > | get_output_indices (const std::string &tx_hash) override |
| std::vector< std::shared_ptr< monero_output > > | get_outputs (const std::vector< monero_output > &outputs) override |
| std::vector< std::shared_ptr< monero_output_histogram_entry > > | get_output_histogram (const std::vector< uint64_t > &amounts, const boost::optional< int > &min_count, const boost::optional< int > &max_count, const boost::optional< bool > &is_unlocked, const boost::optional< int > &recent_cutoff) override |
| std::vector< std::shared_ptr< monero_output_distribution_entry > > | get_output_distribution (const std::vector< uint64_t > &amounts, const boost::optional< bool > &is_cumulative=boost::none, const boost::optional< uint64_t > &start_height=boost::none, const boost::optional< uint64_t > &end_height=boost::none) override |
| std::shared_ptr< monero_daemon_info > | get_info () override |
| std::shared_ptr< monero_daemon_sync_info > | get_sync_info () override |
| std::shared_ptr< monero_daemon_network_stats > | get_network_stats () override |
| std::shared_ptr< monero_hard_fork_info > | get_hard_fork_info () override |
| std::vector< std::shared_ptr< monero_alt_chain > > | get_alt_chains () override |
| std::vector< std::string > | get_alt_block_hashes () override |
| int | get_download_limit () override |
| int | set_download_limit (int limit) override |
| int | reset_download_limit () override |
| int | get_upload_limit () override |
| int | set_upload_limit (int limit) override |
| int | reset_upload_limit () override |
| std::vector< std::shared_ptr< monero_peer > > | get_peers () override |
| std::vector< std::shared_ptr< monero_peer > > | get_known_peers () override |
| std::vector< std::shared_ptr< monero_peer > > | get_public_peers (bool include_offline=false) override |
| void | set_outgoing_peer_limit (int limit) override |
| void | set_incoming_peer_limit (int limit) override |
| std::vector< std::shared_ptr< monero_ban > > | get_peer_bans () override |
| void | set_peer_bans (const std::vector< std::shared_ptr< monero_ban > > &bans) override |
| std::shared_ptr< monero_ban > | get_peer_ban (const std::string &address) override |
| void | start_mining (const std::string &address, boost::optional< uint64_t > num_threads, boost::optional< bool > background_mining, boost::optional< bool > ignore_battery) override |
| void | stop_mining () override |
| std::shared_ptr< monero_mining_status > | get_mining_status () override |
| std::shared_ptr< monero_generate_blocks_result > | generate_blocks (const std::string &wallet_address, uint64_t num_blocks, const boost::optional< std::string > &prev_block_hash=boost::none, const boost::optional< uint32_t > &starting_nonce=boost::none) override |
| void | submit_blocks (const std::vector< std::string > &block_blobs) override |
| std::shared_ptr< monero_prune_result > | prune_blockchain (bool check) override |
| void | save_blockchain () override |
| uint64_t | pop_blocks (uint64_t num_blocks) override |
| void | flush_cache (bool bad_blocks=false) override |
| void | set_bootstrap_daemon (const std::string &address, const std::string &username="", const std::string &password="", const std::string &proxy="") override |
| void | set_log_hash_rate (bool is_visible) override |
| void | set_log_level (int level) override |
| std::string | set_log_categories (const std::string &categories="") override |
| std::shared_ptr< monero_daemon_update_check_result > | check_for_update () override |
| std::shared_ptr< monero_daemon_update_download_result > | download_update (const std::string &path="") override |
| void | stop () override |
| std::shared_ptr< monero_block_header > | wait_for_next_block_header () override |
Public Member Functions inherited from monero::monero_daemon | |
| virtual | ~monero_daemon () |
| virtual std::shared_ptr< monero_tx > | get_tx (const std::string &tx_hash, bool prune=false) |
| virtual boost::optional< std::string > | get_tx_hex (const std::string &tx_hash, bool prune=false) |
| virtual void | relay_tx_by_hash (const std::string &tx_hash) |
| virtual std::vector< monero_tx_backlog_entry > | get_tx_pool_backlog () |
| virtual monero_key_image_spent_status | get_key_image_spent_status (const std::string &key_image) |
| virtual void | set_peer_ban (const std::shared_ptr< monero_ban > &ban) |
| virtual void | submit_block (const std::string &block_blob) |
| virtual void | remove_bootstrap_daemon () |
Friends | |
| class | monero_daemon_poller |
Implements a Monero daemon using monerod-rpc.
|
override |
Destruct the daemon.
|
overridevirtual |
Add auxiliary proof-of-work to a block template for merge mining, returning an updated block template whose Merkle root commits to the given auxiliary blocks.
| block_template_blob | is the block template blob to add auxiliary PoW to |
| aux_pow | identifies each auxiliary chain by id and its block's PoW hash |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Register a listener receive daemon notifications.
| listener | is the listener to receive daemon notifications |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Calculate the proof-of-work hash of a mined block.
| major_version | is the block's major version |
| height | is the block's height |
| block_blob | is the block's blob to hash |
| seed_hash | is the seed hash used to select the RandomX dataset/cache |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
|
overridevirtual |
Download an update.
| path | is the path to download the update (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Flush the daemon's invalid block and transaction caches.
| bad_blocks | specifies to flush the bad blocks cache (default false) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Flushes all transactions from the tx pool.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Flush a single transaction from the tx pool.
| hash | is the hash of transaction to flush |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Flush transactions from the tx pool.
| hashes | are hashes of transactions to flush |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Generate blocks to a wallet address (regtest only).
| wallet_address | is the address of the wallet to receive miner transactions if block is successfully mined |
| num_blocks | is the number of blocks to generate |
| prev_block_hash | is the hash of the previous block to build on top of (optional, builds on the current tip if not given) |
| starting_nonce | is the starting nonce to use (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get known block hashes which are not on the main chain.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get alternative chains seen by the node.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block by hash.
| block_hash | is the hash of the block to get |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block by height.
| height | is the height of the block to get |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block's hash by its height.
| height | is the height of the block hash to get |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get block hashes as a binary request to the daemon.
| block_hashes | is a short chain history; first 10 blocks hash goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block which is required, or the request fails. |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block header by its hash.
| block_hash | is the hash of the block to get the header of |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block header by its height.
| height | is the height of the block to get the header of |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get block headers for the given range.
| start_height | is the start height lower bound inclusive (optional) |
| end_height | is the end height upper bound inclusive (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a block template for mining a new block.
| wallet_address | is the address of the wallet to receive miner transactions if block is successfully mined |
| reserve_size | is the reserve size (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get blocks by hash.
| block_hashes | is a short chain history; first 10 blocks hash goes sequential, next goes in pow(2,n) offset, like 2, 4, 8, 16, 32, 64 and so on, and the last one is always genesis block |
| start_height | is the start height to resume from; when non-zero, daemon skips the search to find the last block and is used as-is, ignoring block_hashes — except when block_hashes[0] already matches the daemon's tip, which short-circuits to an empty result (see |
| prune | specifies if returned blocks should be pruned (defaults to false) |
| max_block_count | caps how many blocks the daemon returns in one call (0 leaves it to the daemon's own default limit); use this to chunk large ranges instead of taking whatever the daemon hands back |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get blocks at the given heights.
| heights | are the heights of the blocks to get |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get blocks in the given height range.
| start_height | is the start height lower bound inclusive (optional) |
| end_height | is the end height upper bound inclusive (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get blocks in the given height range as chunked requests so that each request is not too big.
| start_height | is the start height lower bound inclusive (optional) |
| end_height | is the end height upper bound inclusive (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the download bandwidth limit.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get mining fee estimates per kB.
| grace_blocks | TODO |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Look up information regarding hard fork voting and readiness.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the number of blocks in the longest chain known to the node.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get general information about the state of the node and the network.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the spent status of each given key image.
| key_image | are hex key images to get the statuses of |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get all known peers including their last known online status.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the last block's header.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Supported daemon methods.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the data needed to construct a block template for mining, e.g. for use by a pool that assembles its own block templates.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Gets the total emissions and fees from the genesis block to the current height.
| height | is the height to start computing the miner sum |
| num_blocks | are the number of blocks to include in the sum |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the daemon's mining status.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get network (bandwidth) statistics since the daemon started.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Creates an output distribution.
| amounts | are amounts of outputs to make the distribution with |
| is_cumulative | specifies if the results should be cumulative (defaults to TODO) |
| start_height | is the start height lower bound inclusive (optional) |
| end_height | is the end height upper bound inclusive (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get a histogram of output amounts. For all amounts (possibly filtered by parameters), gives the number of outputs on the chain for that amount. RingCT outputs counts as 0 amount.
| amounts | are amounts of outputs to make the histogram with |
| min_count | TODO |
| max_count | TODO |
| is_unlocked | makes a histogram with outputs with the specified lock state |
| recent_cutoff | TODO |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the global output index of each output in a transaction.
| tx_hash | is the hash of the transaction to get output indices for |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get outputs identified by a list of output amounts and indices as a binary request.
| outputs | identify each output by amount and index |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the ban status of a peer node.
| address | is the address of the peer node to check, e.g. "1.2.3.4" or "1.2.3.4:18080" |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
|
overridevirtual |
Get peers with active incoming or outgoing connections to the node.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get public nodes known to the daemon.
| include_offline | specifies if offline nodes should be included (default false) |
Reimplemented from monero::monero_daemon.
| std::shared_ptr< monero_rpc_connection > monero::monero_daemon_rpc::get_rpc_connection | ( | ) | const |
Get the daemon's RPC connection.
|
overridevirtual |
Get synchronization information.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get transaction hexes by hashes.
| tx_hashes | are hashes of transactions to get hexes from |
| prune | specifies if the returned tx hexes should be pruned (defaults to false) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get valid transactions seen by the node but not yet mined into a block, as well as spent key image information for the tx pool.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get hashes of transactions in the transaction pool.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get transaction pool statistics.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get transactions by hashes.
| tx_hashes | are hashes of transactions to get |
| prune | specifies if the returned txs should be pruned (defaults to false) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the upload bandwidth limit.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
| bool monero::monero_daemon_rpc::is_connected | ( | ) |
Indicates if the client is connected to the daemon via RPC.
|
overridevirtual |
Indicates if the daemon is trusted or untrusted.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Pop (remove) blocks from the top of the blockchain.
| num_blocks | is the number of blocks to pop |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Prune the blockchain.
| check | specifies to check the pruning (default false) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Relays transactions by hash.
| tx_hashes | identify the transactions to relay |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Unregister a listener to receive daemon notifications.
| listener | is the listener to unregister |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Remove all listeners registered with the daemon.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Reset the download bandwidth limit.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Reset the upload bandwidth limit.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Save (flush) the blockchain to disk.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Set the bootstrap daemon used by the daemon to serve requests while it is not fully synced, e.g. a remote node.
| address | is the bootstrap daemon's address (host:port), "auto" to select a public node automatically, or an empty string to disable the bootstrap daemon |
| username | is the username to authenticate with the bootstrap daemon (optional) |
| password | is the password to authenticate with the bootstrap daemon (optional) |
| proxy | is the proxy used to reach the bootstrap daemon, e.g. a SOCKS proxy (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Set the download bandwidth limit.
| limit | is the download limit to set (-1 to reset to default) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Limit number of incoming peers.
| limit | is the maximum number of incoming peers |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Set the daemon's log categories.
| categories | are the log categories to set, e.g. "*:WARNING,net.p2p:DEBUG" (an empty string resets categories to the default) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Show or hide the mining hash rate in the daemon's console log.
| is_visible | specifies if the hash rate should be logged |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Set the daemon's log level.
| level | is the log level to set, from 0 (least verbose) to 4 (most verbose) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Limit number of outgoing peers.
| limit | is the maximum number of outgoing peers |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Ban peers nodes.
| bans | are bans to apply against peer nodes |
Reimplemented from monero::monero_daemon.
| void monero::monero_daemon_rpc::set_poll_period_in_ms | ( | uint64_t | period_ms | ) |
Set the daemon poll period.
| period_ms | poll period in milliseconds. |
|
overridevirtual |
Set the upload bandwidth limit.
| limit | is the upload limit to set (-1 to reset to default) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Start mining.
| address | is the address given miner rewards if the daemon mines a block |
| num_threads | is the number of mining threads to run |
| is_background | specifies if the miner should run in the background or not |
| ignore_battery | specifies if the battery state (e.g. on laptop) should be ignored or not |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Safely disconnect and shut down the daemon.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Stop mining.
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Submit mined blocks to the network.
| block_blobs | are the mined blocks to submit |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Submits a transaction to the daemon's pool.
| tx_hex | is the raw transaction hex to submit |
| do_not_relay | specifies if the tx should be relayed (optional) |
Reimplemented from monero::monero_daemon.
|
overridevirtual |
Get the header of the next block added to the chain.
Reimplemented from monero::monero_daemon.