Crate libbitcoinkernel_sys

Crate libbitcoinkernel_sys 

Source

Structs§

btck_Block
btck_BlockHash
btck_BlockSpentOutputs
btck_BlockTreeEntry
btck_BlockValidationState
btck_Chain
btck_ChainParameters
btck_ChainstateManager
btck_ChainstateManagerOptions
btck_Coin
btck_Context
btck_ContextOptions
btck_LoggingConnection
btck_LoggingOptions
Options controlling the format of log messages.
btck_NotificationInterfaceCallbacks
A struct for holding the kernel notification callbacks. The user data pointer may be used to point to user-defined structures to make processing the notifications easier.
btck_ScriptPubkey
btck_Transaction
btck_TransactionInput
btck_TransactionOutPoint
btck_TransactionOutput
btck_TransactionSpentOutputs
btck_Txid
btck_ValidationInterfaceCallbacks
Holds the validation interface callbacks. The user data pointer may be used to point to user-defined structures to make processing the validation callbacks easier. Note that these callbacks block any further validation execution when they are called.

Functions§

btck_block_copy
@brief Copy a block. Blocks are reference counted, so this just increments the reference count.
btck_block_count_transactions
@brief Count the number of transactions contained in a block.
btck_block_create
@brief Parse a serialized raw block into a new block object.
btck_block_destroy
Destroy the block.
btck_block_get_hash
@brief Calculate and return the hash of a block.
btck_block_get_transaction_at
@brief Get the transaction at the provided index. The returned transaction is not owned and depends on the lifetime of the block.
btck_block_hash_copy
@brief Copy a block hash.
btck_block_hash_create
@brief Create a block hash from its raw data.
btck_block_hash_destroy
Destroy the block hash.
btck_block_hash_equals
@brief Check if two block hashes are equal.
btck_block_hash_to_bytes
@brief Serializes the block hash to bytes.
btck_block_read
@brief Reads the block the passed in block tree entry points to from disk and returns it.
btck_block_spent_outputs_copy
@brief Copy a block’s spent outputs.
btck_block_spent_outputs_count
@brief Returns the number of transaction spent outputs whose data is contained in block spent outputs.
btck_block_spent_outputs_destroy
Destroy the block spent outputs.
btck_block_spent_outputs_get_transaction_spent_outputs_at
@brief Returns a transaction spent outputs contained in the block spent outputs at a certain index. The returned pointer is unowned and only valid for the lifetime of block_spent_outputs.
btck_block_spent_outputs_read
@brief Reads the block spent coins data the passed in block tree entry points to from disk and returns it.
btck_block_to_bytes
@brief Serializes the block through the passed in callback to bytes. This is consensus serialization that is also used for the P2P network.
btck_block_tree_entry_get_block_hash
@brief Return the block hash associated with a block tree entry.
btck_block_tree_entry_get_height
@brief Return the height of a certain block tree entry.
btck_block_tree_entry_get_previous
@brief Returns the previous block tree entry in the tree, or null if the current block tree entry is the genesis block.
btck_block_validation_state_get_block_validation_result
Returns the validation result from an opaque block validation state pointer.
btck_block_validation_state_get_validation_mode
Returns the validation mode from an opaque block validation state pointer.
btck_chain_contains
@brief Return true if the passed in chain contains the block tree entry.
btck_chain_get_by_height
@brief Retrieve a block tree entry by its height in the currently active chain. Once retrieved there is no guarantee that it remains in the active chain.
btck_chain_get_height
@brief Return the height of the tip of the chain.
btck_chain_parameters_copy
Copy the chain parameters.
btck_chain_parameters_create
@brief Creates a chain parameters struct with default parameters based on the passed in chain type.
btck_chain_parameters_destroy
Destroy the chain parameters.
btck_chainstate_manager_create
@brief Create a chainstate manager. This is the main object for many validation tasks as well as for retrieving data from the chain and interacting with its chainstate and indexes.
btck_chainstate_manager_destroy
Destroy the chainstate manager.
btck_chainstate_manager_get_active_chain
@brief Returns the best known currently active chain. Its lifetime is dependent on the chainstate manager. It can be thought of as a view on a vector of block tree entries that form the best chain. The returned chain reference always points to the currently active best chain. However, state transitions within the chainstate manager (e.g., processing blocks) will update the chain’s contents. Data retrieved from this chain is only consistent up to the point when new data is processed in the chainstate manager. It is the user’s responsibility to guard against these inconsistencies.
btck_chainstate_manager_get_block_tree_entry_by_hash
@brief Retrieve a block tree entry by its block hash.
btck_chainstate_manager_import_blocks
@brief Triggers the start of a reindex if the wipe options were previously set for the chainstate manager. Can also import an array of existing block files selected by the user.
btck_chainstate_manager_options_create
@brief Create options for the chainstate manager.
btck_chainstate_manager_options_destroy
Destroy the chainstate manager options.
btck_chainstate_manager_options_set_wipe_dbs
@brief Sets wipe db in the options. In combination with calling @ref btck_chainstate_manager_import_blocks this triggers either a full reindex, or a reindex of just the chainstate database.
btck_chainstate_manager_options_set_worker_threads_num
@brief Set the number of available worker threads used during validation.
btck_chainstate_manager_options_update_block_tree_db_in_memory
@brief Sets block tree db in memory in the options.
btck_chainstate_manager_options_update_chainstate_db_in_memory
@brief Sets chainstate db in memory in the options.
btck_chainstate_manager_process_block
@brief Process and validate the passed in block with the chainstate manager. Processing first does checks on the block, and if these passed, saves it to disk. It then validates the block against the utxo set. If it is valid, the chain is extended with it. The return value is not indicative of the block’s validity. Detailed information on the validity of the block can be retrieved by registering the block_checked callback in the validation interface.
btck_coin_confirmation_height
@brief Returns the block height where the transaction that created this coin was included in.
btck_coin_copy
@brief Copy a coin.
btck_coin_destroy
Destroy the coin.
btck_coin_get_output
@brief Return the transaction output of a coin. The returned pointer is unowned and only valid for the lifetime of the coin.
btck_coin_is_coinbase
@brief Returns whether the containing transaction was a coinbase.
btck_context_copy
Copy the context.
btck_context_create
@brief Create a new kernel context. If the options have not been previously set, their corresponding fields will be initialized to default values; the context will assume mainnet chain parameters and won’t attempt to call the kernel notification callbacks.
btck_context_destroy
Destroy the context.
btck_context_interrupt
@brief Interrupt can be used to halt long-running validation functions like when reindexing, importing or processing blocks.
btck_context_options_create
Creates an empty context options.
btck_context_options_destroy
Destroy the context options.
btck_context_options_set_chainparams
@brief Sets the chain params for the context options. The context created with the options will be configured for these chain parameters.
btck_context_options_set_notifications
@brief Set the kernel notifications for the context options. The context created with the options will be configured with these notifications.
btck_context_options_set_validation_interface
@brief Set the validation interface callbacks for the context options. The context created with the options will be configured for these validation interface callbacks. The callbacks will then be triggered from validation events issued by the chainstate manager created from the same context.
btck_logging_connection_create
@brief Start logging messages through the provided callback. Log messages produced before this function is first called are buffered and on calling this function are logged immediately.
btck_logging_connection_destroy
Stop logging and destroy the logging connection.
btck_logging_disable
@brief This disables the global internal logger. No log messages will be buffered internally anymore once this is called and the buffer is cleared. This function should only be called once and is not thread or re-entry safe. Log messages will be buffered until this function is called, or a logging connection is created. This must not be called while a logging connection already exists.
btck_logging_disable_category
@brief Disable a specific log category for the global internal logger. This changes a global setting and will override settings for all existing @ref btck_LoggingConnection instances.
btck_logging_enable_category
@brief Enable a specific log category for the global internal logger. This changes a global setting and will override settings for all existing @ref btck_LoggingConnection instances.
btck_logging_set_level_category
@brief Set the log level of the global internal logger. This does not enable the selected categories. Use @ref btck_logging_enable_category to start logging from a specific, or all categories. This changes a global setting and will override settings for all existing @ref btck_LoggingConnection instances.
btck_logging_set_options
@brief Set some options for the global internal logger. This changes global settings and will override settings for all existing @ref btck_LoggingConnection instances.
btck_script_pubkey_copy
@brief Copy a script pubkey.
btck_script_pubkey_create
@brief Create a script pubkey from serialized data. @param[in] script_pubkey Serialized script pubkey. @param[in] script_pubkey_len Length of the script pubkey data. @return The script pubkey.
btck_script_pubkey_destroy
Destroy the script pubkey.
btck_script_pubkey_to_bytes
@brief Serializes the script pubkey through the passed in callback to bytes.
btck_script_pubkey_verify
@brief Verify if the input at input_index of tx_to spends the script pubkey under the constraints specified by flags. If the btck_ScriptVerificationFlags_WITNESS flag is set in the flags bitfield, the amount parameter is used. If the taproot flag is set, the spent outputs parameter is used to validate taproot transactions.
btck_transaction_copy
@brief Copy a transaction. Transactions are reference counted, so this just increments the reference count.
btck_transaction_count_inputs
@brief Get the number of inputs of a transaction.
btck_transaction_count_outputs
@brief Get the number of outputs of a transaction.
btck_transaction_create
@brief Create a new transaction from the serialized data.
btck_transaction_destroy
Destroy the transaction.
btck_transaction_get_input_at
@brief Get the transaction input at the provided index. The returned transaction input is not owned and depends on the lifetime of the transaction.
btck_transaction_get_output_at
@brief Get the transaction outputs at the provided index. The returned transaction output is not owned and depends on the lifetime of the transaction.
btck_transaction_get_txid
@brief Get the txid of a transaction. The returned txid is not owned and depends on the lifetime of the transaction.
btck_transaction_input_copy
@brief Copy a transaction input.
btck_transaction_input_destroy
Destroy the transaction input.
btck_transaction_input_get_out_point
@brief Get the transaction out point. The returned transaction out point is not owned and depends on the lifetime of the transaction.
btck_transaction_out_point_copy
@brief Copy a transaction out point.
btck_transaction_out_point_destroy
Destroy the transaction out point.
btck_transaction_out_point_get_index
@brief Get the output position from the transaction out point.
btck_transaction_out_point_get_txid
@brief Get the txid from the transaction out point. The returned txid is not owned and depends on the lifetime of the transaction out point.
btck_transaction_output_copy
@brief Copy a transaction output.
btck_transaction_output_create
@brief Create a transaction output from a script pubkey and an amount.
btck_transaction_output_destroy
Destroy the transaction output.
btck_transaction_output_get_amount
@brief Get the amount in the output.
btck_transaction_output_get_script_pubkey
@brief Get the script pubkey of the output. The returned script pubkey is not owned and depends on the lifetime of the transaction output.
btck_transaction_spent_outputs_copy
@brief Copy a transaction’s spent outputs.
btck_transaction_spent_outputs_count
@brief Returns the number of previous transaction outputs contained in the transaction spent outputs data.
btck_transaction_spent_outputs_destroy
Destroy the transaction spent outputs.
btck_transaction_spent_outputs_get_coin_at
@brief Returns a coin contained in the transaction spent outputs at a certain index. The returned pointer is unowned and only valid for the lifetime of transaction_spent_outputs.
btck_transaction_to_bytes
@brief Serializes the transaction through the passed in callback to bytes. This is consensus serialization that is also used for the P2P network.
btck_txid_copy
@brief Copy a txid.
btck_txid_destroy
Destroy the txid.
btck_txid_equals
@brief Check if two txids are equal.
btck_txid_to_bytes
@brief Serializes the txid to bytes.

Type Aliases§

btck_BlockValidationResult
A granular “reason” why a block was invalid.
btck_ChainType
btck_DestroyCallback
Function signature for freeing user data.
btck_LogCallback
Function signature for the global logging callback. All bitcoin kernel internal logs will pass through this callback.
btck_LogCategory
A collection of logging categories that may be encountered by kernel code.
btck_LogLevel
The level at which logs should be produced.
btck_NotifyBlockTip
Function signatures for the kernel notifications.
btck_NotifyFatalError
btck_NotifyFlushError
btck_NotifyHeaderTip
btck_NotifyProgress
btck_NotifyWarningSet
btck_NotifyWarningUnset
btck_ScriptVerificationFlags
Script verification flags that may be composed with each other.
btck_ScriptVerifyStatus
A collection of status codes that may be issued by the script verify function.
btck_SynchronizationState
Current sync state passed to tip changed callbacks.
btck_ValidationInterfaceBlockChecked
Function signatures for the validation interface.
btck_ValidationInterfaceBlockConnected
btck_ValidationInterfaceBlockDisconnected
btck_ValidationInterfacePoWValidBlock
btck_ValidationMode
Whether a validated data structure is valid, invalid, or an error was encountered during processing.
btck_Warning
Possible warning types issued by validation.
btck_WriteBytes
Function signature for serializing data.
int_fast8_t
int_fast16_t
int_fast32_t
int_fast64_t
int_least8_t
int_least16_t
int_least32_t
int_least64_t
intmax_t
max_align_t
uint_fast8_t
uint_fast16_t
uint_fast32_t
uint_fast64_t
uint_least8_t
uint_least16_t
uint_least32_t
uint_least64_t
uintmax_t
wchar_t