|
monero-c
C ABI for using Monero
|


Go to the source code of this file.
Data Structures | |
| struct | monero_daemon_listener_callbacks |
| Callbacks of a daemon listener. More... | |
Typedefs | |
| typedef struct monero_daemon | monero_daemon |
| Copyright (c) Libmonero. | |
| typedef struct monero_daemon_listener | monero_daemon_listener |
| Opaque listener that receives the daemon's notifications. | |
| typedef void(* | monero_daemon_on_block_header_fn) (void *user_data, const char *header_json) |
| Called with the JSON of each new block header. | |
| typedef struct monero_daemon_listener_callbacks | monero_daemon_listener_callbacks |
| Callbacks of a daemon listener. | |
| typedef enum monero_key_image_spent_status | monero_key_image_spent_status |
| Spent status of a key image. | |
Enumerations | |
| enum | monero_key_image_spent_status { MONERO_KEY_IMAGE_NOT_SPENT = 0 , MONERO_KEY_IMAGE_CONFIRMED = 1 , MONERO_KEY_IMAGE_TX_POOL = 2 } |
| Spent status of a key image. More... | |
Functions | |
| MONERO_EXPORT monero_result | monero_daemon_connect (const char *uri, const char *username, const char *password, const char *proxy_uri, uint32_t timeout_ms, monero_daemon **out_daemon) |
| Create a daemon RPC client and checks the connection, which can take a while if the daemon is slow to answer. | |
| MONERO_EXPORT monero_result | monero_daemon_connect_with (monero_rpc_connection *connection, monero_daemon **out_daemon) |
| Create a daemon RPC client that shares a connection, with its proxy, timeout and TLS settings. | |
| MONERO_EXPORT void | monero_daemon_free (monero_daemon *daemon) |
| Release a handle returned by monero_daemon_connect(). | |
| MONERO_EXPORT monero_result | monero_daemon_get_rpc_connection (monero_daemon *daemon, char **out_json) |
| Get the connection to the daemon. | |
| MONERO_EXPORT monero_result | monero_daemon_set_poll_period (monero_daemon *daemon, uint64_t period_ms) |
| Set how often the listeners poll the daemon for new blocks. | |
| MONERO_EXPORT monero_result | monero_daemon_listener_create (const monero_daemon_listener_callbacks *callbacks, monero_daemon_listener **out_listener) |
| Create a listener that forwards the daemon's notifications to the callbacks. | |
| MONERO_EXPORT void | monero_daemon_listener_free (monero_daemon_listener *listener) |
| Release a listener. | |
| MONERO_EXPORT monero_result | monero_daemon_add_listener (monero_daemon *daemon, monero_daemon_listener *listener) |
| Register a listener. | |
| MONERO_EXPORT monero_result | monero_daemon_remove_listener (monero_daemon *daemon, monero_daemon_listener *listener) |
| Unregister a listener. | |
| MONERO_EXPORT monero_result | monero_daemon_get_listeners (monero_daemon *daemon, monero_daemon_listener ***out_listeners, size_t *out_count) |
| Get the listeners registered with the daemon. | |
| MONERO_EXPORT monero_result | monero_daemon_remove_listeners (monero_daemon *daemon) |
| Unregister all listeners of the daemon. | |
| MONERO_EXPORT monero_result | monero_daemon_get_version (monero_daemon *daemon, char **out_json) |
| Get the daemon's version. | |
| MONERO_EXPORT monero_result | monero_daemon_is_trusted (monero_daemon *daemon, bool *out_trusted) |
| Indicates if the daemon is trusted or untrusted. | |
| MONERO_EXPORT monero_result | monero_daemon_get_height (monero_daemon *daemon, uint64_t *out_height) |
| Get the number of blocks in the longest chain known to the node. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_hash (monero_daemon *daemon, uint64_t height, char **out_hash) |
| Get a block's hash by its height. | |
| MONERO_EXPORT monero_result | monero_daemon_get_info (monero_daemon *daemon, char **out_json) |
| Get general information about the state of the node and the network. | |
| MONERO_EXPORT monero_result | monero_daemon_get_sync_info (monero_daemon *daemon, char **out_json) |
| Get synchronization information. | |
| MONERO_EXPORT monero_result | monero_daemon_get_network_stats (monero_daemon *daemon, char **out_json) |
| Get network (bandwidth) statistics since the daemon started. | |
| MONERO_EXPORT monero_result | monero_daemon_get_hard_fork_info (monero_daemon *daemon, char **out_json) |
| Look up information regarding hard fork voting and readiness. | |
| MONERO_EXPORT monero_result | monero_daemon_get_alt_chains (monero_daemon *daemon, char **out_json) |
| Get the alternative chains seen by the node. | |
| MONERO_EXPORT monero_result | monero_daemon_get_alt_block_hashes (monero_daemon *daemon, char **out_json) |
| Get the known block hashes that are not on the main chain. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_template (monero_daemon *daemon, const char *wallet_address, const int32_t *reserve_size, char **out_json) |
| Get a block template for mining a new block. | |
| MONERO_EXPORT monero_result | monero_daemon_get_miner_data (monero_daemon *daemon, char **out_json) |
| Get the data needed to build a block template, for pools that assemble their own. | |
| MONERO_EXPORT monero_result | monero_daemon_calculate_pow (monero_daemon *daemon, uint32_t major_version, uint64_t height, const char *block_blob, const char *seed_hash, char **out_pow_hash) |
| Calculate the proof-of-work hash of a mined block. | |
| MONERO_EXPORT monero_result | monero_daemon_add_auxiliary_pow (monero_daemon *daemon, const char *block_template_blob, const char *aux_pow_json, char **out_json) |
| Add auxiliary proof-of-work to a block template for merge mining. | |
| MONERO_EXPORT monero_result | monero_daemon_get_mining_status (monero_daemon *daemon, char **out_json) |
| Get the daemon's mining status. | |
| MONERO_EXPORT monero_result | monero_daemon_start_mining (monero_daemon *daemon, const char *address, const uint64_t *num_threads, const bool *is_background, const bool *ignore_battery) |
| Start mining. | |
| MONERO_EXPORT monero_result | monero_daemon_stop_mining (monero_daemon *daemon) |
| Stop mining. | |
| MONERO_EXPORT monero_result | monero_daemon_generate_blocks (monero_daemon *daemon, const char *wallet_address, uint64_t num_blocks, const char *prev_block_hash, const uint32_t *starting_nonce, char **out_json) |
| Generate blocks to a wallet address. | |
| MONERO_EXPORT monero_result | monero_daemon_submit_block (monero_daemon *daemon, const char *block_blob) |
| Submit a mined block to the network. | |
| MONERO_EXPORT monero_result | monero_daemon_submit_blocks (monero_daemon *daemon, const char *const *block_blobs, size_t num_block_blobs) |
| Submit mined blocks to the network. | |
| MONERO_EXPORT monero_result | monero_daemon_get_last_block_header (monero_daemon *daemon, char **out_json) |
| Get the header of the last block. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_header_by_hash (monero_daemon *daemon, const char *block_hash, char **out_json) |
| Get a block header by its hash. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_header_by_height (monero_daemon *daemon, uint64_t height, char **out_json) |
| Get a block header by its height. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_headers_by_range (monero_daemon *daemon, uint64_t start_height, uint64_t end_height, char **out_json) |
| Get block headers in the given height range. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_by_hash (monero_daemon *daemon, const char *block_hash, char **out_json) |
| Get a block by its hash. | |
| MONERO_EXPORT monero_result | monero_daemon_get_blocks_by_hash (monero_daemon *daemon, const char *const *block_hashes, size_t num_block_hashes, uint64_t start_height, bool prune, uint64_t max_block_count, char **out_json) |
| Get blocks by hash. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_by_height (monero_daemon *daemon, uint64_t height, char **out_json) |
| Get a block by its height. | |
| MONERO_EXPORT monero_result | monero_daemon_get_blocks_by_height (monero_daemon *daemon, const uint64_t *heights, size_t num_heights, char **out_json) |
| Get blocks at the given heights. | |
| MONERO_EXPORT monero_result | monero_daemon_get_blocks_by_range (monero_daemon *daemon, const uint64_t *start_height, const uint64_t *end_height, char **out_json) |
| Get blocks in the given height range. | |
| MONERO_EXPORT monero_result | monero_daemon_get_blocks_by_range_chunked (monero_daemon *daemon, const uint64_t *start_height, const uint64_t *end_height, const uint64_t *max_chunk_size, char **out_json) |
| Get blocks in the given height range, in chunked requests. | |
| MONERO_EXPORT monero_result | monero_daemon_get_block_hashes (monero_daemon *daemon, const char *const *block_hashes, size_t num_block_hashes, char **out_json) |
| Get block hashes from a chain history, using the same format as monero_daemon_get_blocks_by_hash(). | |
| MONERO_EXPORT monero_result | monero_daemon_wait_for_next_block_header (monero_daemon *daemon, char **out_json) |
| Wait for the next block and return its header. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx (monero_daemon *daemon, const char *tx_hash, bool prune, char **out_json) |
| Get a transaction by its hash. | |
| MONERO_EXPORT monero_result | monero_daemon_get_txs (monero_daemon *daemon, const char *const *tx_hashes, size_t num_tx_hashes, bool prune, char **out_json) |
| Get transactions by their hashes. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_hex (monero_daemon *daemon, const char *tx_hash, bool prune, char **out_tx_hex) |
| Get a transaction's hex by its hash. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_hexes (monero_daemon *daemon, const char *const *tx_hashes, size_t num_tx_hashes, bool prune, char **out_json) |
| Get transaction hexes by their hashes. | |
| MONERO_EXPORT monero_result | monero_daemon_get_miner_tx_sum (monero_daemon *daemon, uint64_t height, uint64_t num_blocks, char **out_json) |
| Get the total emissions and fees from the genesis block up to the given height. | |
| MONERO_EXPORT monero_result | monero_daemon_get_fee_estimate (monero_daemon *daemon, uint64_t grace_blocks, char **out_json) |
| Get the mining fee estimates per kB. | |
| MONERO_EXPORT monero_result | monero_daemon_submit_tx_hex (monero_daemon *daemon, const char *tx_hex, bool do_not_relay, char **out_json) |
| Submit a transaction to the daemon's pool. | |
| MONERO_EXPORT monero_result | monero_daemon_relay_tx_by_hash (monero_daemon *daemon, const char *tx_hash) |
| Relay a transaction by its hash. | |
| MONERO_EXPORT monero_result | monero_daemon_relay_txs_by_hash (monero_daemon *daemon, const char *const *tx_hashes, size_t num_tx_hashes) |
| Relay transactions by their hashes. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_pool (monero_daemon *daemon, char **out_json) |
| Get the valid transactions seen by the node but not yet mined into a block. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_pool_hashes (monero_daemon *daemon, char **out_json) |
| Get the hashes of the transactions in the transaction pool. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_pool_backlog (monero_daemon *daemon, char **out_json) |
| Get the transaction pool backlog. | |
| MONERO_EXPORT monero_result | monero_daemon_get_tx_pool_stats (monero_daemon *daemon, char **out_json) |
| Get statistics about the transaction pool. | |
| MONERO_EXPORT monero_result | monero_daemon_flush_tx_pool (monero_daemon *daemon) |
| Flush all transactions from the transaction pool. | |
| MONERO_EXPORT monero_result | monero_daemon_flush_tx_pool_hashes (monero_daemon *daemon, const char *const *tx_hashes, size_t num_tx_hashes) |
| Flush transactions from the transaction pool by their hashes. | |
| MONERO_EXPORT monero_result | monero_daemon_flush_tx_pool_hash (monero_daemon *daemon, const char *tx_hash) |
| Flush a single transaction from the transaction pool. | |
| MONERO_EXPORT monero_result | monero_daemon_get_key_image_spent_status (monero_daemon *daemon, const char *key_image, monero_key_image_spent_status *out_status) |
| Get the spent status of a key image. | |
| MONERO_EXPORT monero_result | monero_daemon_get_key_image_spent_statuses (monero_daemon *daemon, const char *const *key_images, size_t num_key_images, monero_key_image_spent_status **out_statuses, size_t *out_count) |
| Get the spent status of each of the given key images. | |
| MONERO_EXPORT monero_result | monero_daemon_get_output_indices (monero_daemon *daemon, const char *tx_hash, uint64_t **out_indices, size_t *out_count) |
| Get the global output index of each output in a transaction. | |
| MONERO_EXPORT monero_result | monero_daemon_get_outputs (monero_daemon *daemon, const char *outputs_json, char **out_json) |
| Get outputs identified by amount and index. | |
| MONERO_EXPORT monero_result | monero_daemon_get_output_histogram (monero_daemon *daemon, const uint64_t *amounts, size_t num_amounts, const int32_t *min_count, const int32_t *max_count, const bool *is_unlocked, const int32_t *recent_cutoff, char **out_json) |
| Get a histogram of output amounts: for each amount, the number of outputs on the chain. | |
| MONERO_EXPORT monero_result | monero_daemon_get_output_distribution (monero_daemon *daemon, const uint64_t *amounts, size_t num_amounts, const bool *is_cumulative, const uint64_t *start_height, const uint64_t *end_height, char **out_json) |
| Create an output distribution for the given amounts. | |
| MONERO_EXPORT monero_result | monero_daemon_get_download_limit (monero_daemon *daemon, int32_t *out_limit) |
| Get the download bandwidth limit. | |
| MONERO_EXPORT monero_result | monero_daemon_set_download_limit (monero_daemon *daemon, int32_t limit, int32_t *out_limit) |
| Set the download bandwidth limit. | |
| MONERO_EXPORT monero_result | monero_daemon_reset_download_limit (monero_daemon *daemon, int32_t *out_limit) |
| Reset the download bandwidth limit to the default. | |
| MONERO_EXPORT monero_result | monero_daemon_get_upload_limit (monero_daemon *daemon, int32_t *out_limit) |
| Get the upload bandwidth limit. | |
| MONERO_EXPORT monero_result | monero_daemon_set_upload_limit (monero_daemon *daemon, int32_t limit, int32_t *out_limit) |
| Set the upload bandwidth limit. | |
| MONERO_EXPORT monero_result | monero_daemon_reset_upload_limit (monero_daemon *daemon, int32_t *out_limit) |
| Reset the upload bandwidth limit to the default. | |
| MONERO_EXPORT monero_result | monero_daemon_get_peers (monero_daemon *daemon, char **out_json) |
| Get the peers with active incoming or outgoing connections to the node. | |
| MONERO_EXPORT monero_result | monero_daemon_get_known_peers (monero_daemon *daemon, char **out_json) |
| Get all known peers, including their last known online status. | |
| MONERO_EXPORT monero_result | monero_daemon_get_public_peers (monero_daemon *daemon, bool include_offline, char **out_json) |
| Get the public nodes known to the daemon. | |
| MONERO_EXPORT monero_result | monero_daemon_set_outgoing_peer_limit (monero_daemon *daemon, int32_t limit) |
| Limits the number of outgoing peers. | |
| MONERO_EXPORT monero_result | monero_daemon_set_incoming_peer_limit (monero_daemon *daemon, int32_t limit) |
| Limits the number of incoming peers. | |
| MONERO_EXPORT monero_result | monero_daemon_get_peer_bans (monero_daemon *daemon, char **out_json) |
| Get the peer bans. | |
| MONERO_EXPORT monero_result | monero_daemon_set_peer_bans (monero_daemon *daemon, const char *bans_json) |
| Bans peer nodes. | |
| MONERO_EXPORT monero_result | monero_daemon_set_peer_ban (monero_daemon *daemon, const char *ban_json) |
| Bans a peer node. | |
| MONERO_EXPORT monero_result | monero_daemon_get_peer_ban (monero_daemon *daemon, const char *address, char **out_json) |
| Get the ban status of a peer node. | |
| MONERO_EXPORT monero_result | monero_daemon_prune_blockchain (monero_daemon *daemon, bool check, char **out_json) |
| Prunes the blockchain. | |
| MONERO_EXPORT monero_result | monero_daemon_save_blockchain (monero_daemon *daemon) |
| Saves (flushes) the blockchain to disk. | |
| MONERO_EXPORT monero_result | monero_daemon_pop_blocks (monero_daemon *daemon, uint64_t num_blocks, uint64_t *out_height) |
| Pops (removes) blocks from the top of the blockchain. | |
| MONERO_EXPORT monero_result | monero_daemon_flush_cache (monero_daemon *daemon, bool bad_blocks) |
| Flush the daemon's invalid block and transaction caches. | |
| MONERO_EXPORT monero_result | monero_daemon_set_bootstrap_daemon (monero_daemon *daemon, const char *address, const char *username, const char *password, const char *proxy) |
| Set the bootstrap daemon the node uses to serve requests while it is not fully synced. | |
| MONERO_EXPORT monero_result | monero_daemon_remove_bootstrap_daemon (monero_daemon *daemon) |
| Disables the bootstrap daemon, so the node no longer falls back to it. | |
| MONERO_EXPORT monero_result | monero_daemon_set_log_hash_rate (monero_daemon *daemon, bool is_visible) |
| Show or hide the mining hash rate in the daemon's console log. | |
| MONERO_EXPORT monero_result | monero_daemon_set_log_level (monero_daemon *daemon, int32_t level) |
| Set the daemon's log level. | |
| MONERO_EXPORT monero_result | monero_daemon_set_log_categories (monero_daemon *daemon, const char *categories, char **out_categories) |
| Set the daemon's log categories, e.g. | |
| MONERO_EXPORT monero_result | monero_daemon_check_for_update (monero_daemon *daemon, char **out_json) |
| Check for an update. | |
| MONERO_EXPORT monero_result | monero_daemon_download_update (monero_daemon *daemon, const char *path, char **out_json) |
| Downloads an update. | |
| MONERO_EXPORT monero_result | monero_daemon_stop (monero_daemon *daemon) |
| Safely disconnects from and shuts down the daemon. | |
| typedef struct monero_daemon monero_daemon |
Copyright (c) Libmonero.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Opaque handle to a daemon RPC client. Create it with monero_daemon_connect() and release it with monero_daemon_free(). Calls return MONERO_ERROR if the daemon can't be reached or answers with an error.
| typedef struct monero_daemon_listener monero_daemon_listener |
Opaque listener that receives the daemon's notifications.
Create it with monero_daemon_listener_create() and release it with monero_daemon_listener_free().
| typedef struct monero_daemon_listener_callbacks monero_daemon_listener_callbacks |
Callbacks of a daemon listener.
The struct is copied by monero_daemon_listener_create().
| typedef void(* monero_daemon_on_block_header_fn) (void *user_data, const char *header_json) |
Called with the JSON of each new block header.
The string is valid only during the call. The callback runs on a thread owned by monero-cpp. Inside it, monero_daemon_remove_listener() and monero_daemon_remove_listeners() are safe. Don't free the listener or the daemon from inside it. Free them after the callback returns.
| user_data | is the user_data of the monero_daemon_listener_callbacks |
| header_json | is the JSON-serialized monero_block_header |
Spent status of a key image.
The values match monero-cpp's monero_key_image_spent_status.
| MONERO_EXPORT monero_result monero_daemon_add_auxiliary_pow | ( | monero_daemon * | daemon, |
| const char * | block_template_blob, | ||
| const char * | aux_pow_json, | ||
| char ** | out_json | ||
| ) |
Add auxiliary proof-of-work to a block template for merge mining.
The Merkle root of the updated template commits to the auxiliary blocks.
| daemon | is the handle returned by monero_daemon_connect() |
| block_template_blob | is the block template blob to add auxiliary PoW to |
| aux_pow_json | is a JSON array of monero_auxiliary_pow, one per auxiliary chain |
| out_json | receives a JSON-serialized monero_add_auxiliary_pow_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_add_listener | ( | monero_daemon * | daemon, |
| monero_daemon_listener * | listener | ||
| ) |
Register a listener.
Adding a listener that is already registered does nothing. A listener can be registered with one daemon at a time, so adding it to another daemon fails until it is removed from the first one.
| daemon | is the handle returned by monero_daemon_connect() |
| listener | is the listener to register |
| MONERO_EXPORT monero_result monero_daemon_calculate_pow | ( | monero_daemon * | daemon, |
| uint32_t | major_version, | ||
| uint64_t | height, | ||
| const char * | block_blob, | ||
| const char * | seed_hash, | ||
| char ** | out_pow_hash | ||
| ) |
Calculate the proof-of-work hash of a mined block.
| daemon | is the handle returned by monero_daemon_connect() |
| 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 and cache |
| out_pow_hash | receives the proof-of-work hash, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_check_for_update | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Check for an update.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_daemon_update_check_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_connect | ( | const char * | uri, |
| const char * | username, | ||
| const char * | password, | ||
| const char * | proxy_uri, | ||
| uint32_t | timeout_ms, | ||
| monero_daemon ** | out_daemon | ||
| ) |
Create a daemon RPC client and checks the connection, which can take a while if the daemon is slow to answer.
It still succeeds if the daemon is unreachable. The calls that query the daemon report the failure.
| uri | is the daemon RPC URI, e.g. "http://127.0.0.1:18081" |
| username | is the RPC username, or "" for none |
| password | is the RPC password, or "" for none |
| proxy_uri | is the proxy to connect through, or "" for none |
| timeout_ms | is the RPC timeout in milliseconds, or 0 for the default |
| out_daemon | receives the new handle, released with monero_daemon_free() |
| MONERO_EXPORT monero_result monero_daemon_connect_with | ( | monero_rpc_connection * | connection, |
| monero_daemon ** | out_daemon | ||
| ) |
Create a daemon RPC client that shares a connection, with its proxy, timeout and TLS settings.
It checks the connection if it isn't online yet, and succeeds even if the daemon is unreachable.
| connection | is the connection to the daemon. It can be freed after the call |
| out_daemon | receives the new handle, released with monero_daemon_free() |
| MONERO_EXPORT monero_result monero_daemon_download_update | ( | monero_daemon * | daemon, |
| const char * | path, | ||
| char ** | out_json | ||
| ) |
Downloads an update.
| daemon | is the handle returned by monero_daemon_connect() |
| path | is the path to download the update to, or "" for the daemon's default |
| out_json | receives a JSON-serialized monero_daemon_update_download_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_flush_cache | ( | monero_daemon * | daemon, |
| bool | bad_blocks | ||
| ) |
Flush the daemon's invalid block and transaction caches.
| daemon | is the handle returned by monero_daemon_connect() |
| bad_blocks | specifies if the bad blocks cache is flushed too |
| MONERO_EXPORT monero_result monero_daemon_flush_tx_pool | ( | monero_daemon * | daemon | ) |
Flush all transactions from the transaction pool.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_flush_tx_pool_hash | ( | monero_daemon * | daemon, |
| const char * | tx_hash | ||
| ) |
Flush a single transaction from the transaction pool.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hash | is the hash of the transaction to flush |
| MONERO_EXPORT monero_result monero_daemon_flush_tx_pool_hashes | ( | monero_daemon * | daemon, |
| const char *const * | tx_hashes, | ||
| size_t | num_tx_hashes | ||
| ) |
Flush transactions from the transaction pool by their hashes.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hashes | are the hashes of the transactions to flush |
| num_tx_hashes | is the number of elements in tx_hashes |
| MONERO_EXPORT void monero_daemon_free | ( | monero_daemon * | daemon | ) |
Release a handle returned by monero_daemon_connect().
Passing NULL does nothing.
| daemon | is the handle to release |
| MONERO_EXPORT monero_result monero_daemon_generate_blocks | ( | monero_daemon * | daemon, |
| const char * | wallet_address, | ||
| uint64_t | num_blocks, | ||
| const char * | prev_block_hash, | ||
| const uint32_t * | starting_nonce, | ||
| char ** | out_json | ||
| ) |
Generate blocks to a wallet address.
Regtest only.
| daemon | is the handle returned by monero_daemon_connect() |
| wallet_address | is the address that receives the miner transactions |
| num_blocks | is the number of blocks to generate |
| prev_block_hash | is the hash of the block to build on, or NULL to build on the tip |
| starting_nonce | is the starting nonce, or NULL for the daemon's default |
| out_json | receives a JSON-serialized monero_generate_blocks_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_alt_block_hashes | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the known block hashes that are not on the main chain.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of hex strings, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_alt_chains | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the alternative chains seen by the node.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of monero_alt_chain, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_by_hash | ( | monero_daemon * | daemon, |
| const char * | block_hash, | ||
| char ** | out_json | ||
| ) |
Get a block by its hash.
| daemon | is the handle returned by monero_daemon_connect() |
| block_hash | is the hash of the block |
| out_json | receives a JSON-serialized monero_block, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_by_height | ( | monero_daemon * | daemon, |
| uint64_t | height, | ||
| char ** | out_json | ||
| ) |
Get a block by its height.
| daemon | is the handle returned by monero_daemon_connect() |
| height | is the height of the block |
| out_json | receives a JSON-serialized monero_block, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_hash | ( | monero_daemon * | daemon, |
| uint64_t | height, | ||
| char ** | out_hash | ||
| ) |
Get a block's hash by its height.
| daemon | is the handle returned by monero_daemon_connect() |
| height | is the height of the block |
| out_hash | receives the block's hash, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_hashes | ( | monero_daemon * | daemon, |
| const char *const * | block_hashes, | ||
| size_t | num_block_hashes, | ||
| char ** | out_json | ||
| ) |
Get block hashes from a chain history, using the same format as monero_daemon_get_blocks_by_hash().
| daemon | is the handle returned by monero_daemon_connect() |
| block_hashes | is the chain history. The last hash must be the genesis block. |
| num_block_hashes | is the number of elements in block_hashes |
| out_json | receives a JSON-serialized monero_get_block_hashes_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_header_by_hash | ( | monero_daemon * | daemon, |
| const char * | block_hash, | ||
| char ** | out_json | ||
| ) |
Get a block header by its hash.
| daemon | is the handle returned by monero_daemon_connect() |
| block_hash | is the hash of the block |
| out_json | receives a JSON-serialized monero_block_header, or NULL if the daemon has no such block. Free with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_header_by_height | ( | monero_daemon * | daemon, |
| uint64_t | height, | ||
| char ** | out_json | ||
| ) |
Get a block header by its height.
| daemon | is the handle returned by monero_daemon_connect() |
| height | is the height of the block |
| out_json | receives a JSON-serialized monero_block_header, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_headers_by_range | ( | monero_daemon * | daemon, |
| uint64_t | start_height, | ||
| uint64_t | end_height, | ||
| char ** | out_json | ||
| ) |
Get block headers in the given height range.
| daemon | is the handle returned by monero_daemon_connect() |
| start_height | is the lower bound of the range, inclusive |
| end_height | is the upper bound of the range, inclusive |
| out_json | receives a JSON array of monero_block_header, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_block_template | ( | monero_daemon * | daemon, |
| const char * | wallet_address, | ||
| const int32_t * | reserve_size, | ||
| char ** | out_json | ||
| ) |
Get a block template for mining a new block.
| daemon | is the handle returned by monero_daemon_connect() |
| wallet_address | is the address that receives the miner transaction if the block is mined |
| reserve_size | is the reserve size, or NULL for none |
| out_json | receives a JSON-serialized monero_block_template, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_blocks_by_hash | ( | monero_daemon * | daemon, |
| const char *const * | block_hashes, | ||
| size_t | num_block_hashes, | ||
| uint64_t | start_height, | ||
| bool | prune, | ||
| uint64_t | max_block_count, | ||
| char ** | out_json | ||
| ) |
Get blocks by hash.
The hashes form a short chain history: the first 10 are consecutive, then the gap doubles, and the last one is always the genesis block.
| daemon | is the handle returned by monero_daemon_connect() |
| block_hashes | is the chain history |
| num_block_hashes | is the number of elements in block_hashes |
| start_height | is the height to resume from, used as-is when non-zero |
| prune | specifies if the returned blocks should be pruned |
| max_block_count | caps the number of blocks returned in one call, or 0 for the daemon's default |
| out_json | receives a JSON-serialized monero_get_blocks_by_hash_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_blocks_by_height | ( | monero_daemon * | daemon, |
| const uint64_t * | heights, | ||
| size_t | num_heights, | ||
| char ** | out_json | ||
| ) |
Get blocks at the given heights.
| daemon | is the handle returned by monero_daemon_connect() |
| heights | are the heights of the blocks |
| num_heights | is the number of elements in heights |
| out_json | receives a JSON array of monero_block, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_blocks_by_range | ( | monero_daemon * | daemon, |
| const uint64_t * | start_height, | ||
| const uint64_t * | end_height, | ||
| char ** | out_json | ||
| ) |
Get blocks in the given height range.
A range of more than 100000 blocks fails, so use monero_daemon_get_blocks_by_range_chunked() for a longer one.
| daemon | is the handle returned by monero_daemon_connect() |
| start_height | is the lower bound of the range, inclusive, or NULL for none |
| end_height | is the upper bound of the range, inclusive, or NULL for none |
| out_json | receives a JSON array of monero_block, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_blocks_by_range_chunked | ( | monero_daemon * | daemon, |
| const uint64_t * | start_height, | ||
| const uint64_t * | end_height, | ||
| const uint64_t * | max_chunk_size, | ||
| char ** | out_json | ||
| ) |
Get blocks in the given height range, in chunked requests.
| daemon | is the handle returned by monero_daemon_connect() |
| start_height | is the lower bound of the range, inclusive, or NULL for none |
| end_height | is the upper bound of the range, inclusive, or NULL for none |
| max_chunk_size | is the maximum size in bytes of each request, or NULL for the default. A larger block fails the call. |
| out_json | receives a JSON array of monero_block, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_download_limit | ( | monero_daemon * | daemon, |
| int32_t * | out_limit | ||
| ) |
Get the download bandwidth limit.
| daemon | is the handle returned by monero_daemon_connect() |
| out_limit | receives the limit |
| MONERO_EXPORT monero_result monero_daemon_get_fee_estimate | ( | monero_daemon * | daemon, |
| uint64_t | grace_blocks, | ||
| char ** | out_json | ||
| ) |
Get the mining fee estimates per kB.
| daemon | is the handle returned by monero_daemon_connect() |
| grace_blocks | is the number of grace blocks to use for the estimate |
| out_json | receives a JSON-serialized monero_fee_estimate, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_hard_fork_info | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Look up information regarding hard fork voting and readiness.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_hard_fork_info, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_height | ( | monero_daemon * | daemon, |
| uint64_t * | out_height | ||
| ) |
Get the number of blocks in the longest chain known to the node.
| daemon | is the handle returned by monero_daemon_connect() |
| out_height | receives the number of blocks |
| MONERO_EXPORT monero_result monero_daemon_get_info | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get general information about the state of the node and the network.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_daemon_info, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_key_image_spent_status | ( | monero_daemon * | daemon, |
| const char * | key_image, | ||
| monero_key_image_spent_status * | out_status | ||
| ) |
Get the spent status of a key image.
| daemon | is the handle returned by monero_daemon_connect() |
| key_image | is the key image hex |
| out_status | receives the spent status |
| MONERO_EXPORT monero_result monero_daemon_get_key_image_spent_statuses | ( | monero_daemon * | daemon, |
| const char *const * | key_images, | ||
| size_t | num_key_images, | ||
| monero_key_image_spent_status ** | out_statuses, | ||
| size_t * | out_count | ||
| ) |
Get the spent status of each of the given key images.
| daemon | is the handle returned by monero_daemon_connect() |
| key_images | are the key image hex strings |
| num_key_images | is the number of elements in key_images |
| out_statuses | receives an array of spent statuses, in order, freed with monero_utils_free() |
| out_count | receives the number of elements in out_statuses |
| MONERO_EXPORT monero_result monero_daemon_get_known_peers | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get all known peers, including their last known online status.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of monero_peer, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_last_block_header | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the header of the last block.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_block_header, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_listeners | ( | monero_daemon * | daemon, |
| monero_daemon_listener *** | out_listeners, | ||
| size_t * | out_count | ||
| ) |
Get the listeners registered with the daemon.
| daemon | is the handle returned by monero_daemon_connect() |
| out_listeners | receives an array of listener handles the caller still owns. Free the array with monero_utils_free() |
| out_count | receives the number of handles in out_listeners |
| MONERO_EXPORT monero_result monero_daemon_get_miner_data | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the data needed to build a block template, for pools that assemble their own.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_miner_data, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_miner_tx_sum | ( | monero_daemon * | daemon, |
| uint64_t | height, | ||
| uint64_t | num_blocks, | ||
| char ** | out_json | ||
| ) |
Get the total emissions and fees from the genesis block up to the given height.
| daemon | is the handle returned by monero_daemon_connect() |
| height | is the height to start the sum at |
| num_blocks | is the number of blocks to include in the sum |
| out_json | receives a JSON-serialized monero_miner_tx_sum, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_mining_status | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the daemon's mining status.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_mining_status, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_network_stats | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get network (bandwidth) statistics since the daemon started.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_daemon_network_stats, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_output_distribution | ( | monero_daemon * | daemon, |
| const uint64_t * | amounts, | ||
| size_t | num_amounts, | ||
| const bool * | is_cumulative, | ||
| const uint64_t * | start_height, | ||
| const uint64_t * | end_height, | ||
| char ** | out_json | ||
| ) |
Create an output distribution for the given amounts.
| daemon | is the handle returned by monero_daemon_connect() |
| amounts | are the amounts to make the distribution with |
| num_amounts | is the number of elements in amounts |
| is_cumulative | specifies if the results are cumulative, or NULL for the daemon's default |
| start_height | is the lower bound of the range, inclusive, or NULL for none |
| end_height | is the upper bound of the range, inclusive, or NULL for none |
| out_json | receives a JSON array of monero_output_distribution_entry, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_output_histogram | ( | monero_daemon * | daemon, |
| const uint64_t * | amounts, | ||
| size_t | num_amounts, | ||
| const int32_t * | min_count, | ||
| const int32_t * | max_count, | ||
| const bool * | is_unlocked, | ||
| const int32_t * | recent_cutoff, | ||
| char ** | out_json | ||
| ) |
Get a histogram of output amounts: for each amount, the number of outputs on the chain.
RingCT outputs count as amount 0.
| daemon | is the handle returned by monero_daemon_connect() |
| amounts | are the amounts to make the histogram with |
| num_amounts | is the number of elements in amounts |
| min_count | is the minimum count to include, or NULL for none |
| max_count | is the maximum count to include, or NULL for none |
| is_unlocked | selects the lock state of the outputs to count, or NULL for both |
| recent_cutoff | is the recent cutoff, or NULL for none |
| out_json | receives a JSON array of monero_output_histogram_entry, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_output_indices | ( | monero_daemon * | daemon, |
| const char * | tx_hash, | ||
| uint64_t ** | out_indices, | ||
| size_t * | out_count | ||
| ) |
Get the global output index of each output in a transaction.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hash | is the hash of the transaction |
| out_indices | receives the output indices, in order, freed with monero_utils_free() |
| out_count | receives the number of elements in out_indices |
| MONERO_EXPORT monero_result monero_daemon_get_outputs | ( | monero_daemon * | daemon, |
| const char * | outputs_json, | ||
| char ** | out_json | ||
| ) |
Get outputs identified by amount and index.
| daemon | is the handle returned by monero_daemon_connect() |
| outputs_json | is a JSON array of monero_output, each identified by amount and index |
| out_json | receives a JSON array of the outputs found, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_peer_ban | ( | monero_daemon * | daemon, |
| const char * | address, | ||
| char ** | out_json | ||
| ) |
Get the ban status of a peer node.
| daemon | is the handle returned by monero_daemon_connect() |
| address | is the address of the peer, e.g. "1.2.3.4" or "1.2.3.4:18080" |
| out_json | receives a JSON-serialized monero_ban, whose isBanned is false if the peer isn't banned. Free with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_peer_bans | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the peer bans.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of monero_ban, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_peers | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the peers with active incoming or outgoing connections to the node.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of monero_peer, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_public_peers | ( | monero_daemon * | daemon, |
| bool | include_offline, | ||
| char ** | out_json | ||
| ) |
Get the public nodes known to the daemon.
| daemon | is the handle returned by monero_daemon_connect() |
| include_offline | specifies if offline nodes are included |
| out_json | receives a JSON array of monero_peer, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_rpc_connection | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the connection to the daemon.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives the JSON-serialized monero_rpc_connection, with the password. Free with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_sync_info | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get synchronization information.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_daemon_sync_info, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx | ( | monero_daemon * | daemon, |
| const char * | tx_hash, | ||
| bool | prune, | ||
| char ** | out_json | ||
| ) |
Get a transaction by its hash.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hash | is the hash of the transaction |
| prune | specifies if the returned transaction should be pruned |
| out_json | receives a JSON object with the transaction in its block, {"blocks":[...]}. The block has the height and the timestamp of the transaction, and neither if it is in the pool. It is NULL if the daemon doesn't have the transaction. Free with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_hex | ( | monero_daemon * | daemon, |
| const char * | tx_hash, | ||
| bool | prune, | ||
| char ** | out_tx_hex | ||
| ) |
Get a transaction's hex by its hash.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hash | is the hash of the transaction |
| prune | specifies if the returned hex should be pruned |
| out_tx_hex | receives the transaction hex, or NULL if the daemon doesn't have it. Free with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_hexes | ( | monero_daemon * | daemon, |
| const char *const * | tx_hashes, | ||
| size_t | num_tx_hashes, | ||
| bool | prune, | ||
| char ** | out_json | ||
| ) |
Get transaction hexes by their hashes.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hashes | are the hashes of the transactions |
| num_tx_hashes | is the number of elements in tx_hashes |
| prune | specifies if the returned hexes should be pruned |
| out_json | receives a JSON array of hex strings, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_pool | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the valid transactions seen by the node but not yet mined into a block.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON object with the transactions in one block that has no height, {"blocks":[...]}, and {"blocks":[]} if the pool is empty. Freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_pool_backlog | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the transaction pool backlog.
monero-cpp doesn't implement it, so this always fails.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of monero_tx_backlog_entry, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_pool_hashes | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the hashes of the transactions in the transaction pool.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON array of hex strings, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_tx_pool_stats | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get statistics about the transaction pool.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_tx_pool_stats, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_txs | ( | monero_daemon * | daemon, |
| const char *const * | tx_hashes, | ||
| size_t | num_tx_hashes, | ||
| bool | prune, | ||
| char ** | out_json | ||
| ) |
Get transactions by their hashes.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hashes | are the hashes of the transactions |
| num_tx_hashes | is the number of elements in tx_hashes |
| prune | specifies if the returned transactions should be pruned |
| out_json | receives a JSON object with the transactions found in their blocks, {"blocks":[...]}. The transactions of one block are in one block, which has its height and its timestamp, and the transactions of the pool are in one block that has neither. The blocks come in the order that they first appear, so the transactions are not always in the order of the hashes, and the caller sorts them. Freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_get_upload_limit | ( | monero_daemon * | daemon, |
| int32_t * | out_limit | ||
| ) |
Get the upload bandwidth limit.
| daemon | is the handle returned by monero_daemon_connect() |
| out_limit | receives the limit |
| MONERO_EXPORT monero_result monero_daemon_get_version | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Get the daemon's version.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_version, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_is_trusted | ( | monero_daemon * | daemon, |
| bool * | out_trusted | ||
| ) |
Indicates if the daemon is trusted or untrusted.
| daemon | is the handle returned by monero_daemon_connect() |
| out_trusted | receives true if the daemon is trusted, false otherwise |
| MONERO_EXPORT monero_result monero_daemon_listener_create | ( | const monero_daemon_listener_callbacks * | callbacks, |
| monero_daemon_listener ** | out_listener | ||
| ) |
Create a listener that forwards the daemon's notifications to the callbacks.
| callbacks | are the callbacks to call. They are copied. |
| out_listener | receives the new listener, released with monero_daemon_listener_free() |
| MONERO_EXPORT void monero_daemon_listener_free | ( | monero_daemon_listener * | listener | ) |
Release a listener.
If the listener is still registered with a daemon, it is unregistered first. Passing NULL does nothing.
| listener | is the listener to release |
| MONERO_EXPORT monero_result monero_daemon_pop_blocks | ( | monero_daemon * | daemon, |
| uint64_t | num_blocks, | ||
| uint64_t * | out_height | ||
| ) |
Pops (removes) blocks from the top of the blockchain.
| daemon | is the handle returned by monero_daemon_connect() |
| num_blocks | is the number of blocks to pop |
| out_height | receives the blockchain height after popping the blocks |
| MONERO_EXPORT monero_result monero_daemon_prune_blockchain | ( | monero_daemon * | daemon, |
| bool | check, | ||
| char ** | out_json | ||
| ) |
Prunes the blockchain.
| daemon | is the handle returned by monero_daemon_connect() |
| check | specifies if the pruning is checked |
| out_json | receives a JSON-serialized monero_prune_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_relay_tx_by_hash | ( | monero_daemon * | daemon, |
| const char * | tx_hash | ||
| ) |
Relay a transaction by its hash.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hash | is the hash of the transaction to relay |
| MONERO_EXPORT monero_result monero_daemon_relay_txs_by_hash | ( | monero_daemon * | daemon, |
| const char *const * | tx_hashes, | ||
| size_t | num_tx_hashes | ||
| ) |
Relay transactions by their hashes.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hashes | are the hashes of the transactions to relay |
| num_tx_hashes | is the number of elements in tx_hashes |
| MONERO_EXPORT monero_result monero_daemon_remove_bootstrap_daemon | ( | monero_daemon * | daemon | ) |
Disables the bootstrap daemon, so the node no longer falls back to it.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_remove_listener | ( | monero_daemon * | daemon, |
| monero_daemon_listener * | listener | ||
| ) |
Unregister a listener.
Returns after any callback of that listener in progress has finished.
| daemon | is the handle returned by monero_daemon_connect() |
| listener | is the listener to unregister |
| MONERO_EXPORT monero_result monero_daemon_remove_listeners | ( | monero_daemon * | daemon | ) |
Unregister all listeners of the daemon.
Returns after callbacks in progress have finished.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_reset_download_limit | ( | monero_daemon * | daemon, |
| int32_t * | out_limit | ||
| ) |
Reset the download bandwidth limit to the default.
| daemon | is the handle returned by monero_daemon_connect() |
| out_limit | receives the limit in effect after resetting it |
| MONERO_EXPORT monero_result monero_daemon_reset_upload_limit | ( | monero_daemon * | daemon, |
| int32_t * | out_limit | ||
| ) |
Reset the upload bandwidth limit to the default.
| daemon | is the handle returned by monero_daemon_connect() |
| out_limit | receives the limit in effect after resetting it |
| MONERO_EXPORT monero_result monero_daemon_save_blockchain | ( | monero_daemon * | daemon | ) |
Saves (flushes) the blockchain to disk.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_set_bootstrap_daemon | ( | monero_daemon * | daemon, |
| const char * | address, | ||
| const char * | username, | ||
| const char * | password, | ||
| const char * | proxy | ||
| ) |
Set the bootstrap daemon the node uses to serve requests while it is not fully synced.
| daemon | is the handle returned by monero_daemon_connect() |
| address | is the bootstrap daemon's address (host:port), "auto" to select a public node, or "" to disable it |
| username | is the username to authenticate with, or "" for none |
| password | is the password to authenticate with, or "" for none |
| proxy | is the proxy used to reach the bootstrap daemon, or "" for none |
| MONERO_EXPORT monero_result monero_daemon_set_download_limit | ( | monero_daemon * | daemon, |
| int32_t | limit, | ||
| int32_t * | out_limit | ||
| ) |
Set the download bandwidth limit.
| daemon | is the handle returned by monero_daemon_connect() |
| limit | is the limit to set, or -1 to reset it to the default |
| out_limit | receives the limit in effect after setting it |
| MONERO_EXPORT monero_result monero_daemon_set_incoming_peer_limit | ( | monero_daemon * | daemon, |
| int32_t | limit | ||
| ) |
Limits the number of incoming peers.
| daemon | is the handle returned by monero_daemon_connect() |
| limit | is the maximum number of incoming peers |
| MONERO_EXPORT monero_result monero_daemon_set_log_categories | ( | monero_daemon * | daemon, |
| const char * | categories, | ||
| char ** | out_categories | ||
| ) |
Set the daemon's log categories, e.g.
"*:WARNING,net.p2p:DEBUG".
| daemon | is the handle returned by monero_daemon_connect() |
| categories | are the log categories to set, or "" to reset them to the default |
| out_categories | receives the log categories in effect, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_set_log_hash_rate | ( | monero_daemon * | daemon, |
| bool | is_visible | ||
| ) |
Show or hide the mining hash rate in the daemon's console log.
The daemon must be mining (see monero_daemon_start_mining()), otherwise the call fails.
| daemon | is the handle returned by monero_daemon_connect() |
| is_visible | specifies if the hash rate is logged |
| MONERO_EXPORT monero_result monero_daemon_set_log_level | ( | monero_daemon * | daemon, |
| int32_t | level | ||
| ) |
Set the daemon's log level.
| daemon | is the handle returned by monero_daemon_connect() |
| level | is the log level, from 0 (least verbose) to 4 (most verbose) |
| MONERO_EXPORT monero_result monero_daemon_set_outgoing_peer_limit | ( | monero_daemon * | daemon, |
| int32_t | limit | ||
| ) |
Limits the number of outgoing peers.
| daemon | is the handle returned by monero_daemon_connect() |
| limit | is the maximum number of outgoing peers |
| MONERO_EXPORT monero_result monero_daemon_set_peer_ban | ( | monero_daemon * | daemon, |
| const char * | ban_json | ||
| ) |
Bans a peer node.
| daemon | is the handle returned by monero_daemon_connect() |
| ban_json | is a JSON-serialized monero_ban to apply |
| MONERO_EXPORT monero_result monero_daemon_set_peer_bans | ( | monero_daemon * | daemon, |
| const char * | bans_json | ||
| ) |
Bans peer nodes.
| daemon | is the handle returned by monero_daemon_connect() |
| bans_json | is a JSON array of monero_ban to apply |
| MONERO_EXPORT monero_result monero_daemon_set_poll_period | ( | monero_daemon * | daemon, |
| uint64_t | period_ms | ||
| ) |
Set how often the listeners poll the daemon for new blocks.
| daemon | is the handle returned by monero_daemon_connect() |
| period_ms | is the poll period in milliseconds, from 1 to 2147483647. A period of 0 would poll again at once, over and over |
| MONERO_EXPORT monero_result monero_daemon_set_upload_limit | ( | monero_daemon * | daemon, |
| int32_t | limit, | ||
| int32_t * | out_limit | ||
| ) |
Set the upload bandwidth limit.
| daemon | is the handle returned by monero_daemon_connect() |
| limit | is the limit to set, or -1 to reset it to the default |
| out_limit | receives the limit in effect after setting it |
| MONERO_EXPORT monero_result monero_daemon_start_mining | ( | monero_daemon * | daemon, |
| const char * | address, | ||
| const uint64_t * | num_threads, | ||
| const bool * | is_background, | ||
| const bool * | ignore_battery | ||
| ) |
Start mining.
| daemon | is the handle returned by monero_daemon_connect() |
| address | is the address that receives the rewards if the daemon mines a block |
| num_threads | is the number of mining threads, or NULL for the daemon's default |
| is_background | specifies if the miner runs in the background, or NULL for the daemon's default |
| ignore_battery | specifies if the battery state is ignored, or NULL for the daemon's default |
| MONERO_EXPORT monero_result monero_daemon_stop | ( | monero_daemon * | daemon | ) |
Safely disconnects from and shuts down the daemon.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_stop_mining | ( | monero_daemon * | daemon | ) |
Stop mining.
| daemon | is the handle returned by monero_daemon_connect() |
| MONERO_EXPORT monero_result monero_daemon_submit_block | ( | monero_daemon * | daemon, |
| const char * | block_blob | ||
| ) |
Submit a mined block to the network.
| daemon | is the handle returned by monero_daemon_connect() |
| block_blob | is the mined block to submit |
| MONERO_EXPORT monero_result monero_daemon_submit_blocks | ( | monero_daemon * | daemon, |
| const char *const * | block_blobs, | ||
| size_t | num_block_blobs | ||
| ) |
Submit mined blocks to the network.
| daemon | is the handle returned by monero_daemon_connect() |
| block_blobs | are the mined blocks to submit |
| num_block_blobs | is the number of elements in block_blobs |
| MONERO_EXPORT monero_result monero_daemon_submit_tx_hex | ( | monero_daemon * | daemon, |
| const char * | tx_hex, | ||
| bool | do_not_relay, | ||
| char ** | out_json | ||
| ) |
Submit a transaction to the daemon's pool.
| daemon | is the handle returned by monero_daemon_connect() |
| tx_hex | is the raw transaction hex to submit |
| do_not_relay | specifies if the transaction should not be relayed |
| out_json | receives a JSON-serialized monero_submit_tx_result, freed with monero_utils_free() |
| MONERO_EXPORT monero_result monero_daemon_wait_for_next_block_header | ( | monero_daemon * | daemon, |
| char ** | out_json | ||
| ) |
Wait for the next block and return its header.
Only the calling thread blocks. Other calls on the same handle can run meanwhile. Fails if no block arrives within 30 minutes.
| daemon | is the handle returned by monero_daemon_connect() |
| out_json | receives a JSON-serialized monero_block_header, freed with monero_utils_free() |