|
Monero C++ Library
|
#include <monero_daemon.h>
Public Member Functions | |
| virtual | ~monero_daemon () |
| virtual void | add_listener (monero_daemon_listener &listener) |
| virtual void | remove_listener (monero_daemon_listener &listener) |
| virtual std::set< monero_daemon_listener * > | get_listeners () |
| virtual void | remove_listeners () |
| virtual monero_version | get_version () |
| virtual bool | is_trusted () |
| virtual uint64_t | get_height () |
| virtual std::string | get_block_hash (uint64_t height) |
| virtual std::shared_ptr< monero_block_template > | get_block_template (const std::string &wallet_address, const boost::optional< int > &reserve_size=boost::none) |
| virtual std::shared_ptr< monero_miner_data > | get_miner_data () |
| virtual std::string | calculate_pow (uint32_t major_version, uint64_t height, const std::string &block_blob, const std::string &seed_hash) |
| virtual 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) |
| virtual std::shared_ptr< monero_block_header > | get_last_block_header () |
| virtual std::shared_ptr< monero_block_header > | get_block_header_by_hash (const std::string &block_hash) |
| virtual std::shared_ptr< monero_block_header > | get_block_header_by_height (uint64_t height) |
| virtual std::vector< std::shared_ptr< monero_block_header > > | get_block_headers_by_range (uint64_t start_height, uint64_t end_height) |
| virtual std::shared_ptr< monero_block > | get_block_by_hash (const std::string &block_hash) |
| virtual 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) |
| virtual std::shared_ptr< monero_block > | get_block_by_height (uint64_t height) |
| virtual std::vector< std::shared_ptr< monero_block > > | get_blocks_by_height (const std::vector< uint64_t > &heights) |
| virtual std::vector< std::shared_ptr< monero_block > > | get_blocks_by_range (boost::optional< uint64_t > start_height, boost::optional< uint64_t > end_height) |
| virtual 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) |
| virtual std::shared_ptr< monero_get_block_hashes_result > | get_block_hashes (const std::vector< std::string > &block_hashes) |
| virtual std::shared_ptr< monero_tx > | get_tx (const std::string &tx_hash, bool prune=false) |
| virtual std::vector< std::shared_ptr< monero_tx > > | get_txs (const std::vector< std::string > &tx_hashes, bool prune=false) |
| virtual boost::optional< std::string > | get_tx_hex (const std::string &tx_hash, bool prune=false) |
| virtual std::vector< std::string > | get_tx_hexes (const std::vector< std::string > &tx_hashes, bool prune=false) |
| virtual std::shared_ptr< monero_miner_tx_sum > | get_miner_tx_sum (uint64_t height, uint64_t num_blocks) |
| virtual std::shared_ptr< monero_fee_estimate > | get_fee_estimate (uint64_t grace_blocks=0) |
| virtual std::shared_ptr< monero_submit_tx_result > | submit_tx_hex (const std::string &tx_hex, bool do_not_relay=false) |
| virtual void | relay_tx_by_hash (const std::string &tx_hash) |
| virtual void | relay_txs_by_hash (const std::vector< std::string > &tx_hashes) |
| virtual std::vector< std::shared_ptr< monero_tx > > | get_tx_pool () |
| virtual std::vector< std::string > | get_tx_pool_hashes () |
| virtual std::vector< monero_tx_backlog_entry > | get_tx_pool_backlog () |
| virtual std::shared_ptr< monero_tx_pool_stats > | get_tx_pool_stats () |
| virtual void | flush_tx_pool () |
| virtual void | flush_tx_pool (const std::vector< std::string > &hashes) |
| virtual void | flush_tx_pool (const std::string &hash) |
| virtual monero_key_image_spent_status | get_key_image_spent_status (const std::string &key_image) |
| virtual std::vector< monero_key_image_spent_status > | get_key_image_spent_statuses (const std::vector< std::string > &key_images) |
| virtual std::vector< uint64_t > | get_output_indices (const std::string &tx_hash) |
| virtual std::vector< std::shared_ptr< monero_output > > | get_outputs (const std::vector< monero_output > &outputs) |
| virtual 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) |
| virtual 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) |
| virtual std::shared_ptr< monero_daemon_info > | get_info () |
| virtual std::shared_ptr< monero_daemon_sync_info > | get_sync_info () |
| virtual std::shared_ptr< monero_daemon_network_stats > | get_network_stats () |
| virtual std::shared_ptr< monero_hard_fork_info > | get_hard_fork_info () |
| virtual std::vector< std::shared_ptr< monero_alt_chain > > | get_alt_chains () |
| virtual std::vector< std::string > | get_alt_block_hashes () |
| virtual int | get_download_limit () |
| virtual int | set_download_limit (int limit) |
| virtual int | reset_download_limit () |
| virtual int | get_upload_limit () |
| virtual int | set_upload_limit (int limit) |
| virtual int | reset_upload_limit () |
| virtual std::vector< std::shared_ptr< monero_peer > > | get_peers () |
| virtual std::vector< std::shared_ptr< monero_peer > > | get_known_peers () |
| virtual std::vector< std::shared_ptr< monero_peer > > | get_public_peers (bool include_offline=false) |
| virtual void | set_outgoing_peer_limit (int limit) |
| virtual void | set_incoming_peer_limit (int limit) |
| virtual std::vector< std::shared_ptr< monero_ban > > | get_peer_bans () |
| virtual void | set_peer_bans (const std::vector< std::shared_ptr< monero_ban > > &bans) |
| virtual void | set_peer_ban (const std::shared_ptr< monero_ban > &ban) |
| virtual std::shared_ptr< monero_ban > | get_peer_ban (const std::string &address) |
| virtual void | start_mining (const std::string &address, boost::optional< uint64_t > num_threads, boost::optional< bool > is_background, boost::optional< bool > ignore_battery) |
| virtual void | stop_mining () |
| virtual std::shared_ptr< monero_mining_status > | get_mining_status () |
| virtual 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) |
| virtual void | submit_block (const std::string &block_blob) |
| virtual void | submit_blocks (const std::vector< std::string > &block_blobs) |
| virtual std::shared_ptr< monero_prune_result > | prune_blockchain (bool check) |
| virtual void | save_blockchain () |
| virtual uint64_t | pop_blocks (uint64_t num_blocks) |
| virtual void | flush_cache (bool bad_blocks=false) |
| virtual void | set_bootstrap_daemon (const std::string &address, const std::string &username="", const std::string &password="", const std::string &proxy="") |
| virtual void | remove_bootstrap_daemon () |
| virtual void | set_log_hash_rate (bool is_visible) |
| virtual void | set_log_level (int level) |
| virtual std::string | set_log_categories (const std::string &categories="") |
| virtual std::shared_ptr< monero_daemon_update_check_result > | check_for_update () |
| virtual std::shared_ptr< monero_daemon_update_download_result > | download_update (const std::string &path="") |
| virtual void | stop () |
| virtual std::shared_ptr< monero_block_header > | wait_for_next_block_header () |
Monero daemon interface.
|
inlinevirtual |
Virtual destructor.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Register a listener receive daemon notifications.
| listener | is the listener to receive daemon notifications |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
|
inlinevirtual |
Download an update.
| path | is the path to download the update (optional) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Flush the daemon's invalid block and transaction caches.
| bad_blocks | specifies to flush the bad blocks cache (default false) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Flushes all transactions from the tx pool.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Flush a single transaction from the tx pool.
| hash | is the hash of transaction to flush |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Flush transactions from the tx pool.
| hashes | are hashes of transactions to flush |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get known block hashes which are not on the main chain.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get alternative chains seen by the node.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a block by hash.
| block_hash | is the hash of the block to get |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a block by height.
| height | is the height of the block to get |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a block's hash by its height.
| height | is the height of the block hash to get |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a block header by its hash.
| block_hash | is the hash of the block to get the header of |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a block header by its height.
| height | is the height of the block to get the header of |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get blocks at the given heights.
| heights | are the heights of the blocks to get |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the download bandwidth limit.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get mining fee estimates per kB.
| grace_blocks | TODO |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Look up information regarding hard fork voting and readiness.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the number of blocks in the longest chain known to the node.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get general information about the state of the node and the network.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the spent status of the given key image.
| key_image | is key image hex to get the status of |
|
inlinevirtual |
Get the spent status of each given key image.
| key_image | are hex key images to get the statuses of |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get all known peers including their last known online status.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the last block's header.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the listeners registered with the daemon.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the daemon's mining status.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get network (bandwidth) statistics since the daemon started.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get outputs identified by a list of output amounts and indices as a binary request.
| outputs | identify each output by amount and index |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
|
inlinevirtual |
Get peers with active incoming or outgoing connections to the node.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get public nodes known to the daemon.
| include_offline | specifies if offline nodes should be included (default false) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get synchronization information.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get a transaction by hash.
| tx_hash | is the hash of the transaction to get |
| prune | specifies if the returned tx should be pruned (defaults to false) |
|
inlinevirtual |
Get a transaction hex by hash.
| tx_hash | is the hash of the transaction to get hex from |
| prune | specifies if the returned tx hex should be pruned (defaults to false) |
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get all transaction pool backlog.
|
inlinevirtual |
Get hashes of transactions in the transaction pool.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Get transaction pool statistics.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the upload bandwidth limit.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
|
inlinevirtual |
Indicates if the daemon is trusted or untrusted.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Pop (remove) blocks from the top of the blockchain.
| num_blocks | is the number of blocks to pop |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Prune the blockchain.
| check | specifies to check the pruning (default false) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Relays a transaction by hash.
| tx_hash | identifies the transaction to relay |
|
inlinevirtual |
Relays transactions by hash.
| tx_hashes | identify the transactions to relay |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Disable the bootstrap daemon so the daemon no longer falls back to it.
|
inlinevirtual |
Unregister a listener to receive daemon notifications.
| listener | is the listener to unregister |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Remove all listeners registered with the daemon.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Reset the download bandwidth limit.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Reset the upload bandwidth limit.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Save (flush) the blockchain to disk.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Set the download bandwidth limit.
| limit | is the download limit to set (-1 to reset to default) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Limit number of incoming peers.
| limit | is the maximum number of incoming peers |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Show or hide the mining hash rate in the daemon's console log.
| is_visible | specifies if the hash rate should be logged |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Set the daemon's log level.
| level | is the log level to set, from 0 (least verbose) to 4 (most verbose) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Limit number of outgoing peers.
| limit | is the maximum number of outgoing peers |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Ban a peer node.
| ban | contains information about a node to ban |
|
inlinevirtual |
Ban peers nodes.
| bans | are bans to apply against peer nodes |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Set the upload bandwidth limit.
| limit | is the upload limit to set (-1 to reset to default) |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Safely disconnect and shut down the daemon.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Stop mining.
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
Submit a mined block to the network.
| block_blob | is the mined block to submit |
|
inlinevirtual |
Submit mined blocks to the network.
| block_blobs | are the mined blocks to submit |
Reimplemented in monero::monero_daemon_rpc.
|
inlinevirtual |
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 in monero::monero_daemon_rpc.
|
inlinevirtual |
Get the header of the next block added to the chain.
Reimplemented in monero::monero_daemon_rpc.